15768: made new dialog for multi-copy Arvados-DCO-1.1-Signed-off-by: Lisa Knox <lisa...
authorLisa Knox <lisaknox83@gmail.com>
Fri, 8 Sep 2023 14:21:49 +0000 (10:21 -0400)
committerLisa Knox <lisaknox83@gmail.com>
Fri, 8 Sep 2023 14:21:49 +0000 (10:21 -0400)
src/store/collections/collection-copy-actions.ts
src/store/workbench/workbench-actions.ts
src/views-components/context-menu/action-sets/collection-action-set.ts
src/views-components/dialog-copy/dialog-copy.tsx
src/views-components/dialog-forms/copy-collection-dialog.ts

index a482b9a79c483acc7b62d2831bf7d782eab738c7..d4e647f86219af4f6e03c730f2817660a6b8c75b 100644 (file)
@@ -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<any>(resetPickerProjectTree());
     dispatch<any>(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<any>(resetPickerProjectTree());
     dispatch<any>(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<CollectionResource>(resource.uuid)(getState().resources);
         try {
             if (!collection) {
index 71fdc6aa88075146cbbb79683d999232efce55b7..d65f26d5bfe10decbdd9f480a0ff6d21e8b2751e 100644 (file)
@@ -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) {
index b63497f20f067b52a7884ec1fe77271a4aab87e9..c63144e8b96316c6ade88855fcf7d2d36b80c354 100644 (file)
@@ -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<any>(openCollectionCopyDialog(resources[0]));
                 else dispatch<any>(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<any>(toggleCollectionTrashed(resource.uuid, resource.isTrashed!!)));
             },
         },
index e7e7836e87ba6e1dcf63851bb99d1d82125f3fd9..8e37ac3216bbb98a629db05343ff027ab243e5fa 100644 (file)
@@ -16,8 +16,6 @@ import { PickerIdProp } from "store/tree-picker/picker-id";
 type CopyFormDialogProps = WithDialogProps<string> & InjectedFormProps<CopyFormDialogData>;
 
 export const DialogCopy = (props: CopyFormDialogProps & PickerIdProp) => {
-    console.log("single dialog copy", props);
-
     return (
         <FormDialog
             dialogTitle="Make a copy"
@@ -46,8 +44,6 @@ const CopyDialogFields = memoize((pickerId: string) => () => (
 ));
 
 export const DialogMultiCopy = (props: CopyFormDialogProps & PickerIdProp) => {
-    console.log("multi dialog copy", props);
-
     return (
         <FormDialog
             dialogTitle="Make a copy"
index 5d0ff29fc3232d29044302ea710a5b794238b1f4..220b5a2c4d6d97a743c8ffd11fcfe05029f74e6f 100644 (file)
@@ -17,7 +17,6 @@ export const CopyCollectionDialog = compose(
         form: COLLECTION_COPY_FORM_NAME,
         touchOnChange: true,
         onSubmit: (data, dispatch) => {
-            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));
         },
     }),