From e95ffa1bea05dfd85f51e92d0e1de2dbba49ffbe Mon Sep 17 00:00:00 2001 From: YanJin Date: Tue, 2 Jul 2024 11:50:09 +0200 Subject: [PATCH] ARTESCA-11299: In case of no location created, display all the storage options --- src/react/locations/LocationEditor.tsx | 1 - src/react/utils/storageOptions.ts | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/react/locations/LocationEditor.tsx b/src/react/locations/LocationEditor.tsx index fde8596d8..791acd682 100644 --- a/src/react/locations/LocationEditor.tsx +++ b/src/react/locations/LocationEditor.tsx @@ -74,7 +74,6 @@ function LocationEditor() { convertToForm({ ...newLocationDetails(), ...locationEditing }), ); const selectOptions = useMemo(() => { - if (!locations) return []; return selectStorageOptions( capabilities, locations, diff --git a/src/react/utils/storageOptions.ts b/src/react/utils/storageOptions.ts index b2da27dda..81457db5c 100644 --- a/src/react/utils/storageOptions.ts +++ b/src/react/utils/storageOptions.ts @@ -105,11 +105,11 @@ export const getLocationTypeShort = ( export function selectStorageOptions( capabilities: Capabilities, - locations: LocationInfo[], + locations?: LocationInfo[], labelFn?: LabelFunction, exceptHidden = true, ): Array { - const hdLocation = locations.find( + const hdLocation = locations?.find( (l) => l.type === LocationV1.LocationTypeEnum.ScalityHdclientV2, ); return Object.keys(storageOptions)