]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-2713 default category is 'General'
authorSimon Brandhof <simon.brandhof@gmail.com>
Thu, 18 Aug 2011 10:03:03 +0000 (12:03 +0200)
committerSimon Brandhof <simon.brandhof@gmail.com>
Thu, 18 Aug 2011 10:03:03 +0000 (12:03 +0200)
sonar-server/src/main/webapp/WEB-INF/app/controllers/settings_controller.rb
sonar-server/src/main/webapp/WEB-INF/app/views/settings/_plugins.html.erb

index a936793ac294c16f3a7799c518bfacde10de8281..487456bd8e9586ffd43ab950526909e73597b905 100644 (file)
@@ -25,7 +25,7 @@ class SettingsController < ApplicationController
 
   def index
     return access_denied unless is_admin?
-    load_properties()
+    load_properties(false)
     @category ||= 'General'
   end
 
@@ -39,7 +39,7 @@ class SettingsController < ApplicationController
       resource_id=nil
     end
 
-    load_properties()
+    load_properties(true)
 
     if @category && @properties_per_category[@category]
       @properties_per_category[@category].each do |property|
@@ -70,11 +70,11 @@ class SettingsController < ApplicationController
 
   private
 
-  def load_properties
+  def load_properties(all=true)
     @category=params[:category]
     @properties_per_category={}
     java_facade.getPluginsMetadata().each do |plugin|
-      java_facade.getPluginProperties(plugin).select { |property| property.global }.each do |property|
+      java_facade.getPluginProperties(plugin).select { |property| all || property.global }.each do |property|
         category = (property.category().present? ? property.category() : plugin.name())
         @properties_per_category[category]||=[]
         @properties_per_category[category]<<property
index b56c661fdf2a1c3715df62d37d61a105ee1742a2..5263a9b9bf3d57bc3ecbc0fbd1049a52738a4edf 100644 (file)
@@ -59,7 +59,7 @@
       </td>
 
       <td class="column">
-        <% if @category
+        <% if @category && @properties_per_category[@category] && !@properties_per_category[@category].empty?
           category_name = message("property.category.#{@category}", :default => @category)
         %>