]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-4301 Display message and disable sort when issues results are higher than max...
authorJulien Lancelot <julien.lancelot@gmail.com>
Wed, 22 May 2013 14:26:23 +0000 (16:26 +0200)
committerJulien Lancelot <julien.lancelot@gmail.com>
Wed, 22 May 2013 14:26:23 +0000 (16:26 +0200)
plugins/sonar-core-plugin/src/main/resources/org/sonar/l10n/core.properties
sonar-core/src/main/java/org/sonar/core/issue/db/IssueDao.java
sonar-server/src/main/java/org/sonar/server/issue/DefaultIssueFinder.java
sonar-server/src/main/webapp/WEB-INF/app/controllers/issues_controller.rb
sonar-server/src/main/webapp/WEB-INF/app/helpers/issues_helper.rb
sonar-server/src/main/webapp/WEB-INF/app/views/issues/_list.html.erb
sonar-server/src/main/webapp/WEB-INF/app/views/issues/search.html.erb

index 6539383d1b66c09cc1320ee5a391173699f9d163..c61d5133dbffc9dde97224101e02749409327840 100644 (file)
@@ -577,6 +577,7 @@ issue_filter.criteria.reporter=Reporter
 issue_filter.criteria.created_after=Created since
 issue_filter.criteria.created_before=Created before
 issue_filter.criteria.date_format=year-month-day (2013-01-31)
+issue_filter.max_results_reached=Number of results are higher than {0}. Sort won't be available.
 
 
 #------------------------------------------------------------------------------
index ed15bef6208bc02ff3b33d83d35fbfd970ca5adc..9d0727892ab00f70511d26ecd06dad25ffc394c1 100644 (file)
@@ -125,6 +125,8 @@ public class IssueDao implements BatchComponent, ServerComponent {
         IssueDto issueDto = (IssueDto) context.getResultObject();
         if (authorizedRootProjectIds.contains(issueDto.getProjectId())) {
           issues.add(issueDto);
+        } else {
+          // reject because user not authorized
         }
         if (issues.size() >= maxResults) {
           context.stop();
index 1ce627cc59fdc2d27725b10aa072e429ed26ca40..3736a6e3f4990bcf6757989e2f9e583850c3c0a8 100644 (file)
@@ -156,7 +156,7 @@ public class DefaultIssueFinder implements IssueFinder {
                                  findUsers(users),
                                  paging,
                                  false,
-                                 authorizedIssues.size() != query.maxResults()
+                                 authorizedIssues.size() >= query.maxResults()
                                  // TODO
 //        authorizedIssues.size() != allIssues.size()
       );
index be7e09a7489433f5f40d98b7b929301140067678..c954e70c7e3d782dbaebf85f0f2d5e692f345757 100644 (file)
@@ -32,7 +32,7 @@ class IssuesController < ApplicationController
     @filter.criteria=criteria_params
     @filter.execute
 
-    @selected_project = @filter.issues_result.projects.first if !@filter.issues.isEmpty() && @filter.criteria('componentRoots')
+    @selected_project = @filter.issues_result.projects.first if @filter.issues && @filter.criteria('componentRoots')
   end
 
 
index fe629dc62da0e1370c60faca9c59a075a3fddd29..fab4c9a0457f86a8b07dd93b1d1773c24753979c 100644 (file)
@@ -22,9 +22,13 @@ module IssuesHelper
   def column_html(filter, column_label, column_tooltip, sort)
     filter_sort = filter.criteria[:sort]
     filter_asc = filter.criteria[:asc] == 'true' ? true : false
-    html = link_to_function(h(column_label), "refreshList('#{escape_javascript sort}',#{!filter_asc}, #{filter.criteria[:page]||1})", :title => h(column_tooltip))
-    if sort == filter_sort
-      html << (filter_asc ? image_tag("asc12.png") : image_tag("desc12.png"))
+    if !filter.issues_result.maxResultsReached()
+      html = link_to_function(h(column_label), "refreshList('#{escape_javascript sort}',#{!filter_asc}, #{filter.criteria[:page]||1})", :title => h(column_tooltip))
+      if sort == filter_sort
+        html << (filter_asc ? image_tag("asc12.png") : image_tag("desc12.png"))
+      end
+    else
+      html = h(column_label)
     end
     html
   end
index 6cbf06e15718e706021df086d12d3b60d2116376..379b85ba3227605d5f575e1857aa6c892a55dc35 100644 (file)
@@ -19,7 +19,7 @@
 
 <%
    if @filter.issues && !@filter.issues.empty?
-    colspan = 8
+    colspan = 9
 %>
   <div>
     <table class="data width100">
index ffc32f12e809caa4291be74cdfd2d52bdae31d31..5c2e114c51a38186935044519d9f2e438c5e2d45 100644 (file)
@@ -7,10 +7,14 @@
   <div class="page-split-right">
     <div id="content">
       <div class="marginbottom10">
-        <% if @filter.issues_result && @filter.issues_result.securityExclusions() %>
-          <p class="notes"><%= message('results_not_display_due_to_security') -%></p>
+        <% if @filter.issues_result %>
+          <% if @filter.issues_result.securityExclusions() %>
+            <p class="notes"><%= message('results_not_display_due_to_security') -%></p>
+          <% end %>
+          <% if @filter.issues_result.maxResultsReached() %>
+            <p class="notes"><%= message('issue_filter.max_results_reached', :params => @filter.paging.total()) -%></p>
+          <% end %>
         <% end %>
-
         <%= render :partial => 'list' -%>
       </div>
     </div>