From ef1f266830af27744b6cad58c50eb1573f9d432c Mon Sep 17 00:00:00 2001 From: Yarin Dekel Date: Thu, 14 Feb 2019 16:48:48 +0200 Subject: support route path change in workflow Issue-ID: SDC-2122 Change-Id: I85e712d1a119475a48a22cd21fd4f29d54f9c607 Signed-off-by: Yarin Dekel --- workflow-designer-ui/src/main/frontend/index.html | 3 +-- .../src/main/frontend/src/features/catalog/CatalogView.jsx | 3 ++- .../features/version/versionController/VersionControllerView.jsx | 2 +- .../src/main/frontend/src/features/version/versionSaga.js | 2 +- .../main/frontend/src/features/workflow/overview/OverviewView.jsx | 4 ++-- .../main/frontend/src/features/workflow/overview/overviewSagas.js | 2 +- .../src/features/workflow/overview/views/WorkflowHeader.jsx | 2 +- workflow-designer-ui/src/main/frontend/src/routes.js | 6 +++--- workflow-designer-ui/src/main/webapp/WEB-INF/jetty-web.xml | 4 ++-- 9 files changed, 14 insertions(+), 14 deletions(-) diff --git a/workflow-designer-ui/src/main/frontend/index.html b/workflow-designer-ui/src/main/frontend/index.html index 09d2d0a9..f0d2b573 100644 --- a/workflow-designer-ui/src/main/frontend/index.html +++ b/workflow-designer-ui/src/main/frontend/index.html @@ -1,8 +1,7 @@ - - + SDC Workflow App diff --git a/workflow-designer-ui/src/main/frontend/src/features/catalog/CatalogView.jsx b/workflow-designer-ui/src/main/frontend/src/features/catalog/CatalogView.jsx index b9d6f863..c1cd68ce 100644 --- a/workflow-designer-ui/src/main/frontend/src/features/catalog/CatalogView.jsx +++ b/workflow-designer-ui/src/main/frontend/src/features/catalog/CatalogView.jsx @@ -100,7 +100,8 @@ class CatalogView extends Component { goToOverviewPage = id => { const { history } = this.props; - history.push('/workflow/' + id + '/overview'); + const { location } = history; + history.push(`${location.pathname}/workflow/${id}/overview`); }; searchChange = searchValue => { diff --git a/workflow-designer-ui/src/main/frontend/src/features/version/versionController/VersionControllerView.jsx b/workflow-designer-ui/src/main/frontend/src/features/version/versionController/VersionControllerView.jsx index f2511c08..ef5e1168 100644 --- a/workflow-designer-ui/src/main/frontend/src/features/version/versionController/VersionControllerView.jsx +++ b/workflow-designer-ui/src/main/frontend/src/features/version/versionController/VersionControllerView.jsx @@ -55,7 +55,7 @@ export default class VersionControllerView extends Component { routeToOverview = () => { const { history, match } = this.props; const workflowId = match.params.workflowId; - history.push('/workflow/' + workflowId + '/overview'); + history.push(`/workflows/workflow/${workflowId}/overview`); }; sendSaveParamsToServer = () => { diff --git a/workflow-designer-ui/src/main/frontend/src/features/version/versionSaga.js b/workflow-designer-ui/src/main/frontend/src/features/version/versionSaga.js index cf391f33..56dd7a5d 100644 --- a/workflow-designer-ui/src/main/frontend/src/features/version/versionSaga.js +++ b/workflow-designer-ui/src/main/frontend/src/features/version/versionSaga.js @@ -86,7 +86,7 @@ function* watchSubmitVersion(action) { const versions = yield call(overviewApi.getVersions, workflowId); yield put(versionListFetchAction(versions)); yield call( - history.push('/workflow/' + workflowId + '/version/' + data.id) + history.push(`/workflows/workflow/${workflowId}/version/${data.id}`) ); } catch (error) { yield put(genericNetworkErrorAction(error)); diff --git a/workflow-designer-ui/src/main/frontend/src/features/workflow/overview/OverviewView.jsx b/workflow-designer-ui/src/main/frontend/src/features/workflow/overview/OverviewView.jsx index 1089e209..952e93cf 100644 --- a/workflow-designer-ui/src/main/frontend/src/features/workflow/overview/OverviewView.jsx +++ b/workflow-designer-ui/src/main/frontend/src/features/workflow/overview/OverviewView.jsx @@ -55,8 +55,8 @@ class OverviewView extends Component { } onSelectVersionFromTable = data => { - const { history, workflow } = this.props; - history.push('/workflow/' + workflow.id + '/version/' + data.id); + const { history } = this.props; + history.push('version/' + data.id); }; onCreateNewVersionFromTable = () => { diff --git a/workflow-designer-ui/src/main/frontend/src/features/workflow/overview/overviewSagas.js b/workflow-designer-ui/src/main/frontend/src/features/workflow/overview/overviewSagas.js index 8b5f04f9..41002c89 100644 --- a/workflow-designer-ui/src/main/frontend/src/features/workflow/overview/overviewSagas.js +++ b/workflow-designer-ui/src/main/frontend/src/features/workflow/overview/overviewSagas.js @@ -93,7 +93,7 @@ export function* archiveWorkflow(action) { }) }) ); - history.push('/'); + history.push('/workflows'); } export function* watchOverview() { diff --git a/workflow-designer-ui/src/main/frontend/src/features/workflow/overview/views/WorkflowHeader.jsx b/workflow-designer-ui/src/main/frontend/src/features/workflow/overview/views/WorkflowHeader.jsx index 3175cbba..e40b19a2 100644 --- a/workflow-designer-ui/src/main/frontend/src/features/workflow/overview/views/WorkflowHeader.jsx +++ b/workflow-designer-ui/src/main/frontend/src/features/workflow/overview/views/WorkflowHeader.jsx @@ -23,7 +23,7 @@ import ArchiveLabel from 'shared/archiveLabel/ArchiveLabel'; const Buttons = ({ history, archiveWorkflow, restoreWorkflow, isArchive }) => (
history.push('/')} + onClick={() => history.push('/workflows')} label={I18n.t('workflow.overview.backBtnLabel')} className="go-catalog-btn" labelPosition="right" diff --git a/workflow-designer-ui/src/main/frontend/src/routes.js b/workflow-designer-ui/src/main/frontend/src/routes.js index ea433cca..4be77016 100644 --- a/workflow-designer-ui/src/main/frontend/src/routes.js +++ b/workflow-designer-ui/src/main/frontend/src/routes.js @@ -23,7 +23,7 @@ import Composition from 'features/version/composition/Composition'; export const routes = [ { - path: '/workflow/:workflowId/version/:versionId', + path: '/workflows/workflow/:workflowId/version/:versionId', component: Version, routes: [ { @@ -48,12 +48,12 @@ export const routes = [ ] }, { - path: '/', + path: '/workflows', exact: true, component: Catalog }, { - path: '/workflow/:workflowId/overview', + path: '/workflows/workflow/:workflowId/overview', component: OverviewView } ]; diff --git a/workflow-designer-ui/src/main/webapp/WEB-INF/jetty-web.xml b/workflow-designer-ui/src/main/webapp/WEB-INF/jetty-web.xml index 1867004f..92e847c8 100644 --- a/workflow-designer-ui/src/main/webapp/WEB-INF/jetty-web.xml +++ b/workflow-designer-ui/src/main/webapp/WEB-INF/jetty-web.xml @@ -2,5 +2,5 @@ - / - \ No newline at end of file + /workflows + -- cgit 1.2.3-korg