diff options
author | simonbrandhof <simon.brandhof@gmail.com> | 2011-12-07 21:33:01 +0100 |
---|---|---|
committer | simonbrandhof <simon.brandhof@gmail.com> | 2011-12-07 21:33:01 +0100 |
commit | 14a1f07edeab1f1fca1785679c9f2d15bc24c76e (patch) | |
tree | 576ed4491d8a9677e91f2a11e1c85db08dc3c6b8 | |
parent | b214f4a59a659dd728db2743b135b6d6e9070e61 (diff) | |
download | sonarqube-14a1f07edeab1f1fca1785679c9f2d15bc24c76e.tar.gz sonarqube-14a1f07edeab1f1fca1785679c9f2d15bc24c76e.zip |
SONAR-3046 the link 'More' must contain the selected period and severity
2 files changed, 6 insertions, 4 deletions
diff --git a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/hotspots/hotspot_most_violated_rules.html.erb b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/hotspots/hotspot_most_violated_rules.html.erb index 5d894f5c212..0674eb1dc51 100644 --- a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/hotspots/hotspot_most_violated_rules.html.erb +++ b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/hotspots/hotspot_most_violated_rules.html.erb @@ -32,12 +32,14 @@ <div class="line-block"> <div style="float:right"> - <a href="<%= url_for(:controller => 'drilldown', :action => 'violations', :id => @resource.key) -%>"><%= message('widget.hotspot_metric.more') -%></a> + <a href="#" onclick="window.location.href='<%= url_for(:controller => 'drilldown', :action => 'violations') -%>?id=<%= @resource.key -%>&period=<%= dashboard_configuration.period_index -%>&severity=' + $F('select-severity_<%= widget.id -%>') "> + <%= message('widget.hotspot_metric.more') -%> + </a> </div> <h3> <%= message(dashboard_configuration.selected_period? ? 'widget.hotspot_most_violated_rules.name_when_period' : 'widget.hotspot_most_violated_rules.name') -%> - <select class="small" style="margin-left: 20px" onchange="showMostViolatedRules<%= widget.id -%>(this.value);"> + <select class="small" style="margin-left: 20px" onchange="showMostViolatedRules<%= widget.id -%>(this.value);" id="select-severity_<%= widget.id -%>"> <option value="" <%= 'selected' if default_severity=='' -%>><%= message('widget.hotspot_most_violated_rules.any_severity') -%></option> <% Api::Severity::KEYS.each do |key| %> <option value="<%= key -%>" <%= 'selected' if default_severity==key -%>><%= message("severity.#{key}") -%></option> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/drilldown_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/drilldown_controller.rb index 3671f1dd71a..87e7485f356 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/drilldown_controller.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/drilldown_controller.rb @@ -80,7 +80,7 @@ class DrilldownController < ApplicationController @severity = params[:severity] || params[:priority] @rule_severity = params[:rule_sev] || @severity - if @rule_severity + if @rule_severity.present? # Filter resources by severity @metric = Metric::by_key("#{metric_prefix}#{@rule_severity.downcase}_violations") else @@ -120,7 +120,7 @@ class DrilldownController < ApplicationController # # Initialize filter by rule # - if @severity + if @severity.present? # Filter on severity -> filter rule measures by the selected metric @rule_measures = @snapshot.rule_measures(@metric) else |