[arvados] updated: 2.7.0-6293-gcaf20343bd

git repository hosting git at public.arvados.org
Mon May 13 19:25:17 UTC 2024


Summary of changes:
 .../store/workflow-panel/workflow-panel-actions.ts | 26 ++++++++++++++++++++++
 .../multiselect-toolbar/ms-workflow-action-set.ts  |  4 ++--
 .../workflow-remove-dialog.tsx}                    |  9 ++++----
 .../workbench2/src/views/workbench/workbench.tsx   |  2 ++
 4 files changed, 35 insertions(+), 6 deletions(-)
 copy services/workbench2/src/views-components/{process-remove-dialog/process-remove-dialog.tsx => workflow-remove-dialog/workflow-remove-dialog.tsx} (64%)

       via  caf20343bd8d7a9b065e1708dcd4e946224847ed (commit)
      from  7d618263d8e5a9d3649bed78fdf63682eea1ea90 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit caf20343bd8d7a9b065e1708dcd4e946224847ed
Author: Lisa Knox <lisaknox83 at gmail.com>
Date:   Mon May 13 15:25:12 2024 -0400

    21535: added wf delete dialog Arvados-DCO-1.1-Signed-off-by: Lisa Knox <lisa.knox at curii.com>

diff --git a/services/workbench2/src/store/workflow-panel/workflow-panel-actions.ts b/services/workbench2/src/store/workflow-panel/workflow-panel-actions.ts
index ef1f23ec1f..5079c01dd0 100644
--- a/services/workbench2/src/store/workflow-panel/workflow-panel-actions.ts
+++ b/services/workbench2/src/store/workflow-panel/workflow-panel-actions.ts
@@ -24,6 +24,8 @@ import { getResource } from 'store/resources/resources';
 import { ProjectResource } from 'models/project';
 import { UserResource } from 'models/user';
 import { getWorkflowInputs, parseWorkflowDefinition } from 'models/workflow';
+import { ContextMenuResource } from 'store/context-menu/context-menu-actions'; 
+import { dialogActions } from 'store/dialog/dialog-actions';
 
 export const WORKFLOW_PANEL_ID = "workflowPanel";
 const UUID_PREFIX_PROPERTY_NAME = 'uuidPrefix';
@@ -127,3 +129,27 @@ export const deleteWorkflow = (workflowUuid: string, ownerUuid?: string) =>
         await services.workflowService.delete(workflowUuid);
         dispatch(snackbarActions.OPEN_SNACKBAR({ message: 'Removed.', hideDuration: 2000, kind: SnackbarKind.SUCCESS }));
     };
+
+export const openRemoveWorkflowDialog =
+(resource: ContextMenuResource, numOfWorkflows: Number) => (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
+    const confirmationText =
+        numOfWorkflows === 1
+            ? "Are you sure you want to remove this workflow?"
+            : `Are you sure you want to remove these ${numOfWorkflows} workflows?`;
+    const titleText = numOfWorkflows === 1 ? "Remove workflow permanently" : "Remove workflows permanently";
+
+    dispatch(
+        dialogActions.OPEN_DIALOG({
+            id: REMOVE_WORKFLOW_DIALOG,
+            data: {
+                title: titleText,
+                text: confirmationText,
+                confirmButtonLabel: "Remove",
+                uuid: resource.uuid,
+                resource,
+            },
+        })
+    );
+};
+
+export const REMOVE_WORKFLOW_DIALOG = "removeWorkflowDialog";
\ No newline at end of file
diff --git a/services/workbench2/src/views-components/multiselect-toolbar/ms-workflow-action-set.ts b/services/workbench2/src/views-components/multiselect-toolbar/ms-workflow-action-set.ts
index e0f46bf6ee..945aea13f1 100644
--- a/services/workbench2/src/views-components/multiselect-toolbar/ms-workflow-action-set.ts
+++ b/services/workbench2/src/views-components/multiselect-toolbar/ms-workflow-action-set.ts
@@ -2,7 +2,7 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
-import { openRunProcess, deleteWorkflow } from 'store/workflow-panel/workflow-panel-actions';
+import { openRunProcess, openRemoveWorkflowDialog } from 'store/workflow-panel/workflow-panel-actions';
 import { StartIcon, DeleteForever, Link } from 'components/icon/icon';
 import { MultiSelectMenuAction, MultiSelectMenuActionSet, msCommonActionSet } from './ms-menu-actions';
 import { MultiSelectMenuActionNames } from "views-components/multiselect-toolbar/ms-menu-actions";
@@ -27,7 +27,7 @@ const msDeleteWorkflow: MultiSelectMenuAction = {
     isForMulti: true,
     execute: (dispatch, resources) => {
         for (const resource of [...resources]){
-            dispatch<any>(deleteWorkflow(resource.uuid));
+            dispatch<any>(openRemoveWorkflowDialog(resource, resources.length));
         }
     },
 };
diff --git a/services/workbench2/src/views-components/workflow-remove-dialog/workflow-remove-dialog.tsx b/services/workbench2/src/views-components/workflow-remove-dialog/workflow-remove-dialog.tsx
new file mode 100644
index 0000000000..7eb2f5e9e0
--- /dev/null
+++ b/services/workbench2/src/views-components/workflow-remove-dialog/workflow-remove-dialog.tsx
@@ -0,0 +1,22 @@
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+import { Dispatch, compose } from 'redux';
+import { connect } from "react-redux";
+import { ConfirmationDialog } from "components/confirmation-dialog/confirmation-dialog";
+import { withDialog, WithDialogProps } from "store/dialog/with-dialog";
+import { REMOVE_WORKFLOW_DIALOG } from 'store/workflow-panel/workflow-panel-actions';
+import { deleteWorkflow } from 'store/workflow-panel/workflow-panel-actions';
+
+const mapDispatchToProps = (dispatch: Dispatch, props: WithDialogProps<any>) => ({
+    onConfirm: () => {
+        props.closeDialog();
+        dispatch<any>(deleteWorkflow(props.data.uuid));
+    }
+});
+
+export const RemoveWorkflowDialog = compose(
+    withDialog(REMOVE_WORKFLOW_DIALOG),
+    connect(null, mapDispatchToProps)
+)(ConfirmationDialog);
diff --git a/services/workbench2/src/views/workbench/workbench.tsx b/services/workbench2/src/views/workbench/workbench.tsx
index 3020e0d298..3da00e492a 100644
--- a/services/workbench2/src/views/workbench/workbench.tsx
+++ b/services/workbench2/src/views/workbench/workbench.tsx
@@ -39,6 +39,7 @@ import { PartialMoveToNewCollectionDialog } from "views-components/dialog-forms/
 import { PartialMoveToExistingCollectionDialog } from "views-components/dialog-forms/partial-move-to-existing-collection-dialog";
 import { PartialMoveToSeparateCollectionsDialog } from "views-components/dialog-forms/partial-move-to-separate-collections-dialog";
 import { RemoveProcessDialog } from "views-components/process-remove-dialog/process-remove-dialog";
+import { RemoveWorkflowDialog } from "views-components/workflow-remove-dialog/workflow-remove-dialog";
 import { MainContentBar } from "views-components/main-content-bar/main-content-bar";
 import { Grid } from "@material-ui/core";
 import { TrashPanel } from "views/trash-panel/trash-panel";
@@ -435,6 +436,7 @@ const { classes, sidePanelIsCollapsed, isNotLinking, isTransitioning, isUserActi
             <RemoveKeepServiceDialog />
             <RemoveLinkDialog />
             <RemoveProcessDialog />
+            <RemoveWorkflowDialog />
             <RemoveRepositoryDialog />
             <RemoveSshKeyDialog />
             <RemoveVirtualMachineDialog />

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list