]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-3537 Improve performances of the treemap filter
authorSimon Brandhof <simon.brandhof@gmail.com>
Fri, 1 Jun 2012 15:28:59 +0000 (17:28 +0200)
committerSimon Brandhof <simon.brandhof@gmail.com>
Fri, 1 Jun 2012 15:31:44 +0000 (17:31 +0200)
plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/filter.html.erb
sonar-server/src/main/webapp/WEB-INF/app/controllers/dashboard_controller.rb
sonar-server/src/main/webapp/WEB-INF/app/models/filter_context.rb

index dae497a9a17768c96cf5be8d070057a159fd0e5f..76bc1efe49b9114ab4586ea0f65ffb30d72feee3 100644 (file)
@@ -1,6 +1,6 @@
 <%
    @filter=::Filter.find(:first, :conditions => {:kee => widget_properties['filter']})
-   @filter_context=Filters.execute(@filter, self, params)
+   @filter_context=Filters.execute(@filter, self, params) unless @filter.ajax_loading?
 %>
 
 <%= render :partial => "filters/#{@filter.default_view}", :locals => {:edit_mode => false, :widget => widget} %>
index e1e9fffd5719a55c648302ffb5de8ec748405405..5729a5283ee33d714f7db55630ea8329c2e8ebce 100644 (file)
@@ -44,7 +44,7 @@ class DashboardController < ApplicationController
     load_resource()
     load_dashboard()
     @category=params[:category]
-    load_widget_definitions(@dashboard, @category)
+    load_widget_definitions(@category)
     unless @dashboard
       redirect_to home_path
     end
@@ -136,7 +136,7 @@ class DashboardController < ApplicationController
     @category=params[:category]
     load_resource()
     load_dashboard()
-    load_widget_definitions(@dashboard, @category)
+    load_widget_definitions(@category)
     render :partial => 'widget_definitions', :locals => {:category => @category}
   end
 
@@ -185,7 +185,7 @@ class DashboardController < ApplicationController
     end
   end
 
-  def load_widget_definitions(dashboard, filter_on_category=nil)
+  def load_widget_definitions(filter_on_category)
     @widget_definitions=java_facade.getWidgets()
 
     @widget_categories=@widget_definitions.map(&:getWidgetCategories).flatten.uniq.sort
index bc7b85249220375ed2b1e54e3568932a6d04cf50..060e743aae4fe7a3395b99f160fbf812d6f448be 100644 (file)
@@ -55,7 +55,7 @@
         # load measures
         #
         if @metric_ids.size>0
-          measures=ProjectMeasure.find(:all, :conditions => ['rule_priority is null and rule_id is null and characteristic_id is null and person_id is null and snapshot_id in (?)', @page_sids])
+          measures=ProjectMeasure.find(:all, :conditions => ['rule_priority is null and rule_id is null and characteristic_id is null and person_id is null and snapshot_id in (?) and metric_id in (?)', @page_sids, @metric_ids])
 
           measures.each do |m|
             snapshot=@snapshots_by_id[m.snapshot_id]