From fc1b439665e420fefe724b426a00a04ec6f9d176 Mon Sep 17 00:00:00 2001 From: Terry Sutton Date: Fri, 14 Feb 2025 07:07:36 -0330 Subject: [PATCH] what on earth (#33598) * what on earth * Maybe --- .../Storage/StorageExplorer/FileExplorer.tsx | 2 +- .../StorageExplorer/FileExplorerColumn.tsx | 215 +++++++++--------- 2 files changed, 110 insertions(+), 107 deletions(-) diff --git a/apps/studio/components/to-be-cleaned/Storage/StorageExplorer/FileExplorer.tsx b/apps/studio/components/to-be-cleaned/Storage/StorageExplorer/FileExplorer.tsx index fde79b07903..a99314b9b69 100644 --- a/apps/studio/components/to-be-cleaned/Storage/StorageExplorer/FileExplorer.tsx +++ b/apps/studio/components/to-be-cleaned/Storage/StorageExplorer/FileExplorer.tsx @@ -46,7 +46,7 @@ const FileExplorer = ({ return (
diff --git a/apps/studio/components/to-be-cleaned/Storage/StorageExplorer/FileExplorerColumn.tsx b/apps/studio/components/to-be-cleaned/Storage/StorageExplorer/FileExplorerColumn.tsx index 45f095e15ed..3bb49eb2f85 100644 --- a/apps/studio/components/to-be-cleaned/Storage/StorageExplorer/FileExplorerColumn.tsx +++ b/apps/studio/components/to-be-cleaned/Storage/StorageExplorer/FileExplorerColumn.tsx @@ -142,134 +142,137 @@ const FileExplorerColumn = ({ ) return ( -
+
{ - const eventTarget = get(event.target, ['className'], '') - if (typeof eventTarget === 'string' && eventTarget.includes('react-contexify')) return - onSelectColumnEmptySpace(index) - }} - > - {/* Checkbox selection for select all */} - {view === STORAGE_VIEWS.COLUMNS && ( -
event.stopPropagation()} - > - {columnFiles.length > 0 ? ( - <> - -

Select all {columnFiles.length} files

- - ) : ( -

No files available for selection

- )} -
- )} + onContextMenu={displayMenu} + onDragOver={onDragOver} + onDrop={onDrop} + onClick={(event) => { + const eventTarget = get(event.target, ['className'], '') + if (typeof eventTarget === 'string' && eventTarget.includes('react-contexify')) return + onSelectColumnEmptySpace(index) + }} + > + {/* Checkbox selection for select all */} + {view === STORAGE_VIEWS.COLUMNS && ( +
event.stopPropagation()} + > + {columnFiles.length > 0 ? ( + <> + +

+ Select all {columnFiles.length} files +

+ + ) : ( +

No files available for selection

+ )} +
+ )} - {/* List Interface Header */} - {view === STORAGE_VIEWS.LIST && ( -
-
- -

Name

+ > +
+ +

Name

+
+

Size

+

Type

+

Created at

+

Last modified at

-

Size

-

Type

-

Created at

-

Last modified at

-
- )} + )} - {/* Shimmering loaders while fetching contents */} - {column.status === STORAGE_ROW_STATUS.LOADING && ( -
- - - -
- )} - - {/* Column Interface */} - (index !== 0 && index === columnItems.length ? 85 : 37)} - hasNextPage={column.status !== STORAGE_ROW_STATUS.LOADING && column.hasMoreItems} - isLoadingNextPage={column.isLoadingMoreItems} - onLoadNextPage={() => onColumnLoadMore(index, column)} - /> - - {/* Drag drop upload CTA for when column is empty */} - {!(snap.isSearching && itemSearchString.length > 0) && - column.items.length === 0 && - column.status !== STORAGE_ROW_STATUS.LOADING && ( -
- storage-placeholder -

Drop your files here

-

- Or upload them via the "Upload file" button above -

+ > + + +
)} - {snap.isSearching && - itemSearchString.length > 0 && - isEmpty && - column.status !== STORAGE_ROW_STATUS.LOADING && ( -
-

No results found in this folder

-

- Your search for "{itemSearchString}" did not return any results -

-
- )} + {/* Column Interface */} + (index !== 0 && index === columnItems.length ? 85 : 37)} + hasNextPage={column.status !== STORAGE_ROW_STATUS.LOADING && column.hasMoreItems} + isLoadingNextPage={column.isLoadingMoreItems} + onLoadNextPage={() => onColumnLoadMore(index, column)} + /> - {/* Drag drop upload CTA for when column has files */} - setIsDraggedOver(false)} - onDrop={() => setIsDraggedOver(false)} - /> + {/* Drag drop upload CTA for when column is empty */} + {!(snap.isSearching && itemSearchString.length > 0) && + column.items.length === 0 && + column.status !== STORAGE_ROW_STATUS.LOADING && ( +
+ storage-placeholder +

Drop your files here

+

+ Or upload them via the "Upload file" button above +

+
+ )} + {snap.isSearching && + itemSearchString.length > 0 && + isEmpty && + column.status !== STORAGE_ROW_STATUS.LOADING && ( +
+

No results found in this folder

+

+ Your search for "{itemSearchString}" did not return any results +

+
+ )} + + {/* Drag drop upload CTA for when column has files */} + setIsDraggedOver(false)} + onDrop={() => setIsDraggedOver(false)} + /> +
{/* List interface footer */} {view === STORAGE_VIEWS.LIST && (

@@ -277,7 +280,7 @@ const FileExplorerColumn = ({

)} -
+ ) }