From 596ae9d81722edb2e6440464c29eeb2ed3e83535 Mon Sep 17 00:00:00 2001 From: Carlos Alcaide Corvo Date: Wed, 7 Jun 2023 12:56:15 -0700 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20Storage=20bucket=20region?= =?UTF-8?q?=20field=20not=20editable=20(#329)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: 🐛 Storage bucket region field not editable --- ui/admin/app/components/form/storage-bucket/index.hbs | 1 + .../tests/acceptance/storage-buckets/update-test.js | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/ui/admin/app/components/form/storage-bucket/index.hbs b/ui/admin/app/components/form/storage-bucket/index.hbs index a3872ab15..1cc2f6d3f 100644 --- a/ui/admin/app/components/form/storage-bucket/index.hbs +++ b/ui/admin/app/components/form/storage-bucket/index.hbs @@ -155,6 +155,7 @@ @type='text' name='region' disabled={{form.disabled}} + readOnly={{not @model.isNew}} {{on 'input' (set-from-event @model 'region')}} as |F| > diff --git a/ui/admin/tests/acceptance/storage-buckets/update-test.js b/ui/admin/tests/acceptance/storage-buckets/update-test.js index aec19b55e..8646db2fe 100644 --- a/ui/admin/tests/acceptance/storage-buckets/update-test.js +++ b/ui/admin/tests/acceptance/storage-buckets/update-test.js @@ -19,7 +19,6 @@ module('Acceptance | storage-buckets | update', function (hooks) { const BUTTON_SELECTOR = '.rose-form-actions [type="button"]'; const SAVE_BUTTON_SELECTOR = '.rose-form-actions [type="submit"]'; const NAME_FIELD_SELECTOR = '[name="name"]'; - const REGION_FIELD_SELECTOR = '[name="region"]'; const ALERT_TEXT_SELECTOR = '[role="alert"] div'; const FIELD_ERROR_TEXT_SELECTOR = '.hds-form-error__message'; const SECRET_FIELD_BUTTON_SELECTOR = '.secret-input [type="button"]'; @@ -30,6 +29,7 @@ module('Acceptance | storage-buckets | update', function (hooks) { const SECRET_ACCESS_KEY_FIELD_TEXT = 'Update secret access key'; const BUCKET_NAME_FIELD_SELECTOR = '[name="bucket_name"]'; const BUCKET_PREFIX_FIELD_SELECTOR = '[name="bucket_prefix"]'; + const WORKER_FILTER = '[name="worker_filter"]'; const instances = { scopes: { @@ -156,8 +156,8 @@ module('Acceptance | storage-buckets | update', function (hooks) { details: { request_fields: [ { - name: 'region', - description: 'Region is required.', + name: 'worker_filter', + description: 'Worker filter is required.', }, ], }, @@ -167,11 +167,11 @@ module('Acceptance | storage-buckets | update', function (hooks) { await click(`[href="${urls.storageBucket}"]`); await click(BUTTON_SELECTOR, 'Activate edit mode'); - await fillIn(REGION_FIELD_SELECTOR, 'random string'); + await fillIn(WORKER_FILTER, 'random string'); await click(SAVE_BUTTON_SELECTOR); assert.dom(ALERT_TEXT_SELECTOR).hasText('The request was invalid.'); - assert.dom(FIELD_ERROR_TEXT_SELECTOR).hasText('Region is required.'); + assert.dom(FIELD_ERROR_TEXT_SELECTOR).hasText('Worker filter is required.'); }); test('user cannot edit bucket name and bucket prefix fields in a storage bucket form', async function (assert) {