]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-5007 Rework quality profiles part
authorStas Vilchik <vilchiks@gmail.com>
Tue, 11 Mar 2014 07:33:44 +0000 (13:33 +0600)
committerStas Vilchik <vilchiks@gmail.com>
Tue, 11 Mar 2014 07:33:57 +0000 (13:33 +0600)
23 files changed:
sonar-server/src/main/webapp/WEB-INF/app/views/coding_rules/index.html.erb
sonar-server/src/main/webapp/WEB-INF/app/views/coding_rules/templates/_coding_rules_detail_template.hbs.erb
sonar-server/src/main/webapp/WEB-INF/app/views/coding_rules/templates/_coding_rules_header_quality_profiles_template.hbs.erb [deleted file]
sonar-server/src/main/webapp/WEB-INF/app/views/coding_rules/templates/_coding_rules_header_template.hbs.erb
sonar-server/src/main/webapp/WEB-INF/app/views/coding_rules/templates/_coding_rules_list_item_template.hbs.erb
sonar-server/src/main/webapp/javascripts/coding-rules/app.coffee
sonar-server/src/main/webapp/javascripts/coding-rules/app.js
sonar-server/src/main/webapp/javascripts/coding-rules/mockjax.coffee
sonar-server/src/main/webapp/javascripts/coding-rules/mockjax.js
sonar-server/src/main/webapp/javascripts/coding-rules/views/coding-rules-detail-view.coffee
sonar-server/src/main/webapp/javascripts/coding-rules/views/coding-rules-detail-view.js
sonar-server/src/main/webapp/javascripts/coding-rules/views/coding-rules-list-item-view.coffee
sonar-server/src/main/webapp/javascripts/coding-rules/views/coding-rules-list-item-view.js
sonar-server/src/main/webapp/javascripts/coding-rules/views/header-quality-profiles-view.coffee [deleted file]
sonar-server/src/main/webapp/javascripts/coding-rules/views/header-quality-profiles-view.js [deleted file]
sonar-server/src/main/webapp/javascripts/coding-rules/views/header-view.coffee
sonar-server/src/main/webapp/javascripts/coding-rules/views/header-view.js
sonar-server/src/main/webapp/stylesheets/coding-rules.css
sonar-server/src/main/webapp/stylesheets/coding-rules.less
sonar-server/src/main/webapp/stylesheets/navigator.css
sonar-server/src/main/webapp/stylesheets/navigator/base.css
sonar-server/src/main/webapp/stylesheets/navigator/base.less
sonar-server/src/main/webapp/stylesheets/navigator/config.less

index 9f1751d81dab21d61f0c1208910f3ab3518bdfce..8c33c7b7a9652d50d4eb0c0e947758cdf5e3fc92 100644 (file)
@@ -11,7 +11,6 @@
 <%= render :partial => '/navigator/filter_templates' -%>
 <%= render :partial => '/coding_rules/templates/coding_rules_layout.hbs' -%>
 <%= render :partial => '/coding_rules/templates/coding_rules_header_template.hbs' -%>
-<%= render :partial => '/coding_rules/templates/coding_rules_header_quality_profiles_template.hbs' -%>
 <%= render :partial => '/coding_rules/templates/coding_rules_actions_template.hbs' -%>
 <%= render :partial => '/coding_rules/templates/coding_rules_filter_bar_template.hbs' -%>
 <%= render :partial => '/coding_rules/templates/coding_rules_list_item_template.hbs' -%>
index 18aad2a85ca2206eca79d35199e3af54fd0469d8..a392dacf13d88411020f1d9efe87955de24e7517 100644 (file)
@@ -3,17 +3,19 @@
   <div class="coding-rules-detail-language">{{language}}</div>
   <div class="coding-rules-detail-description rule-desc">{{{description}}}</div>
 
-  <h3 class="coding-rules-detail-header coding-rules-detail-quality-profiles-header">{{t 'coding_rules.quality_profiles'}}</h3>
+  <h3 class="coding-rules-detail-header coding-rules-detail-quality-profiles-header">
+    {{t 'coding_rules.quality_profiles'}}
+
+    <div class="button-group coding-rules-detail-quality-profiles-activation">
+      <button>{{t 'coding_rules.activate_quality_profile'}}</button>
+    </div>
+  </h3>
+
   <ul class="coding-rules-detail-quality-profiles">
     {{#each qualityProfiles}}
       <li class="coding-rules-detail-quality-profile">
-        <div class="coding-rules-detail-quality-profile-severity">{{severityIcon severity}}</div>
         <div class="coding-rules-detail-quality-profile-name">{{name}}</div>
-        {{#if canDeactivate}}
-          <div class="button-group coding-rules-detail-quality-profile-actions">
-            <button class="button-red">{{t 'coding_rules.deactivate_quality_profile'}}</button>
-          </div>
-        {{/if}}
+        <div class="coding-rules-detail-quality-profile-severity">{{severityIcon severity}}{{t 'severity' severity}}</div>
         <ul class="coding-rules-detail-quality-profile-parameters">
           {{#each parameters}}
             <li class="coding-rules-detail-quality-profile-parameter">
             </li>
           {{/each}}
         </ul>
+        {{#if canDeactivate}}
+          <div class="button-group coding-rules-detail-quality-profile-actions">
+            <button class="button-red">{{t 'coding_rules.deactivate_quality_profile'}}</button>
+          </div>
+        {{/if}}
       </li>
     {{/each}}
   </ul>
-  <div class="button-group coding-rules-detail-quality-profiles-activation">
-    <button>{{t 'coding_rules.activate_quality_profile'}}</button>
-  </div>
 </script>
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/coding_rules/templates/_coding_rules_header_quality_profiles_template.hbs.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/coding_rules/templates/_coding_rules_header_quality_profiles_template.hbs.erb
deleted file mode 100644 (file)
index 5f49de9..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-<script id="coding-rules-header-quality-profiles-template" type="text/x-handlebars-template">
-  <ul class="navigator-filter-select-list">
-    <li>
-      <label title="{{t 'coding_rules.page'}}">
-          <span>{{t 'coding_rules.page'}}</span>
-      </label>
-    </li>
-    {{#each items}}
-      <li>
-        <label title="{{name}}">
-          <span>{{name}} <span class="subtitle">{{lang}}</span>
-        </span>
-        </label>
-      </li>
-    {{/each}}
-  </ul>
-</script>
index a628448a514fedda05ca3859871a2257023ff0a3..e28cd81473556250e3d9af64d4d6caedc7f41755 100644 (file)
@@ -1,13 +1,7 @@
 <script id="coding-rules-header-template" type="text/x-handlebars-template">
-  <div class="navigator-header-menu-toggle">
-    <i class="icon-list"></i>
-  </div>
-
-  <h1 class="navigator-header-title">
-    {{#if header}}{{{header}}}{{else}}{{t 'coding_rules.page'}}{{/if}}
-  </h1>
+  <h1 class="navigator-header-title">{{t 'coding_rules.page'}}</h1>
 
   <div class="navigator-header-actions button-group">
-    <button id="issues-new-search">{{t 'coding_rules.new_search'}}</button>
+    <button id="coding-rules-new-search">{{t 'coding_rules.new_search'}}</button>
   </div>
 </script>
index 82f12144bbeaceb97ae069489d3486149e92756a..cdd992740beea3c4f02ee802b96581ac1cbedb52 100644 (file)
@@ -1,4 +1,7 @@
 <script id="coding-rules-list-item-template" type="text/x-handlebars-template">
   <div class="line line-nowrap" title="{{name}}">{{name}}</div>
-  <div class="line line-small">{{language}}</div>
+  <div class="line line-small">
+    {{#if qualityProfile}}{{severityIcon severity}}{{t "severity" severity}} |{{/if}}
+    {{language}}
+  </div>
 </script>
index ac7ee48060f7cb3158df176d78efc77b31ac523a..b8c776fa08b6b100ff0af6566d9989d8d332cdbf 100644 (file)
@@ -143,6 +143,11 @@ requirejs [
       App.fetchList false
 
 
+  App.getActiveQualityProfile = ->
+    value = @activeInFilter.get('value')
+    if value? && value.length == 1 then value[0] else null
+
+
   # Construct layout
   App.addInitializer ->
     @layout = new CodingRulesLayout app: @
@@ -246,19 +251,23 @@ requirejs [
         'unused': 'unused'
         'unused-code': 'unused-code'
 
-    @filters.add new BaseFilters.Filter
+    @activeInFilter = new BaseFilters.Filter
       name: t 'coding_rules.filters.active_in'
       property: 'active_in'
       type: QualityProfileFilterView
-      enabled: false,
-      optional: true
+      single: true
+      enabled: true
+      optional: false
+    @filters.add @activeInFilter
 
-    @filters.add new BaseFilters.Filter
+    @inactiveInFilter = new BaseFilters.Filter
       name: t 'coding_rules.filters.inactive_in'
       property: 'inactive_in'
       type: QualityProfileFilterView
-      enabled: false,
-      optional: true
+      single: true
+      enabled: true
+      optional: false
+    @filters.add @inactiveInFilter
 
     @filterBarView = new CodingRulesFilterBarView
       app: @
index 886acdb867a09d1ca7554ffc188641ee1a36e88c..129cdaa5dabeda26b49089e28788b29117a7039d 100644 (file)
         return App.fetchList(false);
       }
     };
+    App.getActiveQualityProfile = function() {
+      var value;
+      value = this.activeInFilter.get('value');
+      if ((value != null) && value.length === 1) {
+        return value[0];
+      } else {
+        return null;
+      }
+    };
     App.addInitializer(function() {
       this.layout = new CodingRulesLayout({
         app: this
           'unused-code': 'unused-code'
         }
       }));
-      this.filters.add(new BaseFilters.Filter({
+      this.activeInFilter = new BaseFilters.Filter({
         name: t('coding_rules.filters.active_in'),
         property: 'active_in',
         type: QualityProfileFilterView,
-        enabled: false,
-        optional: true
-      }));
-      this.filters.add(new BaseFilters.Filter({
+        single: true,
+        enabled: true,
+        optional: false
+      });
+      this.filters.add(this.activeInFilter);
+      this.inactiveInFilter = new BaseFilters.Filter({
         name: t('coding_rules.filters.inactive_in'),
         property: 'inactive_in',
         type: QualityProfileFilterView,
-        enabled: false,
-        optional: true
-      }));
+        single: true,
+        enabled: true,
+        optional: false
+      });
+      this.filters.add(this.inactiveInFilter);
       this.filterBarView = new CodingRulesFilterBarView({
         app: this,
         collection: this.filters,
index 587605045f5a2cb0f0a5fbac66293ea42f6f0501..80b4092174aaae2b60decf431f422775a4783512 100644 (file)
@@ -50,22 +50,27 @@ define ['jquery.mockjax'], ->
         {
           name: 'Array designators "[]" should be located after the type in method signatures'
           language: 'Java'
+          severity: 'MAJOR'
         },
         {
           name: 'Avoid Array Loops'
           language: 'Java'
+          severity: 'CRITICAL'
         },
         {
           name: 'Bad practice - Abstract class defines covariant compareTo() method'
           language: 'Java'
+          severity: 'MAJOR'
         },
         {
           name: 'Correctness - Use of class without a hashCode() method in a hashed data structure'
           language: 'Java'
+          severity: 'MINOR'
         },
         {
           name: 'Useless Operation On Immutable'
           language: 'Java'
+          severity: 'MAJOR'
         }
       ]
       paging:
@@ -92,8 +97,9 @@ define ['jquery.mockjax'], ->
             </p>
 
             <pre>For compatibility with older versions of the Java SE platform,
-            the declaration of a method that returns an array is allowed to place (some or all of) the empty bracket pairs that form the declaration of the array type after the formal parameter list.
-            This obsolescent syntax should not be used in new code.
+            the declaration of a method that returns an array is allowed to place (some or all of)
+            the empty bracket pairs that form the declaration of the array type after
+            the formal parameter list. This obsolescent syntax should not be used in new code.
             </pre>
 
             <p>The following code snippet illustrates this rule:</p>
@@ -111,8 +117,8 @@ define ['jquery.mockjax'], ->
           {
             name: 'SonarWay'
             severity: 'MINOR'
-            canDeactivate: false
-            canUpdate: false
+            canDeactivate: true
+            canUpdate: true
             parameters: [
               { key: 'max', value: 8 }
             ]
@@ -121,8 +127,8 @@ define ['jquery.mockjax'], ->
           {
             name: 'Quality Profile 1'
             severity: 'MAJOR'
-            canDeactivate: true
-            canUpdate: true
+            canDeactivate: false
+            canUpdate: false
             parameters: [
               { key: 'max', value: 6 }
             ]
index 27408d8285b7787103ea90ac8e381ea81de2765c..e8a5a7d976067f99973b5d40b4c1545b8e41f065 100644 (file)
         codingrules: [
           {
             name: 'Array designators "[]" should be located after the type in method signatures',
-            language: 'Java'
+            language: 'Java',
+            severity: 'MAJOR'
           }, {
             name: 'Avoid Array Loops',
-            language: 'Java'
+            language: 'Java',
+            severity: 'CRITICAL'
           }, {
             name: 'Bad practice - Abstract class defines covariant compareTo() method',
-            language: 'Java'
+            language: 'Java',
+            severity: 'MAJOR'
           }, {
             name: 'Correctness - Use of class without a hashCode() method in a hashed data structure',
-            language: 'Java'
+            language: 'Java',
+            severity: 'MINOR'
           }, {
             name: 'Useless Operation On Immutable',
-            language: 'Java'
+            language: 'Java',
+            severity: 'MAJOR'
           }
         ],
         paging: {
         codingrule: {
           name: 'Array designators "[]" should be located after the type in method signatures',
           language: 'Java',
-          description: '<p>\nAccording to the Java Language Specification:\n</p>\n\n<pre>For compatibility with older versions of the Java SE platform,\nthe declaration of a method that returns an array is allowed to place (some or all of) the empty bracket pairs that form the declaration of the array type after the formal parameter list.\nThis obsolescent syntax should not be used in new code.\n</pre>\n\n<p>The following code snippet illustrates this rule:</p>\n\n<pre>public int getVector()[] { /* ... */ }    // Non-Compliant\n\npublic int[] getVector() { /* ... */ }    // Compliant\n\npublic int[] getMatrix()[] { /* ... */ }  // Non-Compliant\n\npublic int[][] getMatrix() { /* ... */ }  // Compliant\n</pre>',
+          description: '<p>\nAccording to the Java Language Specification:\n</p>\n\n<pre>For compatibility with older versions of the Java SE platform,\nthe declaration of a method that returns an array is allowed to place (some or all of)\nthe empty bracket pairs that form the declaration of the array type after\nthe formal parameter list. This obsolescent syntax should not be used in new code.\n</pre>\n\n<p>The following code snippet illustrates this rule:</p>\n\n<pre>public int getVector()[] { /* ... */ }    // Non-Compliant\n\npublic int[] getVector() { /* ... */ }    // Compliant\n\npublic int[] getMatrix()[] { /* ... */ }  // Non-Compliant\n\npublic int[][] getMatrix() { /* ... */ }  // Compliant\n</pre>',
           qualityProfiles: [
             {
               name: 'SonarWay',
               severity: 'MINOR',
-              canDeactivate: false,
-              canUpdate: false,
+              canDeactivate: true,
+              canUpdate: true,
               parameters: [
                 {
                   key: 'max',
             }, {
               name: 'Quality Profile 1',
               severity: 'MAJOR',
-              canDeactivate: true,
-              canUpdate: true,
+              canDeactivate: false,
+              canUpdate: false,
               parameters: [
                 {
                   key: 'max',
index 0f5c741241ec3f989a1a18b154514f7aecf1cfdf..9ff525e9a623282ecfe3c78be080c96f6e4198a5 100644 (file)
@@ -7,3 +7,8 @@ define [
 
   class CodingRulesDetailView extends Marionette.ItemView
     template: getTemplate '#coding-rules-detail-template'
+
+
+    onRender: ->
+      qp = @options.app.getActiveQualityProfile()
+      @$('.coding-rules-detail-quality-profile').first().addClass 'active' if qp?
index 06fd6527ad6efad7eec07854946c72bed16fb828..ae0db796904a59c2b5c163945db01e5dee284ebd 100644 (file)
 
       CodingRulesDetailView.prototype.template = getTemplate('#coding-rules-detail-template');
 
+      CodingRulesDetailView.prototype.onRender = function() {
+        var qp;
+        qp = this.options.app.getActiveQualityProfile();
+        if (qp != null) {
+          return this.$('.coding-rules-detail-quality-profile').first().addClass('active');
+        }
+      };
+
       return CodingRulesDetailView;
 
     })(Marionette.ItemView);
index 4d109e4fe07119978c821afbb2c01b95bf243f71..456c61e35b5ba105bbe1c6d97e208cda8982d351 100644 (file)
@@ -26,5 +26,11 @@ define [
         url: "#{baseUrl}/api/codingrules/show"
       .done (r) =>
         @model.set r.codingrule
-        detailView = new CodingRulesDetailView model: @model
+        detailView = new CodingRulesDetailView
+          app: @options.app
+          model: @model
         @options.app.layout.detailsRegion.show detailView
+
+
+    serializeData: ->
+      _.extend super, qualityProfile: @options.app.getActiveQualityProfile()
index 87ba12db6f5404ebd58a64d8da857cbdd8164c92..7cb2d9709bc7b0967c70fae863b265ee728f1857 100644 (file)
           var detailView;
           _this.model.set(r.codingrule);
           detailView = new CodingRulesDetailView({
+            app: _this.options.app,
             model: _this.model
           });
           return _this.options.app.layout.detailsRegion.show(detailView);
         });
       };
 
+      CodingRulesListItemView.prototype.serializeData = function() {
+        return _.extend(CodingRulesListItemView.__super__.serializeData.apply(this, arguments), {
+          qualityProfile: this.options.app.getActiveQualityProfile()
+        });
+      };
+
       return CodingRulesListItemView;
 
     })(Marionette.ItemView);
diff --git a/sonar-server/src/main/webapp/javascripts/coding-rules/views/header-quality-profiles-view.coffee b/sonar-server/src/main/webapp/javascripts/coding-rules/views/header-quality-profiles-view.coffee
deleted file mode 100644 (file)
index c6053aa..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-define [
-  'backbone.marionette',
-  'common/handlebars-extensions'
-], (
-  Marionette
-) ->
-
-  class HeaderQualityProfilesView extends Marionette.ItemView
-    className: 'coding-rules-header-quality-profiles'
-    template: getTemplate '#coding-rules-header-quality-profiles-template'
-
-
-    events:
-      'click label': 'selectQualityProfile'
-
-
-    selectQualityProfile: (e)->
-      @options.app.header = jQuery(e.target).html()
-      @options.headerView.render()
diff --git a/sonar-server/src/main/webapp/javascripts/coding-rules/views/header-quality-profiles-view.js b/sonar-server/src/main/webapp/javascripts/coding-rules/views/header-quality-profiles-view.js
deleted file mode 100644 (file)
index 67e4641..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-// Generated by CoffeeScript 1.6.3
-(function() {
-  var __hasProp = {}.hasOwnProperty,
-    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
-
-  define(['backbone.marionette', 'common/handlebars-extensions'], function(Marionette) {
-    var HeaderQualityProfilesView, _ref;
-    return HeaderQualityProfilesView = (function(_super) {
-      __extends(HeaderQualityProfilesView, _super);
-
-      function HeaderQualityProfilesView() {
-        _ref = HeaderQualityProfilesView.__super__.constructor.apply(this, arguments);
-        return _ref;
-      }
-
-      HeaderQualityProfilesView.prototype.className = 'coding-rules-header-quality-profiles';
-
-      HeaderQualityProfilesView.prototype.template = getTemplate('#coding-rules-header-quality-profiles-template');
-
-      HeaderQualityProfilesView.prototype.events = {
-        'click label': 'selectQualityProfile'
-      };
-
-      HeaderQualityProfilesView.prototype.selectQualityProfile = function(e) {
-        this.options.app.header = jQuery(e.target).html();
-        return this.options.headerView.render();
-      };
-
-      return HeaderQualityProfilesView;
-
-    })(Marionette.ItemView);
-  });
-
-}).call(this);
index c648f7a30194a9eb76bf17bf6c6f18dd6669c5af..ddf75bc5f53a8d72831ec68f090e0431ab0342ac 100644 (file)
@@ -1,49 +1,17 @@
 define [
   'backbone.marionette',
-  'coding-rules/views/header-quality-profiles-view',
   'common/handlebars-extensions'
 ], (
-  Marionette,
-  HeaderQualityProfilesView
+  Marionette
 ) ->
 
   class CodingRulesHeaderView extends Marionette.ItemView
     template: getTemplate '#coding-rules-header-template'
 
 
-    ui:
-      menuToggle: '.navigator-header-menu-toggle'
-
-
     events:
-      'click @ui.menuToggle': 'toggleQualityProfiles'
-
-
-    initialize: ->
-      @qualityProfilesView = new HeaderQualityProfilesView
-        app: @options.app
-        collection: new Backbone.Collection @options.app.qualityProfiles
-        headerView: @
-      jQuery('body').on 'click', =>
-        @qualityProfilesView.$el.hide()
-        @ui.menuToggle.removeClass 'active'
-
-
-    onRender: ->
-      @qualityProfilesView.render().$el.detach().appendTo jQuery('body')
-
-
-    onDomRefresh: ->
-      @qualityProfilesView.$el.css
-        top: @$el.offset().top + @$el.outerHeight()
-        left: @$el.offset().left + @ui.menuToggle.css('margin-left')
-
-
-    toggleQualityProfiles: (e) ->
-      e.stopPropagation()
-      @qualityProfilesView.$el.toggle()
-      @ui.menuToggle.toggleClass 'active'
+      'click #coding-rules-new-search': 'newSearch'
 
 
-    serializeData: ->
-      _.extend super, header: @options.app.header
+    newSearch: ->
+      @options.app.router.navigate '', trigger: true
index 887d06b8c75db6176662e324d064ecf807f09f92..b1d052db9d38e3a3e043535dc146e1a36e69434e 100644 (file)
@@ -3,7 +3,7 @@
   var __hasProp = {}.hasOwnProperty,
     __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
 
-  define(['backbone.marionette', 'coding-rules/views/header-quality-profiles-view', 'common/handlebars-extensions'], function(Marionette, HeaderQualityProfilesView) {
+  define(['backbone.marionette', 'common/handlebars-extensions'], function(Marionette) {
     var CodingRulesHeaderView, _ref;
     return CodingRulesHeaderView = (function(_super) {
       __extends(CodingRulesHeaderView, _super);
 
       CodingRulesHeaderView.prototype.template = getTemplate('#coding-rules-header-template');
 
-      CodingRulesHeaderView.prototype.ui = {
-        menuToggle: '.navigator-header-menu-toggle'
-      };
-
       CodingRulesHeaderView.prototype.events = {
-        'click @ui.menuToggle': 'toggleQualityProfiles'
-      };
-
-      CodingRulesHeaderView.prototype.initialize = function() {
-        var _this = this;
-        this.qualityProfilesView = new HeaderQualityProfilesView({
-          app: this.options.app,
-          collection: new Backbone.Collection(this.options.app.qualityProfiles),
-          headerView: this
-        });
-        return jQuery('body').on('click', function() {
-          _this.qualityProfilesView.$el.hide();
-          return _this.ui.menuToggle.removeClass('active');
-        });
-      };
-
-      CodingRulesHeaderView.prototype.onRender = function() {
-        return this.qualityProfilesView.render().$el.detach().appendTo(jQuery('body'));
-      };
-
-      CodingRulesHeaderView.prototype.onDomRefresh = function() {
-        return this.qualityProfilesView.$el.css({
-          top: this.$el.offset().top + this.$el.outerHeight(),
-          left: this.$el.offset().left + this.ui.menuToggle.css('margin-left')
-        });
-      };
-
-      CodingRulesHeaderView.prototype.toggleQualityProfiles = function(e) {
-        e.stopPropagation();
-        this.qualityProfilesView.$el.toggle();
-        return this.ui.menuToggle.toggleClass('active');
+        'click #coding-rules-new-search': 'newSearch'
       };
 
-      CodingRulesHeaderView.prototype.serializeData = function() {
-        return _.extend(CodingRulesHeaderView.__super__.serializeData.apply(this, arguments), {
-          header: this.options.app.header
+      CodingRulesHeaderView.prototype.newSearch = function() {
+        return this.options.app.router.navigate('', {
+          trigger: true
         });
       };
 
index a4c405b08db2294b226f6b4f1d0b828feea0e894..7f9f781a642206b5a2dfe26854f392ccd4560931 100644 (file)
 }
 .coding-rules-page .navigator-actions,
 .coding-rules-page .navigator-details {
-  top: 324px;
+  top: 194px;
 }
 .coding-rules-page .navigator-results {
-  top: 354px;
+  top: 224px;
 }
 /*
  * Detail
   padding-bottom: 0;
 }
 .coding-rules-detail-quality-profiles-header {
-  margin-top: 20px;
+  margin-top: 30px;
 }
-.coding-rules-detail-quality-profile + .coding-rules-detail-quality-profile {
-  margin-top: 10px;
+.coding-rules-detail-quality-profiles {
+  font-size: 0;
 }
-.coding-rules-detail-quality-profile-severity,
-.coding-rules-detail-quality-profile-name,
-.coding-rules-detail-quality-profile-actions {
+.coding-rules-detail-quality-profile {
   display: inline-block;
-  vertical-align: middle;
+  vertical-align: top;
+  width: 240px;
+  margin-right: 20px;
+  -moz-box-sizing: border-box;
+  box-sizing: border-box;
+  font-size: 13px;
+}
+.coding-rules-detail-quality-profile.active {
+  background-color: #CAE3F2;
+  border-color: #4b9fd5;
+}
+.coding-rules-detail-quality-profile.active .coding-rules-detail-quality-profile-name {
+  background-color: #4b9fd5;
+  color: #fff;
+}
+.coding-rules-detail-quality-profile-severity {
+  padding: 5px;
+  font-size: 11px;
+}
+.coding-rules-detail-quality-profile-name {
+  padding: 5px;
+  background-color: #efefef;
+  line-height: 1;
+  font-weight: bold;
+}
+.coding-rules-detail-quality-profile-actions {
+  padding: 5px;
 }
 .coding-rules-detail-quality-profile-parameters {
-  padding-left: 30px;
+  padding: 5px;
 }
 .coding-rules-detail-quality-profile-parameter {
-  margin: 5px;
+  white-space: nowrap;
 }
 .coding-rules-detail-quality-profile-parameter-key,
 .coding-rules-detail-quality-profile-parameter-value,
 .coding-rules-detail-quality-profile-parameter-key:after {
   content: ":";
 }
+.coding-rules-detail-quality-profile-parameter-value {
+  width: 110px;
+}
+.coding-rules-detail-quality-profile-parameter-actions {
+  float: right;
+}
 .coding-rules-detail-quality-profiles-activation {
-  margin-top: 10px;
-}
-.coding-rules-header-quality-profiles {
-  position: absolute;
-  z-index: 1200;
-  display: none;
-  max-width: 300px;
-  border-right: 1px solid #cdcdcd;
-  border-bottom: 1px solid #cdcdcd;
-  background: #fff;
-  box-shadow: 10px 10px 20px rgba(0, 0, 0, 0.5);
-}
-.coding-rules-header-quality-profiles .navigator-filter-select-list {
-  max-width: 600px;
-}
-.coding-rules-header-quality-profiles .navigator-filter-select-list label > span {
-  width: auto;
+  margin-top: -3px;
+  margin-left: 10px;
 }
index 842bfa069d9e5758b2d9210e2ebe8e1520eb70f4..78ee8871a4d03f61a6ca619d423838262543caa9 100644 (file)
   }
 }
 
+
+// Quality Profiles
 .coding-rules-detail-quality-profiles-header {
-  margin-top: 2 * @navigatorPadding;
+  margin-top: 3 * @navigatorPadding;
 }
 
-.coding-rules-detail-quality-profile + .coding-rules-detail-quality-profile {
-  margin-top: @navigatorPadding;
+.coding-rules-detail-quality-profiles {
+  font-size: 0;
 }
 
-.coding-rules-detail-quality-profile-severity,
-.coding-rules-detail-quality-profile-name,
-.coding-rules-detail-quality-profile-actions {
+.coding-rules-detail-quality-profile {
   display: inline-block;
-  vertical-align: middle;
+  vertical-align: top;
+  width: 240px;
+  margin-right: 2 * @navigatorPadding;
+  .box-sizing(border-box);
+  font-size: @baseFontSize;
+
+  &.active {
+    background-color: #CAE3F2;
+    border-color: @highlighted;
+
+    .coding-rules-detail-quality-profile-name {
+      background-color: @highlighted;
+      color: #fff;
+    }
+  }
+}
+
+.coding-rules-detail-quality-profile-severity {
+  padding: @navigatorPadding / 2;
+  font-size: @smallFontSize;
+}
+
+.coding-rules-detail-quality-profile-name {
+  padding: @navigatorPadding / 2;
+  background-color: @navigatorBarBackground;
+  line-height: 1;
+  font-weight: bold;
+}
+
+.coding-rules-detail-quality-profile-actions {
+  padding: @navigatorPadding / 2;
 }
 
 .coding-rules-detail-quality-profile-parameters {
-  padding-left: 3 * @navigatorPadding;
+  padding: @navigatorPadding / 2;
 }
 
 .coding-rules-detail-quality-profile-parameter {
-  margin: @navigatorPadding / 2;
+  white-space: nowrap;
 }
 
 .coding-rules-detail-quality-profile-parameter-key,
   }
 }
 
-.coding-rules-detail-quality-profiles-activation {
-  margin-top: @navigatorPadding;
+.coding-rules-detail-quality-profile-parameter-value {
+  width: 110px;
 }
 
+.coding-rules-detail-quality-profile-parameter-actions {
+  float: right;
+}
 
-
-.coding-rules-header-quality-profiles {
-  position: absolute;
-  z-index: 1200;
-  display: none;
-  max-width: 300px;
-  border-right: 1px solid @darkGrey;
-  border-bottom: 1px solid @darkGrey;
-  background: #fff;
-  box-shadow: 10px 10px 20px rgba(0, 0, 0, 0.5);
-
-  .navigator-filter-select-list {
-    max-width: 600px;
-  }
-
-  .navigator-filter-select-list label > span {
-    width: auto;
-  }
+.coding-rules-detail-quality-profiles-activation {
+  margin-top: -3px;
+  margin-left: @navigatorPadding;
 }
index b61e2c41b74cc94a7115ded019c19a87c82fc416..3f4111a724a6a908d44fdcbb76578ee8dfe6fb41 100644 (file)
@@ -38,7 +38,7 @@
   top: 104px;
   left: 0;
   width: 100%;
-  height: 220px;
+  height: 90px;
 }
 .navigator-results {
   position: fixed;
   border-bottom: 1px solid #cdcdcd;
   background-color: #efefef;
 }
-.navigator-facets-list {
-  display: table;
-  height: 100%;
-}
-.navigator-facets-list-item {
-  display: table-cell;
-}
 .navigator-facets-list-item {
-  padding-right: 20px;
+  font-size: 0;
 }
 .navigator-facets-list-item + .navigator-facets-list-item {
-  padding-left: 20px;
-  border-left: 1px solid #e1e1e1;
+  margin-top: 10px;
 }
 .navigator-facets-list-item-name {
+  display: inline-block;
+  vertical-align: middle;
+  margin-right: 10px;
+  font-size: 13px;
   font-weight: bold;
   text-transform: uppercase;
 }
 .navigator-facets-list-item-options {
-  margin-top: 6.666666666666667px;
+  display: inline-block;
+  vertical-align: middle;
 }
 .navigator-facets-list-item-option {
-  margin-bottom: -1em;
-  padding: 3.3333333333333335px 0;
+  display: inline-block;
+  vertical-align: middle;
+  margin: 0 10px;
+  font-size: 13px;
   cursor: pointer;
-  text-align: justify;
 }
 .navigator-facets-list-item-option:hover .navigator-facets-list-item-option-name {
   text-decoration: underline;
 }
-.navigator-facets-list-item-option:after {
-  content: '';
-  display: inline-block;
-  width: 100%;
+.navigator-facets-list-item-option-stat:before {
+  content: "(";
 }
-.navigator-facets-list-item-option-name {
-  padding-right: 10px;
+.navigator-facets-list-item-option-stat:after {
+  content: ")";
 }
 .navigator-results {
   border-right: 1px solid #e1e1e1;
index 879cc350eec6f5b3a2ece103f6dc285e4d04d2cf..869c2fcc2895fa3ee8af6e1e7e26f129677b30b5 100644 (file)
@@ -38,7 +38,7 @@
   top: 104px;
   left: 0;
   width: 100%;
-  height: 220px;
+  height: 90px;
 }
 .navigator-results {
   position: fixed;
   border-bottom: 1px solid #cdcdcd;
   background-color: #efefef;
 }
-.navigator-facets-list {
-  display: table;
-  height: 100%;
-}
-.navigator-facets-list-item {
-  display: table-cell;
-}
 .navigator-facets-list-item {
-  padding-right: 20px;
+  font-size: 0;
 }
 .navigator-facets-list-item + .navigator-facets-list-item {
-  padding-left: 20px;
-  border-left: 1px solid #e1e1e1;
+  margin-top: 10px;
 }
 .navigator-facets-list-item-name {
+  display: inline-block;
+  vertical-align: middle;
+  margin-right: 10px;
+  font-size: 13px;
   font-weight: bold;
   text-transform: uppercase;
 }
 .navigator-facets-list-item-options {
-  margin-top: 6.666666666666667px;
+  display: inline-block;
+  vertical-align: middle;
 }
 .navigator-facets-list-item-option {
-  margin-bottom: -1em;
-  padding: 3.3333333333333335px 0;
+  display: inline-block;
+  vertical-align: middle;
+  margin: 0 10px;
+  font-size: 13px;
   cursor: pointer;
-  text-align: justify;
 }
 .navigator-facets-list-item-option:hover .navigator-facets-list-item-option-name {
   text-decoration: underline;
 }
-.navigator-facets-list-item-option:after {
-  content: '';
-  display: inline-block;
-  width: 100%;
+.navigator-facets-list-item-option-stat:before {
+  content: "(";
 }
-.navigator-facets-list-item-option-name {
-  padding-right: 10px;
+.navigator-facets-list-item-option-stat:after {
+  content: ")";
 }
 .navigator-results {
   border-right: 1px solid #e1e1e1;
index f4c7b070d4158afd81017101c3322d82d3f8d0b0..378a576d37b49c6172dd0804749bb9b9205a6450 100644 (file)
 }
 
 .navigator-facets-list {
-  display: table;
-  height: 100%;
-}
 
-.navigator-facets-list-item {
-  display: table-cell;
 }
 
 .navigator-facets-list-item {
-  padding-right: 2 * @navigatorPadding;
+  font-size: 0;
 }
 
 .navigator-facets-list-item + .navigator-facets-list-item {
-  padding-left: 2 * @navigatorPadding;
-  border-left: 1px solid @navigatorBorderLightColor;
+  margin-top: @navigatorPadding;
 }
 
 .navigator-facets-list-item-name {
+  display: inline-block;
+  vertical-align: middle;
+  margin-right: @navigatorPadding;
+  font-size: @baseFontSize;
   font-weight: bold;
   text-transform: uppercase;
 }
 
 .navigator-facets-list-item-options {
-  margin-top: @navigatorPadding / 3 * 2;
+  display: inline-block;
+  vertical-align: middle;
 }
 
 .navigator-facets-list-item-option {
-  margin-bottom: -1em;
-  padding: @navigatorPadding / 3 0;
+  display: inline-block;
+  vertical-align: middle;
+  margin: 0 @navigatorPadding;
+  font-size: @baseFontSize;
   cursor: pointer;
-  text-align: justify;
 
-  &:hover .navigator-facets-list-item-option-name {
-    text-decoration: underline;
-  }
-
-  &:after {
-    content: '';
-    display: inline-block;
-    width: 100%;
+  &:hover {
+    .navigator-facets-list-item-option-name {
+      text-decoration: underline;
+    }
   }
 }
 
 .navigator-facets-list-item-option-name {
-  padding-right: @navigatorPadding;
+
 }
 
 .navigator-facets-list-item-option-stat {
-
+  &:before { content: "("; }
+  &:after { content: ")"; }
 }
 
 
index b8f1e42bbcb890934820abc4a6152dde750bc816..2d920ff7e4cdfbdcbdd2e100aae0731000d8445e 100644 (file)
@@ -6,7 +6,7 @@
 
 @navigatorHeaderHeight: 37px;
 @navigatorFiltersHeight: 37px;
-@navigatorFacetsHeight: 220px;
+@navigatorFacetsHeight: 90px;
 @navigatorStatusHeight: 30px;
 @navigatorNotesHeight: 20px;