From 6609543936253149851cbbcbb89d197a89eb2392 Mon Sep 17 00:00:00 2001 From: Stas Vilchik Date: Mon, 1 Jun 2015 16:02:43 +0200 Subject: [PATCH] fix quality flaws --- .../js/apps/quality-gates/gate-conditions-view.js | 4 ++-- .../src/main/js/apps/quality-gates/gates-view.js | 2 +- .../js/components/issue/views/assign-form-view.js | 14 +++++++------- .../js/components/issue/views/tags-form-view.js | 14 +++++++------- .../sonar-web/src/main/js/libs/widgets/treemap.js | 4 ++-- 5 files changed, 19 insertions(+), 19 deletions(-) diff --git a/server/sonar-web/src/main/js/apps/quality-gates/gate-conditions-view.js b/server/sonar-web/src/main/js/apps/quality-gates/gate-conditions-view.js index 5c8353b7e00..5ec13c6734a 100644 --- a/server/sonar-web/src/main/js/apps/quality-gates/gate-conditions-view.js +++ b/server/sonar-web/src/main/js/apps/quality-gates/gate-conditions-view.js @@ -55,10 +55,10 @@ define([ return !metric.hidden; }); metrics = _.groupBy(metrics, 'domain'); - metrics = _.map(metrics, function (metrics, domain) { + metrics = _.map(metrics, function (list, domain) { return { domain: domain, - metrics: _.sortBy(metrics, 'short_name') + metrics: _.sortBy(list, 'short_name') }; }); return _.sortBy(metrics, 'domain'); diff --git a/server/sonar-web/src/main/js/apps/quality-gates/gates-view.js b/server/sonar-web/src/main/js/apps/quality-gates/gates-view.js index 2fa1ceb6d18..6c05b728d55 100644 --- a/server/sonar-web/src/main/js/apps/quality-gates/gates-view.js +++ b/server/sonar-web/src/main/js/apps/quality-gates/gates-view.js @@ -19,7 +19,7 @@ define([ highlight: function (id) { this.highlighted = id; this.render(); - }, + } }); }); diff --git a/server/sonar-web/src/main/js/components/issue/views/assign-form-view.js b/server/sonar-web/src/main/js/components/issue/views/assign-form-view.js index 9bda9b4ea5c..f2894e865af 100644 --- a/server/sonar-web/src/main/js/components/issue/views/assign-form-view.js +++ b/server/sonar-web/src/main/js/components/issue/views/assign-form-view.js @@ -89,19 +89,19 @@ define([ onInputKeydown: function (e) { this.query = this.$('input').val(); if (e.keyCode === 38) { - return this.selectPreviousOption(); + this.selectPreviousOption(); } if (e.keyCode === 40) { - return this.selectNextOption(); + this.selectNextOption(); } if (e.keyCode === 13) { - return this.selectActiveOption(); - } - if (e.keyCode === 9) { - return false; + this.selectActiveOption(); } if (e.keyCode === 27) { - return this.close(); + this.close(); + } + if ([9, 13, 27, 38, 40].indexOf(e.keyCode) !== -1) { + return false; } }, diff --git a/server/sonar-web/src/main/js/components/issue/views/tags-form-view.js b/server/sonar-web/src/main/js/components/issue/views/tags-form-view.js index a750a245b63..ee04d7103c9 100644 --- a/server/sonar-web/src/main/js/components/issue/views/tags-form-view.js +++ b/server/sonar-web/src/main/js/components/issue/views/tags-form-view.js @@ -133,19 +133,19 @@ define([ onInputKeydown: function (e) { this.query = this.$('input').val(); if (e.keyCode === 38) { - return this.selectPreviousOption(); + this.selectPreviousOption(); } if (e.keyCode === 40) { - return this.selectNextOption(); + this.selectNextOption(); } if (e.keyCode === 13) { - return this.selectActiveOption(); - } - if (e.keyCode === 9) { - return false; + this.selectActiveOption(); } if (e.keyCode === 27) { - return this.close(); + this.close(); + } + if ([9, 13, 27, 38, 40].indexOf(e.keyCode) !== -1) { + return false; } }, diff --git a/server/sonar-web/src/main/js/libs/widgets/treemap.js b/server/sonar-web/src/main/js/libs/widgets/treemap.js index f9cc1992833..5c38af4db18 100644 --- a/server/sonar-web/src/main/js/libs/widgets/treemap.js +++ b/server/sonar-web/src/main/js/libs/widgets/treemap.js @@ -297,8 +297,8 @@ }).done(function (r) { var components = that.formatComponents(r); if (components != null) { - components = _.sortBy(components, function (d) { - return -that.sizeMetric.value(d); + components = _.sortBy(components, function (component) { + return -that.sizeMetric.value(component); }); components = _.initial(components, components.length - that.options().maxItems - 1); that.updateTreemap(components, components.length > that.options().maxItems); -- 2.39.5