From e6e51406134e71d493f5258917915136709bcda2 Mon Sep 17 00:00:00 2001 From: Lisa Knox Date: Fri, 8 Sep 2023 10:21:49 -0400 Subject: [PATCH] 15768: made new dialog for multi-copy Arvados-DCO-1.1-Signed-off-by: Lisa Knox --- src/store/collections/collection-copy-actions.ts | 5 +---- src/store/workbench/workbench-actions.ts | 2 +- .../context-menu/action-sets/collection-action-set.ts | 3 --- src/views-components/dialog-copy/dialog-copy.tsx | 4 ---- src/views-components/dialog-forms/copy-collection-dialog.ts | 2 -- 5 files changed, 2 insertions(+), 14 deletions(-) diff --git a/src/store/collections/collection-copy-actions.ts b/src/store/collections/collection-copy-actions.ts index a482b9a79c..d4e647f862 100644 --- a/src/store/collections/collection-copy-actions.ts +++ b/src/store/collections/collection-copy-actions.ts @@ -19,7 +19,6 @@ export const COLLECTION_COPY_FORM_NAME = "collectionCopyFormName"; export const COLLECTION_MULTI_COPY_FORM_NAME = "collectionMultiCopyFormName"; export const openCollectionCopyDialog = (resource: { name: string; uuid: string; isSingle?: boolean }) => (dispatch: Dispatch) => { - //here dispatch(resetPickerProjectTree()); dispatch(initProjectsTreePicker(COLLECTION_COPY_FORM_NAME)); const initialData: CopyFormDialogData = { name: `Copy of: ${resource.name}`, ownerUuid: "", uuid: resource.uuid, isSingle: resource.isSingle }; @@ -28,7 +27,6 @@ export const openCollectionCopyDialog = (resource: { name: string; uuid: string; }; export const openMultiCollectionCopyDialog = (resource: { name: string; uuid: string; isSingle?: boolean }) => (dispatch: Dispatch) => { - //here dispatch(resetPickerProjectTree()); dispatch(initProjectsTreePicker(COLLECTION_MULTI_COPY_FORM_NAME)); const initialData: CopyFormDialogData = { name: `Copy of: ${resource.name}`, ownerUuid: "", uuid: resource.uuid, isSingle: resource.isSingle }; @@ -38,9 +36,8 @@ export const openMultiCollectionCopyDialog = (resource: { name: string; uuid: st export const copyCollection = (resource: CopyFormDialogData) => async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => { - console.log("IN COPY COLLECTION", resource); const formName = resource.isSingle ? COLLECTION_COPY_FORM_NAME : COLLECTION_MULTI_COPY_FORM_NAME; - dispatch(startSubmit(COLLECTION_COPY_FORM_NAME)); + dispatch(startSubmit(formName)); let collection = getResource(resource.uuid)(getState().resources); try { if (!collection) { diff --git a/src/store/workbench/workbench-actions.ts b/src/store/workbench/workbench-actions.ts index 71fdc6aa88..d65f26d5bf 100644 --- a/src/store/workbench/workbench-actions.ts +++ b/src/store/workbench/workbench-actions.ts @@ -437,7 +437,7 @@ export const copyCollection = (data: CopyFormDialogData) => async (dispatch: Dis .filter(resource => resource.kind === ResourceKind.COLLECTION); for (const collection of collectionsToCopy) { - await copySingleCollection(collection as CollectionCopyResource); + await copySingleCollection({ ...collection, ownerUuid: data.ownerUuid } as CollectionCopyResource); } async function copySingleCollection(copyToProject: CollectionCopyResource) { diff --git a/src/views-components/context-menu/action-sets/collection-action-set.ts b/src/views-components/context-menu/action-sets/collection-action-set.ts index b63497f20f..c63144e8b9 100644 --- a/src/views-components/context-menu/action-sets/collection-action-set.ts +++ b/src/views-components/context-menu/action-sets/collection-action-set.ts @@ -66,8 +66,6 @@ const commonActionSet: ContextMenuActionSet = [ icon: CopyIcon, name: "Make a copy", execute: (dispatch, resources) => { - console.log(resources[0]); - //here fix single vs one if (resources[0].isSingle) dispatch(openCollectionCopyDialog(resources[0])); else dispatch(openMultiCollectionCopyDialog(resources[0])); }, @@ -129,7 +127,6 @@ export const collectionActionSet: ContextMenuActionSet = [ component: ToggleTrashAction, name: "ToggleTrashAction", execute: (dispatch, resources: ContextMenuResource[]) => { - //here fix multi? resources.forEach(resource => dispatch(toggleCollectionTrashed(resource.uuid, resource.isTrashed!!))); }, }, diff --git a/src/views-components/dialog-copy/dialog-copy.tsx b/src/views-components/dialog-copy/dialog-copy.tsx index e7e7836e87..8e37ac3216 100644 --- a/src/views-components/dialog-copy/dialog-copy.tsx +++ b/src/views-components/dialog-copy/dialog-copy.tsx @@ -16,8 +16,6 @@ import { PickerIdProp } from "store/tree-picker/picker-id"; type CopyFormDialogProps = WithDialogProps & InjectedFormProps; export const DialogCopy = (props: CopyFormDialogProps & PickerIdProp) => { - console.log("single dialog copy", props); - return ( () => ( )); export const DialogMultiCopy = (props: CopyFormDialogProps & PickerIdProp) => { - console.log("multi dialog copy", props); - return ( { - console.log("DATA main", data); dispatch(copyCollection(data)); }, }), @@ -30,7 +29,6 @@ export const CopyMultiCollectionDialog = compose( form: COLLECTION_MULTI_COPY_FORM_NAME, touchOnChange: true, onSubmit: (data, dispatch) => { - console.log("DATA main", data); dispatch(copyCollection(data)); }, }), -- 2.30.2