diff options
author | Stas Vilchik <vilchiks@gmail.com> | 2016-12-12 16:24:56 +0100 |
---|---|---|
committer | Stas Vilchik <vilchiks@gmail.com> | 2016-12-12 16:24:56 +0100 |
commit | 3077ae7e1bdbc02a088fbc6593fb7c6c96065bd4 (patch) | |
tree | 624e48d70ecfadaba90fad0868404c32bf08dff7 | |
parent | a3e7b997a51db49a83447c224e3c9ddf8251cdc9 (diff) | |
download | sonarqube-3077ae7e1bdbc02a088fbc6593fb7c6c96065bd4.tar.gz sonarqube-3077ae7e1bdbc02a088fbc6593fb7c6c96065bd4.zip |
support old project permalinks
-rw-r--r-- | server/sonar-web/src/main/js/app/utils/startReactApp.js | 4 | ||||
-rw-r--r-- | server/sonar-web/src/main/js/apps/overview/routes.js | 7 |
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}/> ]; |