aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYarin Dekel <yarind@amdocs.com>2018-12-06 10:58:36 +0200
committerYarin Dekel <yarind@amdocs.com>2018-12-06 11:00:44 +0200
commitc752c10da0690d028eb988493eff8c44e0f803fb (patch)
treef376caef5c49dbdf1e043036cd7573b7ff37c6ec
parent102f00d76ea26c5d449b9993269151bc8bb53a6c (diff)
WF- get workflow after restoring workflow
Issue-ID: SDC-1985 Change-Id: I22a9806c1bae86e6a27c2ddbf372b36a9bd278e8 Signed-off-by: Yarin Dekel <yarind@amdocs.com>
-rw-r--r--workflow-designer-ui/src/main/frontend/src/features/workflow/overview/overviewSagas.js26
-rw-r--r--workflow-designer-ui/src/main/frontend/src/i18n/languages.json2
2 files changed, 20 insertions, 8 deletions
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 f2b4cf17..89684d44 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
@@ -19,6 +19,7 @@ import { genericNetworkErrorAction } from 'wfapp/appConstants';
import overviewApi from 'features/workflow/overview/overviewApi';
import {
versionListFetchAction,
+ getVersionsAction,
GET_OVERVIEW,
UPDATE_WORKFLOW,
ARCHIVE_WORKFLOW,
@@ -29,11 +30,11 @@ import { notificationActions } from 'shared/notifications/notificationsActions';
import { fetchWorkflow } from 'features/catalog/catalogActions';
import { WORKFLOW_STATUS } from 'features/workflow/workflowConstants';
-export function* getOverview(action) {
+export function* getOverview({ payload }) {
try {
- const versions = yield call(overviewApi.getVersions, action.payload);
+ const versions = yield call(overviewApi.getVersions, payload);
yield put(versionListFetchAction(versions));
- const workflow = yield call(overviewApi.getWorkflow, action.payload);
+ const workflow = yield call(overviewApi.getWorkflow, payload);
yield put(setWorkflowAction(workflow));
} catch (error) {
yield put(genericNetworkErrorAction(error));
@@ -56,7 +57,7 @@ export function* updateWorkflow(action) {
export function* archiveRestoreWorkflow(action) {
try {
- const { history, ...data } = action.payload;
+ const { ...data } = action.payload;
yield call(overviewApi.archiveRestoreWorkflow, data);
const {
catalog: { sort },
@@ -70,15 +71,26 @@ export function* archiveRestoreWorkflow(action) {
status: WORKFLOW_STATUS.ACTIVE
})
);
- history.push('/');
} catch (e) {
yield put(genericNetworkErrorAction(e));
}
}
+export function* restoreWorkflow(action) {
+ const { id } = action.payload;
+ yield archiveRestoreWorkflow(action);
+ yield put(getVersionsAction(id));
+}
+
+export function* archiveWorkflow(action) {
+ const { history } = action.payload;
+ yield archiveRestoreWorkflow(action);
+ history.push('/');
+}
+
export function* watchOverview() {
yield takeEvery(GET_OVERVIEW, getOverview);
yield takeEvery(UPDATE_WORKFLOW, updateWorkflow);
- yield takeEvery(ARCHIVE_WORKFLOW, archiveRestoreWorkflow);
- yield takeEvery(RESTORE_WORKFLOW, archiveRestoreWorkflow);
+ yield takeEvery(ARCHIVE_WORKFLOW, archiveWorkflow);
+ yield takeEvery(RESTORE_WORKFLOW, restoreWorkflow);
}
diff --git a/workflow-designer-ui/src/main/frontend/src/i18n/languages.json b/workflow-designer-ui/src/main/frontend/src/i18n/languages.json
index b4cff9c0..c52a3839 100644
--- a/workflow-designer-ui/src/main/frontend/src/i18n/languages.json
+++ b/workflow-designer-ui/src/main/frontend/src/i18n/languages.json
@@ -51,7 +51,7 @@
"backBtnLabel": "WORKFLOW CATALOG",
"archived": "Archived",
"archive": "ARCHIVE",
- "confirmArchive": "Are you sure you want to delete \"%{name}\"?"
+ "confirmArchive": "Are you sure you want to archive \"%{name}\"?"
},
"inputOutput": {
"name": "Name",