]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-2426 Allow to directly assign a violation to users
authorFabrice Bellingard <bellingard@gmail.com>
Thu, 19 May 2011 08:53:38 +0000 (10:53 +0200)
committerFabrice Bellingard <bellingard@gmail.com>
Thu, 19 May 2011 08:53:38 +0000 (10:53 +0200)
Forgot the option to leave unassigned.

sonar-server/src/main/webapp/WEB-INF/app/controllers/reviews_controller.rb
sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_violation_comment_form.html.erb

index d4680a507d46217eeca04bd7932a3750a01045cd..62b3f3b87596ef48c26b4b2783506cbbeaeb7f58 100644 (file)
@@ -224,7 +224,7 @@ class ReviewsController < ApplicationController
     if !params[:comment_id].blank? && @violation.review
       @comment = @violation.review.comments.find(params[:comment_id])
     end
-    @user_options = options_for_users()
+    @user_options = [["Unassigned", ""]] + options_for_users
     render :partial => 'reviews/violation_comment_form'
   end
 
@@ -238,7 +238,7 @@ class ReviewsController < ApplicationController
     sanitize_violation(violation)
 
     unless violation.review
-      assignee = User.find params[:assignee_id]
+      assignee = User.find params[:assignee_id] unless params[:assignee_id].blank?
       violation.create_review!(
           :assignee => assignee,
           :user => current_user)
index 9d24f8286399708469a427b817d8a3341c05ab3b..c178620b5ba98616b5bc6b9e01f202095ea41ae7 100644 (file)
@@ -18,7 +18,7 @@
 
         <% if @violation.review.nil? || @violation.review.comments.size==0 %>
           &nbsp;
-          Assign to
+          Assignee
           <%= select_tag "assignee_id", options_for_select(@user_options, current_user.id.to_s)  %>
         <% end %>
       </td>