Skip to content

Commit

Permalink
Fix templatig issue, when no values returned, closes #354
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderzobnin committed Feb 11, 2017
1 parent eca8096 commit 94c24e9
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion dist/datasource-zabbix/datasource.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/datasource-zabbix/datasource.js.map

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions dist/datasource-zabbix/zabbix.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/datasource-zabbix/zabbix.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/test/datasource-zabbix/datasource.js
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ var ZabbixAPIDatasource = function () {
}

return result.then(function (metrics) {
return metrics.map(formatMetric);
return _lodash2.default.map(metrics, formatMetric);
});
}

Expand Down
8 changes: 4 additions & 4 deletions dist/test/datasource-zabbix/zabbix.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,14 +214,14 @@ _angular2.default.module('grafana.services').factory('Zabbix', ZabbixFactory);
* 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 = _lodash2.default.find(list, { 'name': name });
if (finded) {
return [finded];
} else {
return undefined;
return [];
}
}

Expand All @@ -231,14 +231,14 @@ function findByName(list, name) {
* 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 = _lodash2.default.filter(list, { 'name': name });
if (finded) {
return finded;
} else {
return undefined;
return [];
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/datasource-zabbix/datasource.js
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ class ZabbixAPIDatasource {
}

return result.then(metrics => {
return metrics.map(formatMetric);
return _.map(metrics, formatMetric);
});
}

Expand Down
8 changes: 4 additions & 4 deletions src/datasource-zabbix/zabbix.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,14 +165,14 @@ angular
* 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 [];
}
}

Expand All @@ -182,14 +182,14 @@ function findByName(list, name) {
* 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 [];
}
}

Expand Down

0 comments on commit 94c24e9

Please sign in to comment.