diff --git a/src/js/mock/managementClientMSWHandlers.ts b/src/js/mock/managementClientMSWHandlers.ts index f02b6a7b7..1cefd7873 100644 --- a/src/js/mock/managementClientMSWHandlers.ts +++ b/src/js/mock/managementClientMSWHandlers.ts @@ -144,17 +144,22 @@ export const LOCATIONS = { name: 'ring-nick', objectId: '99a06f79-c62c-11ec-b993-7e8a0ab79998', }, - 'us-east-1': { - isBuiltin: true, - locationType: 'location-file-v1', - name: 'us-east-1', - objectId: '95dbedf5-9888-11ec-8565-1ac2af7d1e53', - }, [azureblobstorage]: { locationType: 'location-azure-v1', name: azureblobstorage, details: {}, }, + 'us-east-1': { + details: { + bootstrapList: [ + 'artesca-storage-service-hdservice-proxy.xcore.svc:18888', + ], + repoId: null, + }, + locationType: 'location-scality-hdclient-v2', + name: 'us-east-1', + objectId: '22f31240-4bd3-11ee-98b3-1e5b6f897bc7', + }, }; export const ENDPOINTS = [ diff --git a/src/react/locations/LocationEditor.tsx b/src/react/locations/LocationEditor.tsx index cda25f64d..791acd682 100644 --- a/src/react/locations/LocationEditor.tsx +++ b/src/react/locations/LocationEditor.tsx @@ -62,7 +62,8 @@ function LocationEditor() { } = useAccountsLocationsAndEndpoints({ accountsLocationsEndpointsAdapter, }); - const locationEditing = accountsLocationsAndEndpoints?.locations.find( + const locations = accountsLocationsAndEndpoints?.locations; + const locationEditing = locations?.find( (location) => location.name === locationName, ); const capabilities = useSelector( @@ -73,9 +74,13 @@ function LocationEditor() { convertToForm({ ...newLocationDetails(), ...locationEditing }), ); const selectOptions = useMemo(() => { - //@ts-expect-error fix this when you are working on it - return selectStorageOptions(capabilities, makeLabel, !editingExisting); - }, [capabilities, editingExisting]); + return selectStorageOptions( + capabilities, + locations, + makeLabel, + !editingExisting, + ); + }, [capabilities, editingExisting, locations]); useMemo(() => { if (locationEditing) { setLocation(convertToForm(locationEditing)); diff --git a/src/react/locations/LocationsList.tsx b/src/react/locations/LocationsList.tsx index 53786f53f..7255accf0 100644 --- a/src/react/locations/LocationsList.tsx +++ b/src/react/locations/LocationsList.tsx @@ -145,6 +145,9 @@ const ActionButtons = ({ ); }; + const isEditButtonDisabled = + rowValues.isBuiltin || rowValues.type === 'location-scality-hdclient-v2'; + return (
history.push(`/locations/${locationName}/edit`)} type="button" aria-label="Edit Location" - tooltip={{ - overlay: 'Edit Location', - placement: 'top', - }} - disabled={rowValues.isBuiltin} + tooltip={ + isEditButtonDisabled + ? { + overlay: 'Edit Location is disabled for this location', + placement: 'top', + } + : { + overlay: 'Edit Location', + placement: 'top', + } + } + disabled={isEditButtonDisabled} />