aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2016-12-12 16:24:56 +0100
committerStas Vilchik <vilchiks@gmail.com>2016-12-12 16:24:56 +0100
commit3077ae7e1bdbc02a088fbc6593fb7c6c96065bd4 (patch)
tree624e48d70ecfadaba90fad0868404c32bf08dff7
parenta3e7b997a51db49a83447c224e3c9ddf8251cdc9 (diff)
downloadsonarqube-3077ae7e1bdbc02a088fbc6593fb7c6c96065bd4.tar.gz
sonarqube-3077ae7e1bdbc02a088fbc6593fb7c6c96065bd4.zip
support old project permalinks
-rw-r--r--server/sonar-web/src/main/js/app/utils/startReactApp.js4
-rw-r--r--server/sonar-web/src/main/js/apps/overview/routes.js7
2 files changed, 7 insertions, 4 deletions
diff --git a/server/sonar-web/src/main/js/app/utils/startReactApp.js b/server/sonar-web/src/main/js/app/utils/startReactApp.js
index 3e1bba4f6ff..e92ba5d8996 100644
--- a/server/sonar-web/src/main/js/app/utils/startReactApp.js
+++ b/server/sonar-web/src/main/js/app/utils/startReactApp.js
@@ -70,6 +70,10 @@ const startReactApp = () => {
render((
<Provider store={store}>
<Router history={history}>
+ <Route path="/dashboard/index/:key" onEnter={(nextState, replace) => {
+ replace({ pathname: '/dashboard', query: { id: nextState.params.key } });
+ }}/>
+
<Route path="markdown/help" component={MarkdownHelp}/>
<Route component={LocalizationContainer}>
diff --git a/server/sonar-web/src/main/js/apps/overview/routes.js b/server/sonar-web/src/main/js/apps/overview/routes.js
index 6fac11a62ab..c28123a7a38 100644
--- a/server/sonar-web/src/main/js/apps/overview/routes.js
+++ b/server/sonar-web/src/main/js/apps/overview/routes.js
@@ -18,11 +18,10 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import React from 'react';
-import { IndexRoute, Route } from 'react-router';
+import { IndexRoute, Redirect } from 'react-router';
import AppContainer from './components/AppContainer';
export default [
- <IndexRoute key="index" component={AppContainer}/>,
- <Route key="1" path="index" component={AppContainer}/>,
- <Route key="2" path="index/:projectKey" component={AppContainer}/>
+ <Redirect key="redirect" from="/dashboard/index" to="/dashboard"/>,
+ <IndexRoute key="index" component={AppContainer}/>
];