diff --git a/client/modules/_hooks/src/systems/types.ts b/client/modules/_hooks/src/systems/types.ts index ceccafba2b..742588cfd0 100644 --- a/client/modules/_hooks/src/systems/types.ts +++ b/client/modules/_hooks/src/systems/types.ts @@ -61,6 +61,7 @@ export type TTapisSystem = { label?: string; keyservice?: boolean; isMyData?: boolean; + portalNames: string[]; }; importRefId?: string; uuid: string; diff --git a/client/modules/workspace/src/SelectModal/SelectModal.tsx b/client/modules/workspace/src/SelectModal/SelectModal.tsx index e0c4e149f0..6180b8584b 100644 --- a/client/modules/workspace/src/SelectModal/SelectModal.tsx +++ b/client/modules/workspace/src/SelectModal/SelectModal.tsx @@ -21,6 +21,7 @@ type TModalChildren = (props: { }) => React.ReactElement; const api = 'tapis'; +const portalName = 'DesignSafe'; const HeaderTitle: React.FC<{ api: string; system: string; @@ -109,15 +110,20 @@ export const SelectModal: React.FC<{ const { data: { storageSystems, defaultStorageSystem }, } = useGetSystems(); - // only pick up enabled systems with label + // only pick up enabled systems in this portal const includedSystems = storageSystems.filter( - (s) => s.enabled && s.notes?.label + (s) => s.enabled && s.notes?.portalNames?.includes(portalName) ); - const systemOptions = includedSystems.map((system) => ({ - label: system.notes.label, - value: system.id, - })); + // Sort - so mydata is shown first. + const systemOptions = includedSystems + .sort((a, b) => { + return (a.notes?.isMyData ? 0 : 1) - (b.notes?.isMyData ? 0 : 1); + }) + .map((system) => ({ + label: system.notes.label, + value: system.id, + })); systemOptions.push({ label: 'My Projects', value: 'myprojects' }); const defaultParams = useMemo(