From 0191598223cd7382a7d6684030278863b2fa1366 Mon Sep 17 00:00:00 2001 From: Anna Viklund Date: Fri, 2 Aug 2024 17:48:32 +0200 Subject: [PATCH] Prepare to display access key as a regular string when returned by API --- ui/src/data-services/models/storage.ts | 4 ++++ .../details-form/storage-details-form.tsx | 18 ++++++------------ 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/ui/src/data-services/models/storage.ts b/ui/src/data-services/models/storage.ts index 2a99f4c5a..fc236d303 100644 --- a/ui/src/data-services/models/storage.ts +++ b/ui/src/data-services/models/storage.ts @@ -7,6 +7,10 @@ export class StorageSource extends Entity { super(entity) } + get accessKey(): string { + return this._data.access_key + } + get bucket(): string { return this._data.bucket } diff --git a/ui/src/pages/overview/entities/details-form/storage-details-form.tsx b/ui/src/pages/overview/entities/details-form/storage-details-form.tsx index 30643ce9c..5875dfa0e 100644 --- a/ui/src/pages/overview/entities/details-form/storage-details-form.tsx +++ b/ui/src/pages/overview/entities/details-form/storage-details-form.tsx @@ -82,11 +82,12 @@ export const StorageDetailsForm = ({ setFocus, } = useForm({ defaultValues: { - name: entity?.name, + access_key: storage?.accessKey, + name: storage?.name, bucket: storage?.bucket, public_base_url: storage?.publicBaseUrl, endpoint_url: storage?.endpointUrl, - // Access key and secret key are not returned by the API + // Secret access key is not returned by the API }, mode: 'onChange', }) @@ -145,18 +146,11 @@ export const StorageDetailsForm = ({ /> - ( - setTimeout(() => setFocus(field.name))} - /> - )} />