[arvados-workbench2] updated: 2.6.0-83-g37be20bf
git repository hosting
git at public.arvados.org
Tue Sep 5 16:56:21 UTC 2023
Summary of changes:
src/store/processes/processes-actions.ts | 13 ++++++++++---
.../context-menu/action-sets/process-resource-action-set.ts | 2 +-
src/views-components/context-menu/context-menu.tsx | 1 -
3 files changed, 11 insertions(+), 5 deletions(-)
via 37be20bf76bba0f6dc6fd40f0fcc3d012c6b7e49 (commit)
from 9e16e70e7f9bc9fd0e0a52eca9a9c37a45ef3639 (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 37be20bf76bba0f6dc6fd40f0fcc3d012c6b7e49
Author: Lisa Knox <lisaknox83 at gmail.com>
Date: Tue Sep 5 12:56:17 2023 -0400
15768: fixed delete multi process bug Arvados-DCO-1.1-Signed-off-by: Lisa Knox <lisa.knox at curii.com>
diff --git a/src/store/processes/processes-actions.ts b/src/store/processes/processes-actions.ts
index 18d95911..ed951525 100644
--- a/src/store/processes/processes-actions.ts
+++ b/src/store/processes/processes-actions.ts
@@ -26,6 +26,7 @@ import { ContainerRequestResource, ContainerRequestState } from "models/containe
import { FilterBuilder } from "services/api/filter-builder";
import { selectedToArray } from "components/multiselect-toolbar/MultiselectToolbar";
import { Resource, ResourceKind } from "models/resource";
+import { ContextMenuResource } from "store/context-menu/context-menu-actions";
export const loadProcess =
(containerRequestUuid: string) =>
@@ -286,7 +287,7 @@ export const getOutputParameters = (data: any): CommandOutputParameter[] => {
};
export const openRemoveProcessDialog =
- (uuid: string, numOfProcesses: Number) => (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
+ (resource: ContextMenuResource, numOfProcesses: Number) => (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
const confirmationText =
numOfProcesses === 1
? "Are you sure you want to remove this process?"
@@ -300,7 +301,8 @@ export const openRemoveProcessDialog =
title: titleText,
text: confirmationText,
confirmButtonLabel: "Remove",
- uuid,
+ uuid: resource.uuid,
+ resource,
},
})
);
@@ -309,8 +311,13 @@ export const openRemoveProcessDialog =
export const REMOVE_PROCESS_DIALOG = "removeProcessDialog";
export const removeProcessPermanently = (uuid: string) => async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
+ const resource = getState().dialog.removeProcessDialog.data.resource;
const checkedList = getState().multiselect.checkedList;
- const uuidsToRemove: string[] = selectedToArray(checkedList);
+
+ const uuidsToRemove: string[] = resource.isSingle ? [resource.uuid] : selectedToArray(checkedList);
+
+ //if no items in checkedlist && no items passed in, default to normal context menu behavior
+ if (!uuidsToRemove.length) uuidsToRemove.push(uuid);
const processesToRemove = uuidsToRemove
.map(uuid => getResource(uuid)(getState().resources) as Resource)
diff --git a/src/views-components/context-menu/action-sets/process-resource-action-set.ts b/src/views-components/context-menu/action-sets/process-resource-action-set.ts
index b4674951..aceebe06 100644
--- a/src/views-components/context-menu/action-sets/process-resource-action-set.ts
+++ b/src/views-components/context-menu/action-sets/process-resource-action-set.ts
@@ -112,7 +112,7 @@ export const processResourceActionSet: ContextMenuActionSet = [
name: "Remove",
icon: RemoveIcon,
execute: (dispatch, resources) => {
- dispatch<any>(openRemoveProcessDialog(resources[0].uuid, resources.length));
+ dispatch<any>(openRemoveProcessDialog(resources[0], resources.length));
},
},
],
diff --git a/src/views-components/context-menu/context-menu.tsx b/src/views-components/context-menu/context-menu.tsx
index 8f8e8232..e7bfff9e 100644
--- a/src/views-components/context-menu/context-menu.tsx
+++ b/src/views-components/context-menu/context-menu.tsx
@@ -52,7 +52,6 @@ const mapDispatchToProps = (dispatch: Dispatch): ActionProps => ({
const handleItemClick = memoize(
(resource: DataProps["resource"], onItemClick: ActionProps["onItemClick"]): ContextMenuProps["onItemClick"] =>
item => {
- console.log("clisky");
onItemClick(item, { ...resource, isSingle: true } as ContextMenuResource);
}
);
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list