From 22f4f15a55453730deb1aacc6ceb975e12d9adf3 Mon Sep 17 00:00:00 2001 From: sanke1 <22073083+sankerust@users.noreply.github.com> Date: Fri, 8 Feb 2019 19:27:00 +0300 Subject: [PATCH] Threshold change button #161 (#171) * remove blur event handler from threshold input fields * Send threshold parameters to server via button click * disable 'Apply' button on Learning || Pending statuses --- .../graph_panel/controllers/analytic_controller.ts | 5 +++++ src/panel/graph_panel/partials/tab_analytics.html | 12 +++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/panel/graph_panel/controllers/analytic_controller.ts b/src/panel/graph_panel/controllers/analytic_controller.ts index 0d713f0..ba3705e 100644 --- a/src/panel/graph_panel/controllers/analytic_controller.ts +++ b/src/panel/graph_panel/controllers/analytic_controller.ts @@ -76,6 +76,11 @@ export class AnalyticController { return result; } + async sendThresholdParamsToServer(id: AnalyticUnitId) { + await this.saveThreshold(id); + await this._runStatusWaiter(this._analyticUnitsSet.byId(id)); + } + createNew() { this._newAnalyticUnit = new AnalyticUnit(); this._creatingNewAnalyticType = true; diff --git a/src/panel/graph_panel/partials/tab_analytics.html b/src/panel/graph_panel/partials/tab_analytics.html index 0fa90e9..8a4e3f7 100644 --- a/src/panel/graph_panel/partials/tab_analytics.html +++ b/src/panel/graph_panel/partials/tab_analytics.html @@ -68,9 +68,7 @@ ng-model="ctrl.analyticsController.getThreshold(analyticUnit.id).condition" ng-options="type for type in ctrl.analyticsController.conditions" ng-if="analyticUnit.detectorType === 'threshold'" - ng-blur="ctrl.analyticsController.saveThreshold(analyticUnit.id)" /> - + +