Fix templatig issue, when no values returned, closes #354

This commit is contained in:
Alexander Zobnin
2017-02-11 16:26:23 +03:00
parent eca809679d
commit 94c24e9be4
8 changed files with 17 additions and 17 deletions

View File

@@ -484,7 +484,7 @@ System.register(['lodash', 'app/core/utils/datemath', './utils', './migrations',
}
return result.then(function (metrics) {
return metrics.map(formatMetric);
return _.map(metrics, formatMetric);
});
}
}, {

File diff suppressed because one or more lines are too long

View File

@@ -194,14 +194,14 @@ System.register(['angular', 'lodash', './utils', './zabbixAPI.service.js', './za
* Find group, host, app or item by given name.
* @param list list of groups, apps or other
* @param name visible name
* @return array with finded element or undefined
* @return array with finded element or empty array
*/
function findByName(list, name) {
var finded = _.find(list, { 'name': name });
if (finded) {
return [finded];
} else {
return undefined;
return [];
}
}
@@ -211,14 +211,14 @@ System.register(['angular', 'lodash', './utils', './zabbixAPI.service.js', './za
* which return only first finded.
* @param {[type]} list list of elements
* @param {[type]} name app name
* @return {[type]} array with finded element or undefined
* @return {[type]} array with finded element or empty array
*/
function filterByName(list, name) {
var finded = _.filter(list, { 'name': name });
if (finded) {
return finded;
} else {
return undefined;
return [];
}
}

File diff suppressed because one or more lines are too long