<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>
@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
#
# 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