From c4bf89f4064b51442efe4c0264835b4cef264af7 Mon Sep 17 00:00:00 2001 From: Julien Lancelot Date: Tue, 16 Jul 2013 20:17:13 +0200 Subject: [PATCH] SONAR-4502 Change "No lines match your filter criteria." message on Issues tab --- .../src/main/resources/org/sonar/l10n/core.properties | 1 + .../webapp/WEB-INF/app/views/issues/_list.html.erb | 2 +- .../WEB-INF/app/views/issues/_search_ajax.html.erb | 10 ++++++++-- .../webapp/WEB-INF/app/views/resource/_index.html.erb | 1 + .../WEB-INF/app/views/shared/_no_issues.html.erb | 4 ++++ .../WEB-INF/app/views/shared/_source_display.erb | 6 +++++- 6 files changed, 20 insertions(+), 4 deletions(-) create mode 100644 sonar-server/src/main/webapp/WEB-INF/app/views/shared/_no_issues.html.erb diff --git a/plugins/sonar-core-plugin/src/main/resources/org/sonar/l10n/core.properties b/plugins/sonar-core-plugin/src/main/resources/org/sonar/l10n/core.properties index ad50bb9ca07..1d065fbd5da 100644 --- a/plugins/sonar-core-plugin/src/main/resources/org/sonar/l10n/core.properties +++ b/plugins/sonar-core-plugin/src/main/resources/org/sonar/l10n/core.properties @@ -539,6 +539,7 @@ issue_filter.criteria.status=Status issue_filter.max_results_reached=Only the first {0} issues matching the search criteria have been retrieved. Add some additional criteria to get fewer results to be able to sort this list. issue_filter.widget.max_results_reached=Only the first {0} issues matching the search criteria have been retrieved. issue_filter.no_result=No matching issues found. +issue_filter.no_result.help=Status of the related issues may have changed since the last analysis. issue_filter.save_filter=Save Filter issue_filter.edit_filter=Edit Filter issue_filter.copy_filter=Copy Filter diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/issues/_list.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/issues/_list.html.erb index 5140bb349b8..1eec5217a22 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/issues/_list.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/issues/_list.html.erb @@ -103,7 +103,7 @@ <% else %> -

<%= message('issue_filter.no_result') -%>

+

<%= message('issue_filter.no_result') -%>

<% end %> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/issues/_search_ajax.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/issues/_search_ajax.html.erb index c8bfae9ab89..eb1c6bf3e58 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/issues/_search_ajax.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/issues/_search_ajax.html.erb @@ -1,4 +1,10 @@
- <%= render :partial => 'operations_ajax' -%> - <%= render :partial => 'list' -%> + <% + if @issues_result.issues && !@issues_result.issues.empty? + %> + <%= render :partial => 'operations_ajax' -%> + <%= render :partial => 'list' -%> + <% else %> + <%= render :partial => 'shared/no_issues' -%> + <% end %>
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/resource/_index.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/resource/_index.html.erb index f72c402b88a..eea1aa3371f 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/resource/_index.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/resource/_index.html.erb @@ -22,6 +22,7 @@ :expanded => @expanded, \ :display_violations => @display_violations, \ :display_issues => @display_issues, \ + :has_global_issues => @global_issues && @global_issues.size>0, \ :resource => @resource, \ :snapshot => @snapshot, \ :review_screens_by_vid => @review_screens_by_vid, \ diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/shared/_no_issues.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/shared/_no_issues.html.erb new file mode 100644 index 00000000000..046be07f3c4 --- /dev/null +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/shared/_no_issues.html.erb @@ -0,0 +1,4 @@ +
+
<%= message('issue_filter.no_result') -%>
+
<%= image_tag 'help.png', :title => h(message('issue_filter.no_result.help')) -%>
+
\ No newline at end of file diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/shared/_source_display.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/shared/_source_display.erb index 43ab11dd10c..e48fcafaa35 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/shared/_source_display.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/shared/_source_display.erb @@ -119,7 +119,11 @@ <% if filtered && !has_displayed_lines %> -

<%= message('no_lines_match_your_filter_criteria') -%>

+ <% if display_issues && !has_global_issues %> + <%= render :partial => 'shared/no_issues' -%> + <% elsif display_coverage %> +

<%= message('no_lines_match_your_filter_criteria') -%>

+ <% end %> <% end %> -- 2.39.5