diff --git a/public/app/core/directives/diff-view.ts b/public/app/core/directives/diff-view.ts index b82b23951b7..db76681498c 100644 --- a/public/app/core/directives/diff-view.ts +++ b/public/app/core/directives/diff-view.ts @@ -7,14 +7,15 @@ export class DeltaCtrl { observer: any; /** @ngInject */ - constructor($rootScope) { - const waitForCompile = function(mutations) { + constructor(private $rootScope) { + + const waitForCompile = (mutations) => { if (mutations.length === 1) { this.$rootScope.appEvent('json-diff-ready'); } }; - this.observer = new MutationObserver(waitForCompile.bind(this)); + this.observer = new MutationObserver(waitForCompile); const observerConfig = { attributes: true, diff --git a/public/app/features/dashboard/model.ts b/public/app/features/dashboard/model.ts index 7c4cdfac59e..cd48cd1ef00 100644 --- a/public/app/features/dashboard/model.ts +++ b/public/app/features/dashboard/model.ts @@ -35,7 +35,6 @@ export class DashboardModel { gnetId: any; meta: any; events: any; - editMode: boolean; constructor(data, meta?) { if (!data) { diff --git a/public/app/features/dashboard/unsavedChangesSrv.js b/public/app/features/dashboard/unsavedChangesSrv.js index 766ebce0b59..b00a0d02f1b 100644 --- a/public/app/features/dashboard/unsavedChangesSrv.js +++ b/public/app/features/dashboard/unsavedChangesSrv.js @@ -73,7 +73,6 @@ function(angular, _) { dash.time = 0; dash.refresh = 0; dash.schemaVersion = 0; - dash.editMode = false; // filter row and panels properties that should be ignored dash.rows = _.filter(dash.rows, function(row) { diff --git a/public/app/features/dashboard/viewStateSrv.js b/public/app/features/dashboard/viewStateSrv.js index 2847e52ebfa..550981f04ed 100644 --- a/public/app/features/dashboard/viewStateSrv.js +++ b/public/app/features/dashboard/viewStateSrv.js @@ -154,7 +154,6 @@ function (angular, _, $, config) { ctrl.editMode = false; ctrl.fullscreen = false; - ctrl.dashboard.editMode = this.oldDashboardEditMode; this.$scope.appEvent('panel-fullscreen-exit', {panelId: ctrl.panel.id}); @@ -176,10 +175,8 @@ function (angular, _, $, config) { ctrl.editMode = this.state.edit && this.dashboard.meta.canEdit; ctrl.fullscreen = true; - this.oldDashboardEditMode = this.dashboard.editMode; this.oldTimeRange = ctrl.range; this.fullscreenPanel = panelScope; - this.dashboard.editMode = false; $(window).scrollTop(0); diff --git a/public/app/plugins/datasource/prometheus/datasource.ts b/public/app/plugins/datasource/prometheus/datasource.ts index 98776f37962..c4939b5b2fa 100644 --- a/public/app/plugins/datasource/prometheus/datasource.ts +++ b/public/app/plugins/datasource/prometheus/datasource.ts @@ -1,5 +1,3 @@ -/// - import _ from 'lodash'; import kbn from 'app/core/utils/kbn'; @@ -122,7 +120,7 @@ export class PrometheusDatasource { } else { for (let metricData of response.data.data.result) { if (response.data.data.resultType === 'matrix') { - result.push(self.transformMetricData(metricData, activeTargets[index], start, end)); + result.push(self.transformMetricData(metricData, activeTargets[index], start, end, queries[index].step)); } else if (response.data.data.resultType === 'vector') { result.push(self.transformInstantMetricData(metricData, activeTargets[index])); } @@ -144,7 +142,6 @@ export class PrometheusDatasource { var intervalFactor = target.intervalFactor || 1; // Adjust the interval to take into account any specified minimum and interval factor plus Prometheus limits var adjustedInterval = this.adjustInterval(interval, minInterval, range, intervalFactor); - var scopedVars = options.scopedVars; // If the interval was adjusted, make a shallow copy of scopedVars with updated interval vars if (interval !== adjustedInterval) { @@ -154,7 +151,7 @@ export class PrometheusDatasource { "__interval_ms": {text: interval * 1000, value: interval * 1000}, }); } - target.step = query.step = interval; + query.step = interval; // Only replace vars in expression after having (possibly) updated interval vars query.expr = this.templateSrv.replace(target.expr, scopedVars, this.interpolateQueryExpr); @@ -272,13 +269,13 @@ export class PrometheusDatasource { }); } - transformMetricData(md, options, start, end) { + transformMetricData(md, options, start, end, step) { var dps = [], metricLabel = null; metricLabel = this.createMetricLabel(md.metric, options); - var stepMs = parseInt(options.step) * 1000; + var stepMs = step * 1000; var baseTimestamp = start * 1000; for (let value of md.values) { var dp_value = parseFloat(value[1]);