From dee91d34d78be56d912f5c9c179b072250d47905 Mon Sep 17 00:00:00 2001 From: Stas Vilchik Date: Mon, 3 Mar 2014 13:46:43 +0100 Subject: [PATCH] SONAR-4366 Quality Gates: prepare for the permissions stuff --- .../views/quality-gate-detail-condition-view.coffee | 3 ++- .../views/quality-gate-detail-condition-view.js | 8 +++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/sonar-server/src/main/webapp/javascripts/quality-gate/views/quality-gate-detail-condition-view.coffee b/sonar-server/src/main/webapp/javascripts/quality-gate/views/quality-gate-detail-condition-view.coffee index 72f1d4abd0e..6f417be31b5 100644 --- a/sonar-server/src/main/webapp/javascripts/quality-gate/views/quality-gate-detail-condition-view.coffee +++ b/sonar-server/src/main/webapp/javascripts/quality-gate/views/quality-gate-detail-condition-view.coffee @@ -103,7 +103,8 @@ define [ serializeData: -> + period = _.findWhere(window.SS.metricPeriods, key: '' + this.model.get('period')) _.extend super, canEdit: @options.app.canEdit periods: window.SS.metricPeriods - periodText: _.findWhere(window.SS.metricPeriods, key: '' + this.model.get('period')).text + periodText: period?.text diff --git a/sonar-server/src/main/webapp/javascripts/quality-gate/views/quality-gate-detail-condition-view.js b/sonar-server/src/main/webapp/javascripts/quality-gate/views/quality-gate-detail-condition-view.js index 1b7c39ee421..e7426777ee8 100644 --- a/sonar-server/src/main/webapp/javascripts/quality-gate/views/quality-gate-detail-condition-view.js +++ b/sonar-server/src/main/webapp/javascripts/quality-gate/views/quality-gate-detail-condition-view.js @@ -123,12 +123,14 @@ }; QualityGateDetailConditionView.prototype.serializeData = function() { + var period; + period = _.findWhere(window.SS.metricPeriods, { + key: '' + this.model.get('period') + }); return _.extend(QualityGateDetailConditionView.__super__.serializeData.apply(this, arguments), { canEdit: this.options.app.canEdit, periods: window.SS.metricPeriods, - periodText: _.findWhere(window.SS.metricPeriods, { - key: '' + this.model.get('period') - }).text + periodText: period != null ? period.text : void 0 }); }; -- 2.39.5