]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-4418 Fix issues bulk change display on resource popup
authorJulien Lancelot <julien.lancelot@gmail.com>
Mon, 8 Jul 2013 07:46:50 +0000 (09:46 +0200)
committerJulien Lancelot <julien.lancelot@gmail.com>
Mon, 8 Jul 2013 07:46:50 +0000 (09:46 +0200)
sonar-server/src/main/webapp/WEB-INF/app/controllers/issues_controller.rb
sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/no_dashboard.html.erb
sonar-server/src/main/webapp/WEB-INF/app/views/drilldown/_header.html.erb
sonar-server/src/main/webapp/WEB-INF/app/views/issues/_bulk_change_form.html.erb
sonar-server/src/main/webapp/WEB-INF/app/views/issues/search.html.erb
sonar-server/src/main/webapp/WEB-INF/app/views/resource/_tabs.html.erb
sonar-server/src/main/webapp/WEB-INF/app/views/resource/index.html.erb

index b30592b268d9fe278879b29a170c28fdbdcb8727..41bd55e24583dc02158cb83b3d6b9108c3a868a6 100644 (file)
@@ -157,7 +157,7 @@ class IssuesController < ApplicationController
   def bulk_change
     verify_post_request
     Internal.issues.bulkChange(params, params[:comment])
-    render :text => params[:issues_query_params], :status => 200
+    render :text => '', :status => 200
   end
 
 
index 097babb7f5293220c8ec91934fb42c5d6add3527..cbd8542835ab3a6baf1121a46740dd692829d65c 100644 (file)
@@ -13,7 +13,7 @@
   }
 
   // refresh page after issues bulk change
-  function onBulkIssues(issues_query_params, component_key){
+  function onBulkIssues(issues_query_params){
     window.location.reload();
   }
 
index f076a1c8d589b66e61e233745be2b88ca109871e..cd7ccad3ee434184a77a96264def050114c25848 100644 (file)
@@ -13,8 +13,8 @@
   }
 
   // refresh page after issues bulk change
-  function onBulkIssues(issues_query_params, component_key){
-    d(component_key);
+  function onBulkIssues(issues_query_params){
+    d(issues_query_params['components']);
     closeModalWindow();
   }
 </script>
index 43d066db14fcafe17fe4f343bd58bfe99a573ed5..8ffbb27f2dda65e5ba710288958f9dce0bffd412 100644 (file)
@@ -4,11 +4,7 @@
 
    issues = issues_result.issues
    max_page_size_reached = issues_result.issues.size >= issues_result.paging.pageSize()
-   component_key = issue_query.components.to_a.first if issue_query.components and issue_query.components.size == 1
    project_key = issue_query.componentRoots.to_a.first if issue_query.componentRoots and issue_query.componentRoots.size == 1
-   if params[:from] == 'drilldown' && !project_key
-     project_key = Project.by_key(component_key).root_project.kee
-   end
 
    transitions_by_issues = {}
    unresolved_issues = 0
@@ -24,7 +20,6 @@
 %>
 <form id="bulk-change-form" method="post" action="<%= ApplicationController.root_context -%>/issues/bulk_change">
   <input type="hidden" name="issues" value="<%= issues.map { |issue| issue.key() }.join(',') -%>">
-  <input type="hidden" name="issues_query_params" value="<%= params.to_query -%>">
   <input type="hidden" name="actions[]" id="bulk-change-transition-action">
   <fieldset>
     <div class="modal-head">
 </form>
 <script>
   $j("#bulk-change-form").modalForm({
-    success: function (data) {
-      onBulkIssues(data, '<%= component_key %>');
+    success: function () {
+      onBulkIssues(<%= params.to_json -%>);
     },
     error: function (xhr, textStatus, errorThrown) {
       $j('#bulk-change-loading-image').addClass("hidden");
index dd06fe00f3cdef14f972c4b8f7660cc36107e0aa..371258b449d7a693f57ad12edc3b276803e60680 100644 (file)
@@ -59,6 +59,6 @@
 
 <script type="text/javascript">
   function onBulkIssues(issues_query_params, component_key){
-    window.location = baseUrl + '/issues/search?' + issues_query_params;
+    window.location = baseUrl + '/issues/search?' + jQuery.param(issues_query_params);
   }
 </script>
\ No newline at end of file
index cacbdfd7fbaf370a8d1c3ceac8f82fdfdf15b302..a30c805539e31c1a8e5e4e8aa260e5ce817afae5 100644 (file)
@@ -24,7 +24,7 @@
       <% first=true %>
       <% if logged_in? && @display_issues %>
         <li class="<%= 'first' if first -%>">
-          <a href="<%= url_for @issues_params.merge({:controller => 'issues', :action => 'bulk_change_form'}) -%>"
+          <a href="<%= url_for @issues_params.merge({:controller => 'issues', :action => 'bulk_change_form', 'componentRoots' => @resource.root ? @resource.root.key : nil}) -%>"
              class="bulk-change-link open-modal"><%= message('bulk_change') -%></a>
         </li>
       <% first=false
index f5f81a21fe363230c700b3ef1912ab976abbc582..654a2df04a3b194c482fcd02bab227a49f87b441 100644 (file)
@@ -8,4 +8,9 @@
     // Always display title in popup mode
     openAccordionItem('<%= url_for(params.merge({:display_title => 'true', :popup => 'true'})) -%>', this);
   });
+
+  // refresh page after issues bulk change
+  function onBulkIssues(issues_query_params){
+    window.location.reload();
+  }
 </script>
\ No newline at end of file