diff options
Diffstat (limited to 'workflow-designer-ui')
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", |