aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2016-03-10 12:23:05 +0100
committerStas Vilchik <vilchiks@gmail.com>2016-04-01 17:53:08 +0200
commitefa02ff805c451c42821ce885469230d68fbe1e7 (patch)
treedf4c06dce0d9b23d23c6442efd3120f5d21fe5d5
parent991c27793618aa3c5041739ae1ba45af59458d13 (diff)
downloadsonarqube-efa02ff805c451c42821ce885469230d68fbe1e7.tar.gz
sonarqube-efa02ff805c451c42821ce885469230d68fbe1e7.zip
SONAR-7457 Open view governance page when the Governance plugin is installed
-rw-r--r--server/sonar-web/src/main/js/main/nav/component/component-nav-menu.js2
-rw-r--r--server/sonar-web/src/main/webapp/WEB-INF/app/controllers/dashboard_controller.rb7
-rw-r--r--server/sonar-web/src/main/webapp/WEB-INF/app/controllers/overview_controller.rb4
3 files changed, 10 insertions, 3 deletions
diff --git a/server/sonar-web/src/main/js/main/nav/component/component-nav-menu.js b/server/sonar-web/src/main/js/main/nav/component/component-nav-menu.js
index 22fb055a93a..cdbb58d0a0b 100644
--- a/server/sonar-web/src/main/js/main/nav/component/component-nav-menu.js
+++ b/server/sonar-web/src/main/js/main/nav/component/component-nav-menu.js
@@ -69,7 +69,7 @@ export default React.createClass({
isFixedDashboardActive() {
const path = window.location.pathname;
- return path.indexOf(window.baseUrl + '/overview') === 0;
+ return path.indexOf(window.baseUrl + '/overview') === 0|| path.indexOf(window.baseUrl + '/governance') === 0;
},
isCustomDashboardActive(customDashboard) {
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 613c4b7ad79..e3f7403bb75 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
@@ -38,7 +38,12 @@ class DashboardController < ApplicationController
# redirect to the project overview
if params[:id] && !params[:did] && !params[:name] && @resource.qualifier != 'DEV'
- return redirect_to(url_for({:controller => 'overview'}) + '?id=' + url_encode(params[:id]))
+ # if governance plugin is installed and we are opening a view
+ if Project.root_qualifiers.include?('VW') && (@resource.qualifier == 'VW' || @resource.qualifier == 'SVW')
+ return redirect_to(url_for({:controller => 'governance'}) + '?id=' + url_encode(params[:id]))
+ else
+ return redirect_to(url_for({:controller => 'overview'}) + '?id=' + url_encode(params[:id]))
+ end
end
load_dashboard()
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/overview_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/overview_controller.rb
index 746bc651be8..21428698a00 100644
--- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/overview_controller.rb
+++ b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/overview_controller.rb
@@ -23,7 +23,9 @@ class OverviewController < ApplicationController
SECTION=Navigation::SECTION_RESOURCE
def index
-
+ if Project.root_qualifiers.include?('VW') && (@resource.qualifier == 'VW' || @resource.qualifier == 'SVW')
+ return redirect_to(url_for({:controller => 'governance'}) + '?id=' + url_encode(params[:id]))
+ end
end
end