]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-4418 Fix issue when launching bulk change with a period selected and fix set...
authorJulien Lancelot <julien.lancelot@gmail.com>
Thu, 4 Jul 2013 13:22:21 +0000 (15:22 +0200)
committerJulien Lancelot <julien.lancelot@gmail.com>
Thu, 4 Jul 2013 13:22:21 +0000 (15:22 +0200)
sonar-server/src/main/java/org/sonar/server/issue/SetSeverityAction.java
sonar-server/src/main/webapp/WEB-INF/app/controllers/resource_controller.rb
sonar-server/src/main/webapp/WEB-INF/app/views/resource/_tabs.html.erb
sonar-server/src/test/java/org/sonar/server/issue/SetSeverityActionTest.java

index 363d963e57662fdd1a5926e5e22a895c06c66c0e..b44fa04ffa539883e72a2876759f791e67761bd5 100644 (file)
@@ -50,7 +50,7 @@ public class SetSeverityAction extends Action implements ServerComponent {
 
   @Override
   public boolean execute(Map<String, Object> properties, Context context) {
-    return issueUpdater.setSeverity((DefaultIssue) context.issue(), severity(properties), context.issueChangeContext());
+    return issueUpdater.setManualSeverity((DefaultIssue) context.issue(), severity(properties), context.issueChangeContext());
   }
 
   private String severity(Map<String, Object> properties) {
index 1e0b00bfdcc50e67329cf1d9bff53ec18c0d1048..b645f80b04263877bf32e7cf3906cab82f82100a 100644 (file)
@@ -323,7 +323,7 @@ class ResourceController < ApplicationController
     if @period && @period != 0
       date = @snapshot.period_datetime(@period)
       if date
-        options['createdAfter'] = date
+        options['createdAfter'] = Api::Utils.format_datetime(date)
       end
     end
 
index 5007355a5ccd2822efbc35b1a97ed9043cc2524a..a81e243c1bbf447b947c16a2b05b8a408fc9a1ff 100644 (file)
 
   <div class="source_tabs">
     <ul class="tablinks">
-
-      <% if @display_issues %>
-        <li>
+      <% first=true %>
+      <% if logged_in? && @display_issues %>
+        <li class="<%= 'first' if first -%>">
           <a href="<%= url_for @issues_params.merge({:controller => 'issues', :action => 'bulk_change_form', :from => 'drilldown'}) -%>"
              class="bulk-change-link open-modal"><%= message('bulk_change') -%></a>
         </li>
-      <% end %>
-
-      <%
-         first=true
-         if @snapshot.has_source && has_role?(:codeviewer, @snapshot)
-      %>
+      <% first=false
+         end %>
+      <% if @snapshot.has_source && has_role?(:codeviewer, @snapshot) %>
         <li class="<%= 'first' if first -%>">
           <a href="<%= ApplicationController.root_context -%>/api/sources?resource=<%= @resource.key -%>&amp;format=txt"><%= message('raw') -%></a>
         </li>
index 0148ab2ccc916495ba024b00554b18a1f8b838ed..487f9bb13892df76c01faadfde9bd16b7488f2b1 100644 (file)
@@ -57,7 +57,7 @@ public class SetSeverityActionTest {
     when(context.issue()).thenReturn(issue);
 
     action.execute(properties, context);
-    verify(issueUpdater).setSeverity(eq(issue), eq(severity), any(IssueChangeContext.class));
+    verify(issueUpdater).setManualSeverity(eq(issue), eq(severity), any(IssueChangeContext.class));
   }
 
   @Test