aboutsummaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2015-12-02 15:23:33 +0100
committerStas Vilchik <vilchiks@gmail.com>2015-12-02 15:25:48 +0100
commit334f0603c306a73bea460e1f04bf8a2b013428ab (patch)
tree9a0cae1f5a70122f2ca178cf1a40f03b2619a08a /server
parentf150c047ae04641c69dc7e3a07ac874958d6b88f (diff)
downloadsonarqube-334f0603c306a73bea460e1f04bf8a2b013428ab.tar.gz
sonarqube-334f0603c306a73bea460e1f04bf8a2b013428ab.zip
do not display overview pages for developers
Diffstat (limited to 'server')
-rw-r--r--server/sonar-web/src/main/js/main/nav/component/component-nav-menu.js20
-rw-r--r--server/sonar-web/src/main/webapp/WEB-INF/app/controllers/dashboard_controller.rb2
2 files changed, 16 insertions, 6 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 0966f4c940d..e563055b66b 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
@@ -20,8 +20,6 @@ const FIXED_DASHBOARDS = [
{ link: '/size', name: 'overview.domain.size' }
];
-const CUSTOM_DASHBOARDS_LIMIT = 1;
-
const SETTINGS_URLS = [
'/project/settings', '/project/profile', '/project/qualitygate', '/manual_measures/index',
'/action_plans/index', '/project/links', '/project_roles/index', '/project/history', '/project/key',
@@ -32,6 +30,11 @@ const SETTINGS_URLS = [
export default React.createClass({
mixins: [LinksMixin],
+ isDeveloper() {
+ const qualifier = _.last(this.props.component.breadcrumbs).qualifier;
+ return qualifier === 'DEV';
+ },
+
periodParameter() {
let params = qs.parse(window.location.search.substr(1));
return params.period ? `&period=${params.period}` : '';
@@ -55,7 +58,14 @@ export default React.createClass({
isCustomDashboardsActive () {
let dashboards = this.props.component.dashboards;
- return _.any(dashboards, this.isCustomDashboardActive) || this.isDashboardManagementActive();
+ return _.any(dashboards, this.isCustomDashboardActive) ||
+ this.isDashboardManagementActive() ||
+ this.isDefaultDeveloperDashboardActive();
+ },
+
+ isDefaultDeveloperDashboardActive() {
+ let path = window.location.pathname;
+ return this.isDeveloper() && path.indexOf(`${window.baseUrl}/dashboard`) === 0;
},
isDashboardManagementActive () {
@@ -279,10 +289,10 @@ export default React.createClass({
render() {
return (
<ul className="nav navbar-nav nav-tabs">
- {this.renderFixedDashboards()}
+ {!this.isDeveloper() && this.renderFixedDashboards()}
+ {this.renderCustomDashboards()}
{this.renderComponentsLink()}
{this.renderComponentIssuesLink()}
- {this.renderCustomDashboards()}
{this.renderTools()}
{this.renderAdministration()}
</ul>
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 87f15af4a01..613c4b7ad79 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
@@ -37,7 +37,7 @@ class DashboardController < ApplicationController
end
# redirect to the project overview
- if params[:id] && !params[:did] && !params[:name]
+ if params[:id] && !params[:did] && !params[:name] && @resource.qualifier != 'DEV'
return redirect_to(url_for({:controller => 'overview'}) + '?id=' + url_encode(params[:id]))
end