From 96d3533a1011048ab55f9819411496ac58d0d638 Mon Sep 17 00:00:00 2001 From: shayanaijaz Date: Wed, 13 Sep 2023 11:53:09 -0500 Subject: [PATCH] misc fixes --- .../DataFiles/DataFilesModals/DataFilesCopyModal.jsx | 2 +- .../DataFilesModalListingTable.jsx | 2 +- .../DataFilesModals/tests/DataFilesCopyModal.test.js | 10 ++++++++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/client/src/components/DataFiles/DataFilesModals/DataFilesCopyModal.jsx b/client/src/components/DataFiles/DataFilesModals/DataFilesCopyModal.jsx index 4ed064e41..bebffdf3f 100644 --- a/client/src/components/DataFiles/DataFilesModals/DataFilesCopyModal.jsx +++ b/client/src/components/DataFiles/DataFilesModals/DataFilesCopyModal.jsx @@ -81,7 +81,7 @@ const DataFilesCopyModal = React.memo(() => { srcApi: params.api, destApi: modalParams.api, destSystem: system, - destPath: path, + destPath: path || '/', name, callback: reloadPage, }); diff --git a/client/src/components/DataFiles/DataFilesModals/DataFilesModalTables/DataFilesModalListingTable.jsx b/client/src/components/DataFiles/DataFilesModals/DataFilesModalTables/DataFilesModalListingTable.jsx index 4bcce8821..93f318597 100644 --- a/client/src/components/DataFiles/DataFilesModals/DataFilesModalTables/DataFilesModalListingTable.jsx +++ b/client/src/components/DataFiles/DataFilesModals/DataFilesModalTables/DataFilesModalListingTable.jsx @@ -112,7 +112,7 @@ const DataFilesModalButtonCell = ({ operationOnlyForFolders, disabled, }) => { - const onClick = () => operationCallback(system, path || '/', name); + const onClick = () => operationCallback(system, path, name); const formatSupportsOperation = !operationOnlyForFolders || format === 'folder'; return ( diff --git a/client/src/components/DataFiles/DataFilesModals/tests/DataFilesCopyModal.test.js b/client/src/components/DataFiles/DataFilesModals/tests/DataFilesCopyModal.test.js index 63faaadc4..e7bc52bee 100644 --- a/client/src/components/DataFiles/DataFilesModals/tests/DataFilesCopyModal.test.js +++ b/client/src/components/DataFiles/DataFilesModals/tests/DataFilesCopyModal.test.js @@ -69,13 +69,19 @@ describe('DataFilesCopyModal', () => { expect(projectLink).toBeDefined(); expect(store.getActions()).toEqual([ { type: 'GET_SYSTEM_MONITOR' }, - { type: 'PROJECTS_GET_LISTING', payload: { queryString: null, modal: 'copy' } }, + { + type: 'PROJECTS_GET_LISTING', + payload: { queryString: null, modal: 'copy' }, + }, ]); fireEvent.click(projectLink); expect(store.getActions()).toEqual([ { type: 'GET_SYSTEM_MONITOR' }, - { type: 'PROJECTS_GET_LISTING', payload: { queryString: null, modal: 'copy' } }, + { + type: 'PROJECTS_GET_LISTING', + payload: { queryString: null, modal: 'copy' }, + }, { type: 'FETCH_FILES', payload: {