WF- archive warning before deleting 97/74197/1
authorYarin Dekel <yarind@amdocs.com>
Tue, 4 Dec 2018 15:48:38 +0000 (17:48 +0200)
committerYarin Dekel <yarind@amdocs.com>
Tue, 4 Dec 2018 15:48:56 +0000 (17:48 +0200)
Issue-ID: SDC-1981
Change-Id: I3c00021c25847a68a0d603db87173da7cb190d43
Signed-off-by: Yarin Dekel <yarind@amdocs.com>
workflow-designer-ui/src/main/frontend/src/features/workflow/overview/Overview.js
workflow-designer-ui/src/main/frontend/src/features/workflow/overview/OverviewView.jsx
workflow-designer-ui/src/main/frontend/src/i18n/languages.json

index 993879a..90b6976 100644 (file)
@@ -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))
     };
 }
index 0b88a84..9cc1e73 100644 (file)
@@ -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;
index d978e61..b4cff9c 100644 (file)
@@ -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",