From cb479d737b8b5054e9b5f2cc9d2cdf01c6c1e3ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Tue, 2 Sep 2014 07:58:29 +0200 Subject: [PATCH] Graphite: Fix for nonNegativeDerivative function, now possible to not include optional first parameter maxValue, Closes #702 --- CHANGELOG.md | 1 + src/app/directives/graphiteFuncEditor.js | 4 ++-- src/app/services/dashboard/dashboardViewStateSrv.js | 4 ---- src/app/services/graphite/gfunc.js | 4 ++-- 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b7b5ce75b45..adf4db4a525 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ - [Issue #696](https://github.com/grafana/grafana/issues/696). Graph: Fix for y-axis format 'none' when values are in scientific notation (ex 2.3e-13) - [Issue #733](https://github.com/grafana/grafana/issues/733). Graph: Fix for tooltip current value decimal precision when 'none' axis format was selected - [Issue #697](https://github.com/grafana/grafana/issues/697). Graphite: Fix for Glob syntax in graphite queries ([1-9] and ?) that made the query editor / parser bail and fallback to a text box. +- [Issue #702](https://github.com/grafana/grafana/issues/702). Graphite: Fix for nonNegativeDerivative function, now possible to not include optional first parameter maxValue - [Issue #277](https://github.com/grafana/grafana/issues/277). Dashboard: Fix for timepicker date & tooltip when UTC timezone selected. - [Issue #699](https://github.com/grafana/grafana/issues/699). Dashboard: Fix for bug when adding rows from dashboard settings dialog. - [Issue #723](https://github.com/grafana/grafana/issues/723). Dashboard: Fix for hide controls setting not used/initialized on dashboard load diff --git a/src/app/directives/graphiteFuncEditor.js b/src/app/directives/graphiteFuncEditor.js index 8aa0551b18a..57f1294a2df 100644 --- a/src/app/directives/graphiteFuncEditor.js +++ b/src/app/directives/graphiteFuncEditor.js @@ -147,7 +147,7 @@ function (angular, _, $) { $funcLink.appendTo(elem); _.each(funcDef.params, function(param, index) { - if (param.optional && !func.params[index]) { + if (param.optional && func.params.length !== index + 1) { return; } @@ -239,4 +239,4 @@ function (angular, _, $) { }); -}); \ No newline at end of file +}); diff --git a/src/app/services/dashboard/dashboardViewStateSrv.js b/src/app/services/dashboard/dashboardViewStateSrv.js index 1c3b1d471dd..64d217f3dec 100644 --- a/src/app/services/dashboard/dashboardViewStateSrv.js +++ b/src/app/services/dashboard/dashboardViewStateSrv.js @@ -21,10 +21,6 @@ function (angular, _, $) { } }; - $scope.onAppEvent('dashboard-saved', function() { - self.update({ fullscreen: false }); - }); - $scope.onAppEvent('$routeUpdate', function() { var urlState = self.getQueryStringState(); if (self.needsSync(urlState)) { diff --git a/src/app/services/graphite/gfunc.js b/src/app/services/graphite/gfunc.js index 9339999f475..ce0910326d8 100644 --- a/src/app/services/graphite/gfunc.js +++ b/src/app/services/graphite/gfunc.js @@ -280,8 +280,8 @@ function (_) { addFuncDef({ name: 'nonNegativeDerivative', category: categories.Transform, - params: [{ name: "max value or 0", type: "int", }], - defaultParams: [0] + params: [{ name: "max value or 0", type: "int", optional: true }], + defaultParams: [''] }); addFuncDef({