diff options
author | Julien Lancelot <julien.lancelot@sonarsource.com> | 2014-01-20 15:32:18 +0100 |
---|---|---|
committer | Julien Lancelot <julien.lancelot@sonarsource.com> | 2014-01-20 15:32:18 +0100 |
commit | 22e1b16c81ddff3088d75da625b9d9469115934c (patch) | |
tree | d27bb92102f7b31385a22162a81a466cc112f889 | |
parent | 877cdd56155379608dd79b08008b57f946cd6cdf (diff) | |
download | sonarqube-22e1b16c81ddff3088d75da625b9d9469115934c.tar.gz sonarqube-22e1b16c81ddff3088d75da625b9d9469115934c.zip |
Update all links (issues widget, action plan page and email notification) to /issues/search
8 files changed, 24 insertions, 19 deletions
diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/issue/notification/NewIssuesEmailTemplate.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/issue/notification/NewIssuesEmailTemplate.java index f0c425ab955..a896823ac0c 100644 --- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/issue/notification/NewIssuesEmailTemplate.java +++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/issue/notification/NewIssuesEmailTemplate.java @@ -89,7 +89,7 @@ public class NewIssuesEmailTemplate extends EmailTemplate { String dateString = notification.getFieldValue(FIELD_PROJECT_DATE); if (projectKey != null && dateString != null) { Date date = DateUtils.parseDateTime(dateString); - String url = String.format("%s/issues/search?componentRoots=%s&createdAt=%s", + String url = String.format("%s/issues/search#componentRoots=%s|createdAt=%s", settings.getServerBaseURL(), encode(projectKey), encode(DateUtils.formatDateTime(date))); sb.append("\n").append("See it in SonarQube: ").append(url).append("\n"); } diff --git a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/issues/action_plans.html.erb b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/issues/action_plans.html.erb index 049808fddfc..8e1a42e73a0 100644 --- a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/issues/action_plans.html.erb +++ b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/issues/action_plans.html.erb @@ -66,8 +66,7 @@ <% if unresolved_issues_size == 0 %> <%= unresolved_issues_size -%> <% else %> - <a href="<%= url_for({:controller => 'issues', :action => 'search', - :actionPlans => plan.key, :resolved => 'false'}) -%>" + <a href="<%= url_for_issues({:actionPlans => plan.key, :resolved => 'false'}) -%>" title="<%= message('widget.action_plans.x_unresolved_issues', :params => unresolved_issues_size.to_s) -%>"><%= unresolved_issues_size -%></a> <% end %> </td> diff --git a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/issues/unresolved_issues_per_assignee.html.erb b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/issues/unresolved_issues_per_assignee.html.erb index 08ba140c521..5e1cadae3d9 100644 --- a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/issues/unresolved_issues_per_assignee.html.erb +++ b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/issues/unresolved_issues_per_assignee.html.erb @@ -53,8 +53,7 @@ %> <tr class="<%= cycle 'even', 'odd', :name => (div_id) -%>"> <td class="max-width"> - <%= link_to results.user(assignee).name, - {:controller => 'issues', :action => 'search', :assignees => assignee}.merge(options) -%> + <%= link_to results.user(assignee).name, url_for_issues(options.merge(:assignees => assignee)) -%> </td> <td class="nowrap"> <%= '+' if @dashboard_configuration.selected_period? -%><%= count.to_s -%> @@ -72,8 +71,7 @@ %> <tr class="<%= cycle 'even', 'odd', :name => (div_id) -%>"> <td class="max-width"> - <%= link_to message('widget.reviews_per_developer.not_assigned'), - {:controller => 'issues', :action => 'search', :assigned => 'false'}.merge(options) -%> + <%= link_to message('widget.reviews_per_developer.not_assigned'), url_for_issues(options.merge(:assigned => 'false')) -%> </td> <td class="nowrap"> <%= '+' if @dashboard_configuration.selected_period? -%><%= counter_no_assignee.to_s -%> diff --git a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/issues/unresolved_issues_statuses.html.erb b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/issues/unresolved_issues_statuses.html.erb index 255ea178eb4..7b54a12bcb9 100644 --- a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/issues/unresolved_issues_statuses.html.erb +++ b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/issues/unresolved_issues_statuses.html.erb @@ -15,7 +15,7 @@ <h3><%= message('issues') -%></h3> <div class="marginbottom10"> <span class="big"> - <%= format_measure(issues, :url => url_for({:controller => 'issues', :action => 'search' }.merge(issues_search_options))) -%> + <%= format_measure(issues, :url => url_for_issues(issues_search_options)) -%> </span> <%= dashboard_configuration.selected_period? ? format_variation(issues) : trend_icon(issues) -%> </div> @@ -26,7 +26,7 @@ <h3><%= message('issue.status.OPEN') -%></h3> <div class="marginbottom10"> <span class="big"> - <%= format_measure(open_issues, :url => url_for({:controller => 'issues', :action => 'search', :statuses => 'OPEN'}.merge(issues_search_options))) -%> + <%= format_measure(open_issues, :url => url_for_issues(issues_search_options.merge(:statuses => 'OPEN'))) -%> </span> <%= dashboard_configuration.selected_period? ? format_variation(open_issues) : trend_icon(open_issues) -%> </div> @@ -37,7 +37,7 @@ <h3><%= message('issue.status.REOPENED') -%></h3> <div class="marginbottom10"> <span class="big"> - <%= format_measure(reopened_issues, :url => url_for({:controller => 'issues', :action => 'search', :statuses => 'REOPENED'}.merge(issues_search_options))) -%> + <%= format_measure(reopened_issues, :url => url_for_issues(issues_search_options.merge(:statuses => 'REOPENED'))) -%> </span> <%= dashboard_configuration.selected_period? ? format_variation(reopened_issues) : trend_icon(reopened_issues) -%> </div> @@ -48,7 +48,7 @@ <h3><%= message('issue.status.CONFIRMED') -%></h3> <div class="marginbottom10"> <span class="big"> - <%= format_measure(confirmed_issues, :url => url_for({:controller => 'issues', :action => 'search', :statuses => 'CONFIRMED'}.merge(issues_search_options))) -%> + <%= format_measure(confirmed_issues, :url => url_for_issues(issues_search_options.merge(:statuses => 'CONFIRMED'))) -%> </span> <%= dashboard_configuration.selected_period? ? format_variation(confirmed_issues) : trend_icon(confirmed_issues) -%> </div> diff --git a/plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/issue/notification/NewIssuesEmailTemplateTest.java b/plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/issue/notification/NewIssuesEmailTemplateTest.java index 35d0468f1ef..aa6e4980309 100644 --- a/plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/issue/notification/NewIssuesEmailTemplateTest.java +++ b/plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/issue/notification/NewIssuesEmailTemplateTest.java @@ -108,7 +108,7 @@ public class NewIssuesEmailTemplateTest { "\n" + " Blocker: 0 Critical: 5 Major: 10 Minor: 3 Info: 1\n" + "\n" + - "See it in SonarQube: http://nemo.sonarsource.org/issues/search?componentRoots=org.apache%3Astruts&createdAt=2010-05-18T14%3A50%3A45%2B0000\n"); + "See it in SonarQube: http://nemo.sonarsource.org/issues/search#componentRoots=org.apache%3Astruts|createdAt=2010-05-18T14%3A50%3A45%2B0000\n"); } @Test 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 15c14f192dd..19ab206e7c1 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 @@ -997,4 +997,12 @@ module ApplicationHelper html end + def url_for_issues(params) + url = ApplicationController.root_context + '/issues/search#' + params.each do |key, value| + url += key.to_s + '=' + value.to_s + '|' + end + url + end + end diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/action_plans/_progress.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/action_plans/_progress.html.erb index cd42fad8718..d0bb4d27463 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/action_plans/_progress.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/action_plans/_progress.html.erb @@ -1,19 +1,19 @@ <% unless action_plan.totalIssues()==0 - options = {:controller => 'issues', :action => 'search', :actionPlans => action_plan.key} + options = {:actionPlans => action_plan.key} resolved_issues_link = action_plan.resolvedIssues().to_s - resolved_issues_link = link_to action_plan.resolvedIssues().to_s, options.merge({:resolved => 'true'}) unless action_plan.resolvedIssues()==0 - total_issues_link = link_to action_plan.totalIssues().to_s, options + resolved_issues_link = link_to action_plan.resolvedIssues().to_s, url_for_issues(options.merge(:resolved => 'true')) unless action_plan.resolvedIssues()==0 + total_issues_link = link_to action_plan.totalIssues().to_s, url_for_issues(options) if action_plan.resolvedIssues() > 0 - resolved_issues_url = url_for options.merge({:resolved => 'true'}) + resolved_issues_url = url_for_issues(options.merge({:resolved => 'true'})) percent_resolved = (action_plan.resolvedIssues()*100 / action_plan.totalIssues()).to_i tooltip_resolved = message('action_plans.resolved_issues_x_percent', :params => [percent_resolved.to_s, action_plan.resolvedIssues().to_s]) end if action_plan.unresolvedIssues() > 0 - unresolved_issues_url = url_for options.merge({:resolved => 'false'}) + unresolved_issues_url = url_for_issues(options.merge({:resolved => 'false'})) percent_open = (action_plan.unresolvedIssues()*100 / action_plan.totalIssues()).to_i tooltip_open = message('action_plans.unresolved_issues_x_percent', :params => [percent_open.to_s, action_plan.unresolvedIssues().to_s]) end @@ -39,4 +39,4 @@ <div class="note"><%= message('action_plans.x_out_of_x_issues_solved', :params => [resolved_issues_link, total_issues_link]) -%></div> </div> -<% end %>
\ No newline at end of file +<% end %> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/project/widgets/issues/_issues_list.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/project/widgets/issues/_issues_list.html.erb index 4d6d06eca8e..e3dbd405fe4 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/project/widgets/issues/_issues_list.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/project/widgets/issues/_issues_list.html.erb @@ -68,7 +68,7 @@ link_params[:period] = params[:period] %> <%= paginate_java(paging, :colspan => 3, :id => "issue-filter-foot-#{widget_id}", :include_loading_icon => true, - :url_results => url_for(search_options.merge({:controller => 'issues', :action => 'search' }).except('pageSize', 'pageIndex', 'table_limit', 'widget_id')) ) { |label, page_id| + :url_results => url_for_issues(search_options.except('pageSize', 'pageIndex', 'table_limit', 'widget_id')) ) { |label, page_id| <<EOF <a href="#" onclick="$j.ajax({ url:'#{url_for(link_params.merge({:pageIndex => page_id}))}', type:'post', success:function(response){$j('#issues-widget-#{widget_id}').html(response);}}); return false;">#{label}</a> EOF |