Skip to content

Commit

Permalink
bug fix for shared workspace file operations not working
Browse files Browse the repository at this point in the history
  • Loading branch information
shayanaijaz committed Sep 13, 2023
1 parent 9a3bf2e commit c44e68d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,13 @@ describe('DataFilesCopyModal', () => {
expect(projectLink).toBeDefined();
expect(store.getActions()).toEqual([
{ type: 'GET_SYSTEM_MONITOR' },
{ type: 'PROJECTS_GET_LISTING', payload: { queryString: null } },
{ 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 } },
{ type: 'PROJECTS_GET_LISTING', payload: { queryString: null, modal: 'copy' } },
{
type: 'FETCH_FILES',
payload: {
Expand Down Expand Up @@ -113,7 +113,7 @@ describe('DataFilesCopyModal', () => {
{ type: 'GET_SYSTEM_MONITOR' },
{
type: 'PROJECTS_GET_LISTING',
payload: { queryString: null },
payload: { queryString: null, modal: 'copy' },
},
{
type: 'DATA_FILES_SET_MODAL_PROPS',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const DataFilesProjectsList = ({ modal }) => {
type: actionType,
payload: {
queryString: modal ? null : query.query_string,
modal,
},
});
}, [dispatch, query.query_string]);
Expand Down
8 changes: 5 additions & 3 deletions client/src/redux/sagas/projects.sagas.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ export async function fetchProjectsListing(queryString) {
}

export function* getProjectsListing(action) {
yield put({
type: 'DATA_FILES_CLEAR_FILE_SELECTION',
});
if (!action.payload?.modal) {
yield put({
type: 'DATA_FILES_CLEAR_FILE_SELECTION',
});
}
yield put({
type: 'PROJECTS_GET_LISTING_STARTED',
});
Expand Down

0 comments on commit c44e68d

Please sign in to comment.