]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-5390 Reintroduce link per severity in profile rules page
authorJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>
Tue, 8 Jul 2014 14:03:31 +0000 (16:03 +0200)
committerJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>
Tue, 8 Jul 2014 14:03:31 +0000 (16:03 +0200)
sonar-server/src/main/coffee/coding-rules/views/filters/profile-dependent-filter-view.coffee
sonar-server/src/main/webapp/WEB-INF/app/views/profiles/show.html.erb

index a86c58cacdc4e1b30dec615440254350a2a67599..5afad402b922433a8eab5a52f29c7c99b3b88b36 100644 (file)
@@ -47,6 +47,11 @@ define [
       value = value.split(',') if _.isString(value)
       if @choices && value.length > 0
         @model.set value: value, enabled: true
+        @choices.each (item) ->
+          item.set 'checked', false
+        _.each value, (v) =>
+          cModel = @choices.findWhere id: v
+          cModel.set 'checked', true
         @onChangeQualityProfile()
       else
         @clear()
index 3eec1835ea5a46d687a5b34d54ed8da3cdbfc67c..397b662228ba44528e66f977e790f2bbfc534b65 100644 (file)
       %>
       <div class="widget-span widget-span-3">
         <div class="widget-measure-container">
-          <div class="widget-measure widget-measure-main">
-            <table class="data" style="width:120px">
-              <% Severity::KEYS.each do |key|
-                stat = severity_map[key]
-                severity = key.downcase
-                value = 0
-                value = stat.getValue() if stat
-              -%>
-                <tr>
-                  <td>
-                    <i class="icon-severity-<%= severity %>"></i><%= message(severity) -%>
-                  </td>
-                  <td class="thin right">
-                    <%= value -%>
-                  </td>
-                  <td class="nowrap ">
-                    <% if max > 0 %>
-                      <%= barchart(:width => 70, :percent => (100 * value / max).to_i) %>
-                    <% end %>
-                  </td>
-                </tr>
-              <% end -%>
-            </table>
-          </div>
+          <table class="data" style="width: 240px">
+            <tbody>
+            <% Severity::KEYS.each do |key|
+              stat = severity_map[key]
+              severity = key.downcase
+              value = 0
+              value = stat.getValue() if stat
+            -%>
+              <tr>
+                <td>
+                  <i class="icon-severity-<%= severity %>"></i> <%= message(severity) -%>
+                </td>
+                <td class="thin right">
+                  <a href="<%= "#{ApplicationController.root_context}/coding_rules#qprofile=#{@profile.key()}|activation=true|languages=#{@profile.language()}|active_severities=#{severity.upcase}" -%>"
+                    class="widget-link">
+                    <span><%= value -%></span>
+                  </a>
+                </td>
+                <td class="nowrap ">
+                  <% if max > 0 %>
+                    <%= barchart(:width => 70, :percent => (100 * value / max).to_i) %>
+                  <% end %>
+                </td>
+              </tr>
+            <% end -%>
+            </tbody>
+          </table>
         </div>
       </div>
     <% end -%>