From 7289e004f966f833c9ee199a35e90e0af94296ac Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Fri, 1 Jun 2012 17:28:59 +0200 Subject: [PATCH] SONAR-3537 Improve performances of the treemap filter --- .../org/sonar/plugins/core/widgets/filter.html.erb | 2 +- .../webapp/WEB-INF/app/controllers/dashboard_controller.rb | 6 +++--- .../src/main/webapp/WEB-INF/app/models/filter_context.rb | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/filter.html.erb b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/filter.html.erb index dae497a9a17..76bc1efe49b 100644 --- a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/filter.html.erb +++ b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/filter.html.erb @@ -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} %> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/dashboard_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/dashboard_controller.rb index e1e9fffd571..5729a5283ee 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/dashboard_controller.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/dashboard_controller.rb @@ -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 diff --git a/sonar-server/src/main/webapp/WEB-INF/app/models/filter_context.rb b/sonar-server/src/main/webapp/WEB-INF/app/models/filter_context.rb index bc7b8524922..060e743aae4 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/models/filter_context.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/models/filter_context.rb @@ -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] -- 2.39.5