]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-5230 Display "Share..." checkbox on all copy forms
authorJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>
Wed, 30 Jul 2014 16:00:43 +0000 (18:00 +0200)
committerJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>
Wed, 30 Jul 2014 16:00:43 +0000 (18:00 +0200)
server/sonar-web/src/main/webapp/WEB-INF/app/controllers/issues_controller.rb
server/sonar-web/src/main/webapp/WEB-INF/app/controllers/measures_controller.rb
server/sonar-web/src/main/webapp/WEB-INF/app/views/issues/_filter_shared_form.html.erb

index fc6ad3c817a029321568f9c5258d7a7c077af881..7690cea09be4f502d697d2094329df30ab9ebe28 100644 (file)
@@ -109,6 +109,7 @@ class IssuesController < ApplicationController
   def copy_form
     require_parameters :id
     @filter = find_filter(params[:id].to_i)
+    @filter.setUser(nil)
     @filter.setShared(false)
     render :partial => 'issues/filter_copy_form'
   end
index ca1260963213461c8f89a07fe7ddbcfd24be5db1..7c955be664b49d56dda302b524a54e4bbae085a7 100644 (file)
@@ -166,6 +166,7 @@ class MeasuresController < ApplicationController
     require_parameters :id
     @filter = find_filter(params[:id])
     @filter.shared = false
+    @filter.user_id = nil
     render :partial => 'measures/copy_form'
   end
 
index d90b9660b73ed94cc3b56384c66538e80790d9cb..24c3891792ae1eaf5efa3d6b984b486b80425dcc 100644 (file)
@@ -22,7 +22,7 @@
   <% end %>
   <% if Internal.issues.canUserShareIssueFilter() %>
     <div class="modal-field">
-      <% if !@filter || @filter.user == current_user.login %>
+      <% if !@filter || @filter.user.nil? || @filter.user == current_user.login %>
         <label for="shared"><%= message('issue_filter.form.share') -%></label>
         <input id="shared" name="shared" type="checkbox" value="true" <%= 'checked' if (@filter && @filter.shared) -%>/>
       <% else %>
@@ -30,4 +30,4 @@
       <% end %>
     </div>
   <% end %>
-</div>
\ No newline at end of file
+</div>