From: simonbrandhof Date: Mon, 3 Jan 2011 16:22:18 +0000 (+0000) Subject: variation periods: keep period when clicking on a resource from filters + disable... X-Git-Tag: 2.6~200 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=2f36cd3a805911fc31650bc1e445b8fc0f06cd7f;p=sonarqube.git variation periods: keep period when clicking on a resource from filters + disable treemaps --- diff --git a/sonar-server/src/main/webapp/WEB-INF/app/helpers/application_helper.rb b/sonar-server/src/main/webapp/WEB-INF/app/helpers/application_helper.rb index c5f61b8c6c4..8bcaabd132b 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/helpers/application_helper.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/helpers/application_helper.rb @@ -306,15 +306,17 @@ module ApplicationHelper # # def link_to_resource(resource, name=nil, options={}) + period_index=options[:period] + period_index=nil if period_index && period_index<=0 if resource.display_dashboard? if options[:dashboard] - link_to(name || resource.name, {:overwrite_params => {:controller => 'dashboard', :action => 'index', :id => resource.copy_resource_id || resource.id}}, :title => options[:title]) + link_to(name || resource.name, {:overwrite_params => {:controller => 'dashboard', :action => 'index', :id => (resource.copy_resource_id||resource.id), :period => period_index}}, :title => options[:title]) else # stay on the same page (for example components) - link_to(name || resource.name, {:overwrite_params => {:id => resource.copy_resource_id || resource.id}}, :title => options[:title]) + link_to(name || resource.name, {:overwrite_params => {:id => (resource.copy_resource_id||resource.id), :period => period_index}}, :title => options[:title]) end else - link_to(name || resource.name, {:controller => 'resource', :action => 'index', :id => resource.id}, :popup => ['resource', 'height=800,width=900,scrollbars=1,resizable=1'], :title => options[:title]) + link_to(name || resource.name, {:controller => 'resource', :action => 'index', :id => resource.id, :period => period_index}, :popup => ['resource', 'height=800,width=900,scrollbars=1,resizable=1'], :title => options[:title]) end end diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/filters/_list.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/filters/_list.html.erb index ece04cd569b..0534200ef9b 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/filters/_list.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/filters/_list.html.erb @@ -1,5 +1,6 @@ <% filter=@filter_context.filter %>
+<% unless edit_mode %>
@@ -12,7 +13,7 @@
- +<% end %> @@ -109,7 +110,7 @@ <% end %> <% end %> <% elsif column.on_name? %> - <%= qualifier_icon(snapshot) %> <%= link_to_resource(snapshot.project, snapshot.project.name(true), {:dashboard => true, :title => snapshot.project.key}) %> + <%= qualifier_icon(snapshot) %> <%= link_to_resource(snapshot.project, snapshot.project.name(true), {:dashboard => true, :title => snapshot.project.key, :period => @filter_context.period_index}) %> <% elsif column.on_version? %><%= h snapshot.version %> <% elsif column.on_language? %><%= snapshot.project.language %> <% elsif column.on_date? %><%= human_short_date(snapshot.created_at) %> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/filters/_treemap.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/filters/_treemap.html.erb index 846634e6fa3..6feef866da6 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/filters/_treemap.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/filters/_treemap.html.erb @@ -1,21 +1,26 @@ -<% -metrics=treemap_metrics(@filter) -size_metric=metrics[0] -color_metric=metrics[1] -%> -
- <%= image_tag 'loading.gif' %> -
-
- \ No newline at end of file +<% if @filter.period? %> +Treemap does not support yet the selection of a period. + +<% else %> + <% + metrics=treemap_metrics(@filter) + size_metric=metrics[0] + color_metric=metrics[1] + %> +
+ <%= image_tag 'loading.gif' %> +
+
+ +<% end %> \ No newline at end of file diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/filters/new.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/filters/new.html.erb index 88b99c28c9e..b8fabbfd88d 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/filters/new.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/filters/new.html.erb @@ -76,19 +76,19 @@ table#columns td { - + - + <% unless @filter.advanced_search? %>
Criteria: -        <%= render :partial => 'filters/criterion', :locals => {:id => '0', :criterion => (@filter.measure_criteria.size>0 ? @filter.measure_criteria[0] : nil)} %> + <%= render :partial => 'filters/criterion', :locals => {:id => '0', :criterion => (@filter.measure_criteria.size>0 ? @filter.measure_criteria[0] : nil)} %>
and: - and <%= render :partial => 'filters/criterion', :locals => {:id => '1', :criterion => (@filter.measure_criteria.size>1 ? @filter.measure_criteria[1] : nil) } %> + <%= render :partial => 'filters/criterion', :locals => {:id => '1', :criterion => (@filter.measure_criteria.size>1 ? @filter.measure_criteria[1] : nil) } %>
and: - and <%= render :partial => 'filters/criterion', :locals => {:id => '2', :criterion => (@filter.measure_criteria.size>2 ? @filter.measure_criteria[2] : nil) } %> + <%= render :partial => 'filters/criterion', :locals => {:id => '2', :criterion => (@filter.measure_criteria.size>2 ? @filter.measure_criteria[2] : nil) } %>