From f6ea19ed5a82aab38aa68580d97e60b879bd439b Mon Sep 17 00:00:00 2001 From: Stas Vilchik Date: Mon, 9 Nov 2015 14:53:23 +0100 Subject: [PATCH] SONAR-6331 fix project overview redirection --- .../app/controllers/dashboard_controller.rb | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/dashboard_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/dashboard_controller.rb index fbe46141759..87f15af4a01 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/dashboard_controller.rb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/dashboard_controller.rb @@ -25,13 +25,22 @@ class DashboardController < ApplicationController before_filter :login_required, :except => [:index] def index - if params[:id] && !params[:did] && !params[:name] - return redirect_to(url_for({:controller => 'overview'}) + '?id=' + url_encode(params[:id])) - end - load_resource() if !@resource || @resource.display_dashboard? - redirect_if_bad_component() + if params[:id] + unless @resource + return project_not_found + end + unless @snapshot + return project_not_analyzed + end + end + + # redirect to the project overview + if params[:id] && !params[:did] && !params[:name] + return redirect_to(url_for({:controller => 'overview'}) + '?id=' + url_encode(params[:id])) + end + load_dashboard() load_authorized_widget_definitions() else -- 2.39.5