Skip to content

Commit

Permalink
[SelectModal] New features added - back button and first row (#1340)
Browse files Browse the repository at this point in the history
* [SelectModal] Back button and related features

* Fix lint error

* Disable selection for root if it is first row

* Update SelectModal.tsx

---------

Co-authored-by: Sal Tijerina <[email protected]>
  • Loading branch information
chandra-tacc and rstijerina authored Jul 11, 2024
1 parent 69a0f93 commit fcb43de
Show file tree
Hide file tree
Showing 2 changed files with 169 additions and 78 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export const FileListingTable: React.FC<
emptyListingDisplay?: React.ReactNode;
noSelection?: boolean;
searchTerm?: string | null;
currentDisplayPath?: TFileListing | undefined;
} & Omit<TableProps, 'columns' | 'className'>
> = ({
api,
Expand All @@ -40,6 +41,7 @@ export const FileListingTable: React.FC<
emptyListingDisplay,
searchTerm = '',
noSelection,
currentDisplayPath = null,
...props
}) => {
const limit = 100;
Expand Down Expand Up @@ -71,8 +73,12 @@ export const FileListingTable: React.FC<
if (filterFn) {
return filterFn(cl);
}
if (currentDisplayPath) {
return [currentDisplayPath, ...cl];
}

return cl;
}, [data, filterFn]);
}, [data, filterFn, currentDisplayPath]);

/* HANDLE FILE SELECTION */
const { selectedFiles, setSelectedFiles } = useSelectedFiles(
Expand Down
Loading

0 comments on commit fcb43de

Please sign in to comment.