diff --git a/client/modules/_common_components/src/datafiles/FileListingTable/FileListingTable.tsx b/client/modules/_common_components/src/datafiles/FileListingTable/FileListingTable.tsx index 155ba6c705..84bdf21c7c 100644 --- a/client/modules/_common_components/src/datafiles/FileListingTable/FileListingTable.tsx +++ b/client/modules/_common_components/src/datafiles/FileListingTable/FileListingTable.tsx @@ -25,6 +25,7 @@ export const FileListingTable: React.FC< disabled?: boolean; className?: string; emptyListingDisplay?: React.ReactNode; + noSelection?: boolean; searchTerm?: string | null; } & Omit > = ({ @@ -38,6 +39,7 @@ export const FileListingTable: React.FC< className, emptyListingDisplay, searchTerm = '', + noSelection, ...props }) => { const limit = 100; @@ -133,17 +135,21 @@ export const FileListingTable: React.FC< className={`${styles['listing-table-base']} ${ (combinedListing?.length ?? 0) > 0 ? 'table--pull-spinner-bottom' : '' } ${className ?? ''}`} - rowSelection={{ - type: 'checkbox', - onChange: onSelectionChange, - selectedRowKeys, - renderCell: (checked, _rc, _idx, node) => ( - - ), - }} + rowSelection={ + noSelection + ? undefined + : { + type: 'checkbox', + onChange: onSelectionChange, + selectedRowKeys, + renderCell: (checked, _rc, _idx, node) => ( + + ), + } + } scroll={{ y: '100%', x: '1000px' }} // set to undefined to disable sticky header columns={columns} rowKey={(record) => record.path} diff --git a/client/modules/_hooks/src/datafiles/usePathDisplayName.ts b/client/modules/_hooks/src/datafiles/usePathDisplayName.ts index ac549af853..1ef5bc39fb 100644 --- a/client/modules/_hooks/src/datafiles/usePathDisplayName.ts +++ b/client/modules/_hooks/src/datafiles/usePathDisplayName.ts @@ -12,7 +12,7 @@ export function getSystemRootDisplayName( return ( { 'designsafe.storage.default': 'My Data', - 'designsafe.storage.frontera.work': 'My Data (Work)', + 'designsafe.storage.frontera.work': 'HPC Work', 'designsafe.storage.community': 'Community Data', }[system] ?? label ); diff --git a/client/modules/datafiles/src/DatafilesModal/UploadFileModal/UploadFileModal.tsx b/client/modules/datafiles/src/DatafilesModal/UploadFileModal/UploadFileModal.tsx index 6a1f8ff586..f7d56b3cb3 100644 --- a/client/modules/datafiles/src/DatafilesModal/UploadFileModal/UploadFileModal.tsx +++ b/client/modules/datafiles/src/DatafilesModal/UploadFileModal/UploadFileModal.tsx @@ -16,7 +16,7 @@ export const UploadFileModalBody: React.FC<{ path: string; handleCancel: () => void; }> = ({ isOpen, api, system, scheme, path, handleCancel }) => { - const { mutate } = useUploadFile(); + const { mutateAsync } = useUploadFile(); const [fileList, setFileList] = useState([]); const [uploading, setUploading] = useState(false); @@ -36,7 +36,7 @@ export const UploadFileModalBody: React.FC<{ formData.append('file_name', fileList[i].name); formData.append('webkit_relative_path', ''); - await mutate({ + await mutateAsync({ api, system, scheme: 'private', // Optional @@ -47,6 +47,7 @@ export const UploadFileModalBody: React.FC<{ // All files uploaded successfully, close the modal setUploading(false); + setFileList([]); handleCancel(); } catch (error) { console.error('Error during form submission:', error); diff --git a/client/modules/datafiles/src/FileListing/FileListing.tsx b/client/modules/datafiles/src/FileListing/FileListing.tsx index 43a908298b..4936576cb4 100644 --- a/client/modules/datafiles/src/FileListing/FileListing.tsx +++ b/client/modules/datafiles/src/FileListing/FileListing.tsx @@ -28,6 +28,7 @@ export const FileListing: React.FC< scheme?: string; baseRoute?: string; fileTags?: TFileTag[]; + emptyListingDisplay?: React.ReactNode; } & Omit > = ({ api, @@ -36,6 +37,7 @@ export const FileListing: React.FC< scheme = 'private', baseRoute, fileTags, + emptyListingDisplay, ...tableProps }) => { // Base file listing for use with My Data/Community Data @@ -122,6 +124,7 @@ export const FileListing: React.FC< scheme={scheme} path={path} columns={columns} + emptyListingDisplay={emptyListingDisplay} {...tableProps} /> {previewModalState.path && previewModalState.selectedFile && ( diff --git a/client/modules/datafiles/src/projects/EmptyProjectFileListing.tsx b/client/modules/datafiles/src/projects/EmptyProjectFileListing.tsx new file mode 100644 index 0000000000..09bf0892d4 --- /dev/null +++ b/client/modules/datafiles/src/projects/EmptyProjectFileListing.tsx @@ -0,0 +1,24 @@ +import React from 'react'; + +export const EmptyProjectFileListing: React.FC = () => { + return ( +

+ This folder is empty!
+ +   + +
+ + +   + + Learn how to move files to a project + +

+ ); +}; diff --git a/client/modules/datafiles/src/projects/ProjectCurationFileListing/ProjectCurationFileListing.tsx b/client/modules/datafiles/src/projects/ProjectCurationFileListing/ProjectCurationFileListing.tsx index e9693ddf22..de9233a55c 100644 --- a/client/modules/datafiles/src/projects/ProjectCurationFileListing/ProjectCurationFileListing.tsx +++ b/client/modules/datafiles/src/projects/ProjectCurationFileListing/ProjectCurationFileListing.tsx @@ -27,6 +27,7 @@ import { } from '../constants'; import { DefaultOptionType } from 'antd/es/select'; import { FILE_TAG_OPTIONS } from './ProjectFileTagOptions'; +import { EmptyProjectFileListing } from '../EmptyProjectFileListing'; const FileTagInput: React.FC<{ projectId: string; @@ -354,6 +355,7 @@ export const ProjectCurationFileListing: React.FC<{ scheme="private" path={path} columns={columns} + emptyListingDisplay={} scroll={{ y: 500 }} /> {previewModalState.path && previewModalState.selectedFile && ( diff --git a/client/modules/datafiles/src/projects/ProjectPreview/ProjectPreview.tsx b/client/modules/datafiles/src/projects/ProjectPreview/ProjectPreview.tsx index edeba93cb9..db5e1ea049 100644 --- a/client/modules/datafiles/src/projects/ProjectPreview/ProjectPreview.tsx +++ b/client/modules/datafiles/src/projects/ProjectPreview/ProjectPreview.tsx @@ -67,7 +67,6 @@ const EntityFileListingTable: React.FC<{