From 401e3b5a6339e8f8a1d8edacdca86b98cfaeda4e Mon Sep 17 00:00:00 2001 From: Lucas Di Pentima Date: Tue, 14 Dec 2021 17:05:37 -0300 Subject: [PATCH] 18584: Fixes collections partial copy action code. These features (copy selected into collection, and create a new collection with selected) aren't working as expected. There's a separate ticket to address them. Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima --- src/store/collections/collection-partial-copy-actions.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/store/collections/collection-partial-copy-actions.ts b/src/store/collections/collection-partial-copy-actions.ts index d898c500..8c4cb379 100644 --- a/src/store/collections/collection-partial-copy-actions.ts +++ b/src/store/collections/collection-partial-copy-actions.ts @@ -52,13 +52,13 @@ export const copyCollectionPartial = ({ name, description, projectUuid }: Collec if (currentCollection) { try { dispatch(progressIndicatorActions.START_WORKING(COLLECTION_PARTIAL_COPY_FORM_NAME)); - const collection = await services.collectionService.get(currentCollection.uuid); + const collectionManifestText = await services.collectionService.get(currentCollection.uuid, undefined, ['manifestText']); const collectionCopy = { name, description, ownerUuid: projectUuid, uuid: undefined, - manifestText: collection.manifestText, + manifestText: collectionManifestText.manifestText, }; const newCollection = await services.collectionService.create(collectionCopy); const copiedFiles = await services.collectionService.files(newCollection.uuid); @@ -135,7 +135,7 @@ export const copyCollectionPartialToSelectedCollection = ({ collectionUuid }: Co }); const diffPathToRemove = difference(paths, pathsToRemove); await services.collectionService.deleteFiles(selectedCollection.uuid, pathsToRemove.map(path => path.replace(currentCollection.uuid, collectionUuid))); - const collectionWithDeletedFiles = await services.collectionService.get(collectionUuid); + const collectionWithDeletedFiles = await services.collectionService.get(collectionUuid, undefined, ['uuid', 'manifestText']); await services.collectionService.update(collectionUuid, { manifestText: `${collectionWithDeletedFiles.manifestText}${(currentCollection.manifestText ? currentCollection.manifestText : currentCollection.unsignedManifestText) || ''}` }); await services.collectionService.deleteFiles(collectionWithDeletedFiles.uuid, diffPathToRemove.map(path => path.replace(currentCollection.uuid, collectionUuid))); dispatch(dialogActions.CLOSE_DIALOG({ id: COLLECTION_PARTIAL_COPY_TO_SELECTED_COLLECTION })); -- 2.30.2