diff options
author | 2018-12-04 17:48:38 +0200 | |
---|---|---|
committer | 2018-12-04 17:48:56 +0200 | |
commit | 5cfa9862878b155ce47c859ba04c13010b8e6626 (patch) | |
tree | 7390c1886c75e0f408c56fd0337ef61324fdc3fa /workflow-designer-ui/src/main/frontend | |
parent | 776a358ad9cf412ae5fab020a3483ccd37cb9f5c (diff) |
WF- archive warning before deleting
Issue-ID: SDC-1981
Change-Id: I3c00021c25847a68a0d603db87173da7cb190d43
Signed-off-by: Yarin Dekel <yarind@amdocs.com>
Diffstat (limited to 'workflow-designer-ui/src/main/frontend')
3 files changed, 27 insertions, 4 deletions
diff --git a/workflow-designer-ui/src/main/frontend/src/features/workflow/overview/Overview.js b/workflow-designer-ui/src/main/frontend/src/features/workflow/overview/Overview.js index 993879a4..90b69763 100644 --- a/workflow-designer-ui/src/main/frontend/src/features/workflow/overview/Overview.js +++ b/workflow-designer-ui/src/main/frontend/src/features/workflow/overview/Overview.js @@ -14,6 +14,8 @@ * limitations under the License. */ import { connect } from 'react-redux'; +import { I18n } from 'react-redux-i18n'; + import OverviewView from 'features/workflow/overview/OverviewView'; import { getSortedVersions, @@ -29,7 +31,11 @@ import { restoreWorkflowAction } from 'features/workflow/overview/overviewConstansts'; import { NEW_VERSION_MODAL } from 'shared/modal/modalWrapperComponents'; -import { showCustomModalAction } from 'shared/modal/modalWrapperActions'; +import { + showCustomModalAction, + showAlertModalAction, + hideModalAction +} from 'shared/modal/modalWrapperActions'; import { inputChangeAction } from 'features/workflow/create/createWorkflowConstants'; function mapStateToProps(state) { @@ -54,7 +60,22 @@ function mapDispatchToProps(dispatch) { ), workflowInputChange: payload => dispatch(inputChangeAction(payload)), updateWorkflow: payload => dispatch(updateWorkflowAction(payload)), - archiveWorkflow: payload => dispatch(archiveWorkflowAction(payload)), + archiveWorkflow: payload => { + dispatch( + showAlertModalAction({ + title: I18n.t('workflow.overview.archive'), + body: I18n.t('workflow.overview.confirmArchive', { + name: payload.name + }), + withButtons: true, + actionButtonText: I18n.t('workflow.overview.archive'), + actionButtonClick: () => { + dispatch(archiveWorkflowAction(payload)); + dispatch(hideModalAction()); + } + }) + ); + }, restoreWorkflow: payload => dispatch(restoreWorkflowAction(payload)) }; } 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 0b88a846..9cc1e737 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 @@ -76,7 +76,7 @@ class OverviewView extends Component { onArchiveWorkflow = () => { const { archiveWorkflow, workflow, history } = this.props; - archiveWorkflow({ id: workflow.id, history }); + archiveWorkflow({ id: workflow.id, name: workflow.name, history }); }; onRestoreWorkflow = () => { const { restoreWorkflow, workflow, history } = this.props; 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 d978e61b..b4cff9c0 100644 --- a/workflow-designer-ui/src/main/frontend/src/i18n/languages.json +++ b/workflow-designer-ui/src/main/frontend/src/i18n/languages.json @@ -49,7 +49,9 @@ "title": "Overview", "lastEdited": "Last Edited On", "backBtnLabel": "WORKFLOW CATALOG", - "archived": "Archived" + "archived": "Archived", + "archive": "ARCHIVE", + "confirmArchive": "Are you sure you want to delete \"%{name}\"?" }, "inputOutput": { "name": "Name", |