From 9e2255e9f11daffd29fdf775c577b870f3f9b6c1 Mon Sep 17 00:00:00 2001 From: rozetko Date: Wed, 15 May 2019 04:14:41 +0300 Subject: [PATCH] Seasonality checkbox is disabled on clearing seasonality period input #304 (#305) --- src/panel/graph_panel/controllers/analytic_controller.ts | 5 ++++- src/panel/graph_panel/graph_ctrl.ts | 4 ++-- src/panel/graph_panel/partials/tab_analytics.html | 5 +++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/panel/graph_panel/controllers/analytic_controller.ts b/src/panel/graph_panel/controllers/analytic_controller.ts index d5c600c..65cf5c9 100644 --- a/src/panel/graph_panel/controllers/analytic_controller.ts +++ b/src/panel/graph_panel/controllers/analytic_controller.ts @@ -696,8 +696,11 @@ export class AnalyticController { .forEach(unit => unit.inspect = false); } - public async updateSeasonality(id: AnalyticUnitId) { + public async updateSeasonality(id: AnalyticUnitId, value?: number) { const analyticUnit = this._analyticUnitsSet.byId(id) as AnomalyAnalyticUnit; + if(value !== undefined) { + analyticUnit.seasonalityPeriod.value = value; + } await this.saveAnalyticUnit(analyticUnit); } diff --git a/src/panel/graph_panel/graph_ctrl.ts b/src/panel/graph_panel/graph_ctrl.ts index 60dc7ef..700a607 100644 --- a/src/panel/graph_panel/graph_ctrl.ts +++ b/src/panel/graph_panel/graph_ctrl.ts @@ -682,8 +682,8 @@ class GraphCtrl extends MetricsPanelCtrl { this.refresh(); } - onSeasonalityChange(id: AnalyticUnitId) { - this.analyticsController.updateSeasonality(id); + onSeasonalityChange(id: AnalyticUnitId, value?: number) { + this.analyticsController.updateSeasonality(id, value); this.refresh(); } diff --git a/src/panel/graph_panel/partials/tab_analytics.html b/src/panel/graph_panel/partials/tab_analytics.html index b4f0792..6b04f39 100644 --- a/src/panel/graph_panel/partials/tab_analytics.html +++ b/src/panel/graph_panel/partials/tab_analytics.html @@ -253,8 +253,9 @@