]> source.dussan.org Git - sonarqube.git/commitdiff
apply rules feedback
authorStas Vilchik <vilchiks@gmail.com>
Wed, 25 Mar 2015 08:40:26 +0000 (09:40 +0100)
committerStas Vilchik <vilchiks@gmail.com>
Wed, 25 Mar 2015 08:40:26 +0000 (09:40 +0100)
server/sonar-web/src/main/hbs/coding-rules/coding-rules-rule-details.hbs
server/sonar-web/src/main/js/coding-rules/rule-details-view.js
server/sonar-web/src/main/js/nav/global-navbar-view.js

index c4eca54f63dd8f9d7c54d68bbed6834c8049d484..f889780e6c6d2d0058d7b57e824b868d981cbab9 100644 (file)
@@ -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}}
index 433acd69bf5ff33e401dcf9389a9359514c39d1e..2f608db03a3443e78723289a088e5ca8e4af85d4 100644 (file)
@@ -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'),
index 6103084b73cf3b2c69b85ca6c5a49fb3fb798408..64b199752a105c1afbfcf2caa0368d15ccc784e9 100644 (file)
@@ -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
       });
     }
   });