diff options
author | Julien Lancelot <julien.lancelot@gmail.com> | 2013-07-03 17:01:12 +0200 |
---|---|---|
committer | Julien Lancelot <julien.lancelot@gmail.com> | 2013-07-03 17:01:12 +0200 |
commit | b4e4d45afc293be3a5c63f8991b76ec9df66c72d (patch) | |
tree | a70cda26e2c680037a5cfd7d0821a166f4596ee6 | |
parent | 1f5614fdc2781e6302f44afb20d1b472157b214a (diff) | |
download | sonarqube-b4e4d45afc293be3a5c63f8991b76ec9df66c72d.tar.gz sonarqube-b4e4d45afc293be3a5c63f8991b76ec9df66c72d.zip |
SONAR-4421 Display number of issues that will be updated
-rw-r--r-- | sonar-server/src/main/webapp/WEB-INF/app/controllers/issues_controller.rb | 2 | ||||
-rw-r--r-- | sonar-server/src/main/webapp/WEB-INF/app/views/issues/_bulk_change_form.html.erb | 19 |
2 files changed, 17 insertions, 4 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/issues_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/issues_controller.rb index 8c336748b0e..8392a018c3e 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/issues_controller.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/issues_controller.rb @@ -193,6 +193,7 @@ class IssuesController < ApplicationController issues_result = issue_filter_result.result @transitions_by_issues = {} + @unresolved_issues = 0 issues_result.issues.each do |issue| transitions = Internal.issues.listTransitions(issue) transitions.each do |transition| @@ -200,6 +201,7 @@ class IssuesController < ApplicationController issues_for_transition += 1 @transitions_by_issues[transition.key] = issues_for_transition end + @unresolved_issues += 1 unless issue.resolution() end @issues = issues_result.issues.map { |issue| issue.key() } @project = issue_query.componentRoots.to_a.first if issue_query.componentRoots and issue_query.componentRoots.size == 1 diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/issues/_bulk_change_form.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/issues/_bulk_change_form.html.erb index 1d2fce27286..3d2bfbf19ab 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/issues/_bulk_change_form.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/issues/_bulk_change_form.html.erb @@ -13,13 +13,16 @@ <% end %> </div> <div class="bulk-change errors" style="display:none;"/> + + <% if @unresolved_issues > 0 %> <div class="modal-field"> <label for="assignee"> <%= message('issue.assign.formlink') -%> </label> <input id="assign-action" name="actions[]" type="checkbox" value="assign"/> - <%= user_select_tag('assign.assignee', :html_id => 'assignee', :open => false, - :include_choices => {'0' => escape_javascript(message('unassigned')), current_user.login => escape_javascript(message('assigned_to_me'))}) -%> + <%= user_select_tag('assign.assignee', :html_id => 'assignee', :open => false, :selected_user => current_user, + :include_choices => {'' => escape_javascript(message('unassigned')), current_user.login => escape_javascript(message('assigned_to_me'))}) -%> + <span style="float:right;">(<%= message('issue_filter.bulk_change.x_issues', :params => @unresolved_issues.to_s) -%>)</span> </div> <% if @project && !@project.blank? @@ -43,6 +46,7 @@ </label> <input id="plan-action" name="actions[]" type="checkbox" value="plan"/> <%= dropdown_tag('plan.plan', plan_options, {:show_search_box => false}, {:id => 'plan'}) -%> + <span style="float:right;">(<%= message('issue_filter.bulk_change.x_issues', :params => @unresolved_issues.to_s) -%>)</span> </div> <% end %> <% end %> @@ -53,16 +57,23 @@ <input id="set-severity-action" name="actions[]" type="checkbox" value="set_severity"/> <%= severity_dropdown_tag('set_severity.severity', severitiy_select_option_tags, {:show_search_box => false}, {:id => 'severity'}) -%> + <span style="float:right;">(<%= message('issue_filter.bulk_change.x_issues', :params => @unresolved_issues.to_s) -%>)</span> </div> + <% end %> + + <% if @transitions_by_issues.size > 0 %> <div class="modal-field"> <label> <%= message('issue.transition') -%> </label> <% @transitions_by_issues.keys.each do |transition| %> <input type="radio" name="transition.transition" value="<%= transition -%>" - onClick="addTransitionAction();"> <%= message("issue.transition.#{transition}") -%> (<%= @transitions_by_issues[transition].to_s %>) <br> - <% end %> + onClick="addTransitionAction();"> <%= message("issue.transition.#{transition}") -%> + <span style="float:right;">(<%= message('issue_filter.bulk_change.x_issues', :params => @transitions_by_issues[transition].to_s) %>)</span><br/> + <% end %> </div> + <% end %> + <div class="modal-field"> <label> <%= message('issue.comment.formlink') -%> |