aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2015-03-25 09:40:26 +0100
committerStas Vilchik <vilchiks@gmail.com>2015-03-25 09:40:26 +0100
commit7fb34dbf5994d9c9b56bad1d2b3721b456632cf1 (patch)
treeda9e84004d958ba8338cf52c47d81d196a117d20
parent9f0fce00cd2815a8047ef170b84c215f7879cc1d (diff)
downloadsonarqube-7fb34dbf5994d9c9b56bad1d2b3721b456632cf1.tar.gz
sonarqube-7fb34dbf5994d9c9b56bad1d2b3721b456632cf1.zip
apply rules feedback
-rw-r--r--server/sonar-web/src/main/hbs/coding-rules/coding-rules-rule-details.hbs2
-rw-r--r--server/sonar-web/src/main/js/coding-rules/rule-details-view.js9
-rw-r--r--server/sonar-web/src/main/js/nav/global-navbar-view.js6
3 files changed, 11 insertions, 6 deletions
diff --git a/server/sonar-web/src/main/hbs/coding-rules/coding-rules-rule-details.hbs b/server/sonar-web/src/main/hbs/coding-rules/coding-rules-rule-details.hbs
index c4eca54f63d..f889780e6c6 100644
--- a/server/sonar-web/src/main/hbs/coding-rules/coding-rules-rule-details.hbs
+++ b/server/sonar-web/src/main/hbs/coding-rules/coding-rules-rule-details.hbs
@@ -10,7 +10,7 @@
{{else}}
<button class="js-edit-custom" id="coding-rules-detail-custom-rule-change">{{t 'edit'}}</button>
{{/if}}
- <button class="js-delete" id="coding-rules-detail-rule-delete" class="button-red">{{t 'delete'}}</button>
+ <button class="button-red js-delete" id="coding-rules-detail-rule-delete" class="button-red">{{t 'delete'}}</button>
</div>
</div>
{{/if}}
diff --git a/server/sonar-web/src/main/js/coding-rules/rule-details-view.js b/server/sonar-web/src/main/js/coding-rules/rule-details-view.js
index 433acd69bf5..2f608db03a3 100644
--- a/server/sonar-web/src/main/js/coding-rules/rule-details-view.js
+++ b/server/sonar-web/src/main/js/coding-rules/rule-details-view.js
@@ -66,6 +66,7 @@ define([
if (this.model.get('isTemplate')) {
this.fetchCustomRules();
}
+ this.listenTo(this.options.app.state, 'change:selectedIndex', this.select);
},
onRender: function () {
@@ -129,12 +130,10 @@ define([
var that = this;
key('up', 'details', function () {
that.options.app.controller.selectPrev();
- that.options.app.controller.showDetailsForSelected();
return false;
});
key('down', 'details', function () {
that.options.app.controller.selectNext();
- that.options.app.controller.showDetailsForSelected();
return false;
});
key('left, backspace', 'details', function () {
@@ -177,6 +176,12 @@ define([
});
},
+ select: function () {
+ var selected = this.options.app.state.get('selectedIndex'),
+ selectedRule = this.options.app.list.at(selected);
+ this.options.app.controller.showDetails(selectedRule);
+ },
+
serializeData: function () {
var isManual = this.model.get('isManual'),
isCustom = this.model.has('templateKey'),
diff --git a/server/sonar-web/src/main/js/nav/global-navbar-view.js b/server/sonar-web/src/main/js/nav/global-navbar-view.js
index 6103084b73c..64b199752a1 100644
--- a/server/sonar-web/src/main/js/nav/global-navbar-view.js
+++ b/server/sonar-web/src/main/js/nav/global-navbar-view.js
@@ -83,9 +83,9 @@ define([
userName: window.SS.userName,
isUserAdmin: window.SS.isUserAdmin,
- canManageGlobalDashboards: window.SS.user != null,
- canManageIssueFilters: window.SS.user != null,
- canManageMeasureFilters: window.SS.user != null
+ canManageGlobalDashboards: !!window.SS.user,
+ canManageIssueFilters: !!window.SS.user,
+ canManageMeasureFilters: !!window.SS.user
});
}
});