]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-5135 Fix UI details about bulk change of rules
authorJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>
Fri, 13 Jun 2014 14:46:07 +0000 (16:46 +0200)
committerJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>
Fri, 13 Jun 2014 14:48:53 +0000 (16:48 +0200)
sonar-server/src/main/coffee/coding-rules/app.coffee
sonar-server/src/main/coffee/coding-rules/views/actions-view.coffee
sonar-server/src/main/coffee/coding-rules/views/coding-rules-detail-quality-profile-view.coffee
sonar-server/src/main/hbs/coding-rules/coding-rules-actions.hbs
sonar-server/src/main/hbs/coding-rules/coding-rules-bulk-change.hbs
sonar-server/src/main/less/style.less

index 7c8aa97cb2ee87e94425ad65c2c5cf31d52741fb..00e027cca13f2847e22ad40e00e67f7ba2334312 100644 (file)
@@ -446,6 +446,8 @@ requirejs [
     App.canWrite = r.canWrite
     App.qualityProfiles = _.sortBy r.qualityprofiles, ['name', 'lang']
     App.languages = _.extend r.languages, none: 'None'
+    _.map App.qualityProfiles, (profile) ->
+      profile.language = App.languages[profile.lang]
     App.repositories = r.repositories
     App.repositories.push
       key: 'manual'
index dba669468b670203711ef7a826f53065952f70fe..b5f13553de5d4405ee023346ab917091bed9d87a 100644 (file)
@@ -57,15 +57,8 @@ define [
       @options.app.codingRulesBulkChangeDropdownView.toggle()
 
 
-    bulkEnabled: ->
-      return false if @collection.isEmpty()
-      resultLanguages = _.uniq(@collection.pluck 'lang')
-      resultLanguages.length == 1
-
-
     serializeData: ->
       _.extend super,
         canWrite: @options.app.canWrite
         paging: @collection.paging
         sorting: @collection.sorting
-        bulkEnabled: @bulkEnabled()
index 651fb072a29e00d666240e91c3d181d4cbf05fb2..b2ab3bfe4479e6a17995b62cf493976b7aefc2be 100644 (file)
@@ -67,7 +67,7 @@ define [
       return null unless @model.get('inherit') && @model.get('inherit') != 'NONE'
       parentKey = @model.get('parent') + ':' + @model.get('lang')
       parent = _.extend {}, _.findWhere(@options.app.qualityProfiles, key: parentKey)
-      parentActiveInfo = @model.collection.findWhere(qProfile: parentKey) or {}
+      parentActiveInfo = @model.collection.findWhere(qProfile: parentKey) or new Backbone.Model()
       _.extend parent, parentActiveInfo.toJSON()
       parent
 
index a170f69a60224772d587fee36face70fb0f67e1a..36c94e0a0304682f5e912da8291fb226a7d1db16 100644 (file)
@@ -14,6 +14,6 @@
 </ul>
 <div class="navigator-actions-total">
   {{t 'coding_rules.found'}}: <strong>{{paging.total}}</strong>
-  {{#if canWrite}}{{#if bulkEnabled}}<a class="navigator-actions-bulk"
-     title="{{t 'bulk_change'}}"><i class="icon-bulk-change"></i></a>{{/if}}{{/if}}
+  {{#if canWrite}}<a class="navigator-actions-bulk"
+     title="{{t 'bulk_change'}}"><i class="icon-bulk-change"></i></a>{{/if}}
 </div>
index 837ca64225cebad7cc453608eeb8e70c8f597050..d5de084eaf1990a3a3906232aad55d4dd745430e 100644 (file)
         {{#eq action 'deactivate'}}{{t 'coding_rules.deactivate_in'}}{{/eq}}
       </label></h3>
       {{#if qualityProfile}}
-        <h3 class="readonly-field">{{qualityProfileName}}</h3>
+        <h3 class="readonly-field">{{qualityProfileName}}{{#notEq action 'change-severity'}} —
+          {{t 'are_you_sure'}}{{/notEq}}</h3>
       {{else}}
         <select id="coding-rules-bulk-change-profile">
           {{#each availableQualityProfiles}}
-            <option value="{{key}}">{{name}}</option>
+            <option value="{{key}}">{{name}} - {{language}}</option>
           {{/each}}
         </select>
       {{/if}}
index 0f5f917c7580fe6224d5afb64da6888e0db37970..33c298fe66222dffea391085b0f3489fb170bb45 100644 (file)
@@ -2498,6 +2498,7 @@ ul.modal-head-metadata li {
 
 .readonly-field {
   padding-top: 5px;
+  margin-left: -5px;
   line-height: 1;
 }