diff options
-rw-r--r-- | it/it-tests/src/test/resources/measure/ProjectOverviewTest/test_project_overview_after_first_analysis.html | 2 | ||||
-rw-r--r-- | server/sonar-web/src/main/js/helpers/urls.js | 26 | ||||
-rw-r--r-- | server/sonar-web/src/main/js/main/nav/component/component-nav-menu.js | 10 | ||||
-rw-r--r-- | server/sonar-web/src/main/webapp/WEB-INF/app/controllers/dashboard_controller.rb | 3 | ||||
-rw-r--r-- | server/sonar-web/src/main/webapp/WEB-INF/app/controllers/overview_controller.rb | 4 | ||||
-rw-r--r-- | server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard/overview.html.erb (renamed from server/sonar-web/src/main/webapp/WEB-INF/app/views/overview/index.html.erb) | 0 |
6 files changed, 9 insertions, 36 deletions
diff --git a/it/it-tests/src/test/resources/measure/ProjectOverviewTest/test_project_overview_after_first_analysis.html b/it/it-tests/src/test/resources/measure/ProjectOverviewTest/test_project_overview_after_first_analysis.html index 071c91eb3bd..5c91afb2ac5 100644 --- a/it/it-tests/src/test/resources/measure/ProjectOverviewTest/test_project_overview_after_first_analysis.html +++ b/it/it-tests/src/test/resources/measure/ProjectOverviewTest/test_project_overview_after_first_analysis.html @@ -16,7 +16,7 @@ <tbody> <tr> <td>open</td> - <td>/overview?id=project-for-overview</td> + <td>/dashboard?id=project-for-overview</td> <td></td> </tr> <tr> diff --git a/server/sonar-web/src/main/js/helpers/urls.js b/server/sonar-web/src/main/js/helpers/urls.js index 19bd44e6add..561413c59d9 100644 --- a/server/sonar-web/src/main/js/helpers/urls.js +++ b/server/sonar-web/src/main/js/helpers/urls.js @@ -50,32 +50,6 @@ export function getComponentDrilldownUrl (componentKey, metric) { } /** - * Generate URL for a component's dashboard - * @param {string} componentKey - * @param {string} dashboardKey - * @param {string} [period] - * @returns {string} - */ -export function getComponentDashboardUrl (componentKey, dashboardKey, period) { - let url = window.baseUrl + '/dashboard?id=' + encodeURIComponent(componentKey) + - '&did=' + encodeURIComponent(dashboardKey); - if (period) { - url += '&period=' + period; - } - return url; -} - -/** - * Generate URL for a fixed component's dashboard (overview) - * @param {string} componentKey - * @param {string} dashboardKey - * @returns {string} - */ -export function getComponentFixedDashboardUrl (componentKey, dashboardKey) { - return window.baseUrl + '/overview' + dashboardKey + '?id=' + encodeURIComponent(componentKey); -} - -/** * Generate URL for a component's permissions page * @param {string} componentKey * @returns {string} 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 185b5a6ef63..4aaf6ff239e 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 @@ -23,7 +23,7 @@ import classNames from 'classnames'; import React from 'react'; import LinksMixin from '../links-mixin'; import { translate } from '../../../helpers/l10n'; -import { getComponentFixedDashboardUrl } from '../../../helpers/urls'; +import { getComponentUrl } from '../../../helpers/urls'; const SETTINGS_URLS = [ '/project/settings', @@ -63,11 +63,11 @@ export default React.createClass({ isFixedDashboardActive() { const path = window.location.pathname; - return path.indexOf(window.baseUrl + '/overview') === 0 || path.indexOf(window.baseUrl + '/governance') === 0; + return path.indexOf(window.baseUrl + '/dashboard') === 0 || path.indexOf(window.baseUrl + '/governance') === 0; }, - renderOverviewLink() { - const url = getComponentFixedDashboardUrl(this.props.component.key, ''); + renderDashboardLink() { + const url = getComponentUrl(this.props.component.key); const name = <i className="icon-home"/>; const className = classNames({ active: this.isFixedDashboardActive() }); return ( @@ -250,7 +250,7 @@ export default React.createClass({ render() { return ( <ul className="nav navbar-nav nav-tabs"> - {this.renderOverviewLink()} + {this.renderDashboardLink()} {this.renderComponentIssuesLink()} {this.renderComponentMeasuresLink()} {this.renderCodeLink()} 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 8a4f8635fb4..08f98b294f1 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 @@ -50,7 +50,8 @@ class DashboardController < ApplicationController 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])) + @snapshot = @resource.last_snapshot + render :action => 'overview' end end else 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 21428698a00..c6184135692 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,9 +23,7 @@ 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 + redirect_to "#{ApplicationController.root_context}/dashboard/?id=#{url_encode(params[:id])}" end end diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/overview/index.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard/overview.html.erb index aecf8510253..aecf8510253 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/overview/index.html.erb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard/overview.html.erb |