From: Jean-Baptiste Vilain Date: Fri, 21 Jun 2013 09:45:35 +0000 (+0200) Subject: SONAR-4136 Fixed lost context when redirecting after a resource-level dashboard creation X-Git-Tag: 3.7~406 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=1fdf944c476e3fe1dc989ca3faeced229a643a6b;p=sonarqube.git SONAR-4136 Fixed lost context when redirecting after a resource-level dashboard creation --- diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/dashboards_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/dashboards_controller.rb index ed206bab77c..aa6beb0f624 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/dashboards_controller.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/dashboards_controller.rb @@ -65,7 +65,7 @@ class DashboardsController < ApplicationController add_default_dashboards_if_first_user_dashboard(@dashboard.global?) last_index=current_user.active_dashboards.max_by(&:order_index).order_index current_user.active_dashboards.create(:dashboard => @dashboard, :user => current_user, :order_index => (last_index+1)) - render :text => @dashboard.id.to_s, :resource => params[:resource], :highlight => @dashboard.id, :status => 200 + render :text => params[:resource], :highlight => @dashboard.id, :status => 200 else render :partial => 'dashboards/create_form', :status => 400, :resource => params[:resource] end @@ -86,7 +86,7 @@ class DashboardsController < ApplicationController if @dashboard.editable_by?(current_user) load_dashboard_from_params(@dashboard) if @dashboard.save - render :text => @dashboard.id.to_s, :resource => params[:resource], :status => 200 + render :text => params[:resource], :status => 200 else render :partial => 'dashboards/edit_form', :status => 400, :resource => params[:resource] end diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/dashboards/_create_form.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/dashboards/_create_form.html.erb index 5cee02f7eaf..5fbe198f9fd 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/dashboards/_create_form.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/dashboards/_create_form.html.erb @@ -38,7 +38,8 @@ diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/dashboards/_edit_form.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/dashboards/_edit_form.html.erb index a3312878ae5..abce4ae6c3c 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/dashboards/_edit_form.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/dashboards/_edit_form.html.erb @@ -45,6 +45,7 @@ \ No newline at end of file +