Fix for backward compatibility with lodash 2.4 (indexBy() => keyBy()).

This commit is contained in:
Alexander Zobnin
2016-11-07 21:15:31 +03:00
parent ca97d392e9
commit 912bf825e7

View File

@@ -116,7 +116,7 @@ angular.module('grafana.services').factory('ZabbixCachingProxy', function($q, $i
var deferred = this.$q.defer(); var deferred = this.$q.defer();
var historyStorage = this.storage.history; var historyStorage = this.storage.history;
var full_history; var full_history;
var expired = _.filter(_.groupBy(items, 'itemid'), function(item, itemid) { var expired = _.filter(_.keyBy(items, 'itemid'), function(item, itemid) {
return !historyStorage[itemid]; return !historyStorage[itemid];
}); });
if (expired.length) { if (expired.length) {
@@ -235,3 +235,6 @@ String.prototype.getHash = function() {
} }
return hash; return hash;
}; };
// Fix for backward compatibility with lodash 2.4
if (!_.keyBy) {_.keyBy = _.indexBy;}