From dfa4abac0c4ae0ab70a6f42e5ace72d9212ffb30 Mon Sep 17 00:00:00 2001 From: Fabrice Bellingard Date: Thu, 19 May 2011 10:53:38 +0200 Subject: [PATCH] SONAR-2426 Allow to directly assign a violation to users Forgot the option to leave unassigned. --- .../main/webapp/WEB-INF/app/controllers/reviews_controller.rb | 4 ++-- .../app/views/reviews/_violation_comment_form.html.erb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/reviews_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/reviews_controller.rb index d4680a507d4..62b3f3b8759 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/reviews_controller.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/reviews_controller.rb @@ -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) diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_violation_comment_form.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_violation_comment_form.html.erb index 9d24f828639..c178620b5ba 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_violation_comment_form.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_violation_comment_form.html.erb @@ -18,7 +18,7 @@ <% if @violation.review.nil? || @violation.review.comments.size==0 %>   - Assign to: + Assignee: <%= select_tag "assignee_id", options_for_select(@user_options, current_user.id.to_s) %> <% end %> -- 2.39.5