]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-4554 Do not display "Save" link after bulk change when a filter is selected
authorJulien Lancelot <julien.lancelot@gmail.com>
Wed, 14 Aug 2013 09:29:39 +0000 (11:29 +0200)
committerJulien Lancelot <julien.lancelot@gmail.com>
Wed, 14 Aug 2013 09:29:57 +0000 (11:29 +0200)
sonar-server/src/main/webapp/WEB-INF/app/controllers/issues_controller.rb
sonar-server/src/main/webapp/WEB-INF/app/views/issues/_operations.html.erb

index 5015bd7503e5a6d32e5cccd039c0e8c99339dc15..34b2fba5dafa912a583c923f369b03becc6dddcd 100644 (file)
@@ -33,8 +33,9 @@ class IssuesController < ApplicationController
 
   # GET /issues/search
   def search
-    @first_search = issues_query_params_sanitized.empty?
     @issues_query_params = criteria_params
+    @first_search = issues_query_params_sanitized.empty?
+    @unchanged = issues_query_params_sanitized.empty?
 
     if params[:id]
       @filter = find_filter(params[:id].to_i)
@@ -191,10 +192,11 @@ class IssuesController < ApplicationController
   end
 
   def criteria_params
-    params['pageSize'] = PAGE_SIZE unless request.xhr?
-    params.delete('controller')
-    params.delete('action')
-    params
+    new_params = params.clone
+    new_params['pageSize'] = PAGE_SIZE unless request.xhr?
+    new_params.delete('controller')
+    new_params.delete('action')
+    new_params
   end
 
   def issues_query_params_sanitized
index b99e8a975e5233bafaf2e6a4fe57b71fb738b82e..41d8cd697a2a51c7c051a460c1e950a96b802a3d 100644 (file)
@@ -4,7 +4,7 @@
       <% if @filter && @filter.id %>
         <li><a id="copy" href="<%= url_for :action => 'copy_form', :id => @filter.id -%>" class="link-action open-modal"><%= message('copy') -%></a></li>
       <% end %>
-      <% if !defined?(@unchanged) && @filter && @filter.id && @filter.user == current_user.login %>
+      <% if !@unchanged && @filter && @filter.id && @filter.user == current_user.login %>
         <li>
           <%= link_to message('save'), params.merge({:action => 'save', :id => @filter.id}), :class => 'link-action', :id => 'save', :method => :post -%>
         </li>