From 8ad4e93ff7ccba6c25423089a7648e1f659aa6d6 Mon Sep 17 00:00:00 2001 From: Devon Anderson Date: Thu, 11 Jan 2024 17:23:24 -0500 Subject: [PATCH] =?UTF-8?q?refactor:=20=F0=9F=92=A1=20Migrate=20`workers-t?= =?UTF-8?q?ags`=20over=20to=20use=20`Hds::Table`=20(#2070)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * refactor: 💡 Migrate `workers-tags` over to use `Hds::Table` Migrate `workers-tags` in `worker-create` form to use `Hds::Table` instead of `Rose::Table` ✅ Closes: https://hashicorp.atlassian.net/browse/ICU-11722 * refactor: 💡 Use `Form::Field::List::Wrapper` for table Use `Form::Field::List::Wrapper` for table implementation. ✅ Closes: https://hashicorp.atlassian.net/browse/ICU-11722 * refactor: 💡 Refactored how `worker_tags` is used in `table` Cleaned up how `worker_tags` is used in the `Form::Field::ListWrapper` component ✅ Closes: https://hashicorp.atlassian.net/browse/ICU-11722 * refactor: 💡 removed `console.log` removed console.log ✅ Closes: https://hashicorp.atlassian.net/browse/ICU-11722 --- .../form/worker/create-worker-led/index.hbs | 76 +++++-------------- .../form/worker/create-worker-led/index.js | 8 +- 2 files changed, 19 insertions(+), 65 deletions(-) diff --git a/ui/admin/app/components/form/worker/create-worker-led/index.hbs b/ui/admin/app/components/form/worker/create-worker-led/index.hbs index c083c7085..2f1efc4fe 100644 --- a/ui/admin/app/components/form/worker/create-worker-led/index.hbs +++ b/ui/admin/app/components/form/worker/create-worker-led/index.hbs @@ -50,66 +50,24 @@ placeholder='10.0.0.1, 10.0.0.2, 10.0.0.3' /> {{/if}} + + <:fieldset as |F|> + {{t 'resources.worker.form.worker_tags.label'}} + + {{t 'resources.worker.form.worker_tags.help'}} + + - - {{t 'resources.worker.form.worker_tags.label'}} - {{t - 'resources.worker.form.worker_tags.help' - }} - - - - {{#each this.workerTags as |tag index|}} - - - - - - - - - - {{t 'actions.remove'}} - - - - {{/each}} - - - - - - - - - - - {{t 'actions.add'}} - - - - - - - + <:field as |F|> + + + {{#if (feature-flag 'ssh-session-recording')}} diff --git a/ui/admin/app/components/form/worker/create-worker-led/index.js b/ui/admin/app/components/form/worker/create-worker-led/index.js index 40c607f32..21379f0e1 100644 --- a/ui/admin/app/components/form/worker/create-worker-led/index.js +++ b/ui/admin/app/components/form/worker/create-worker-led/index.js @@ -31,8 +31,6 @@ export default class FormWorkerCreateWorkerLedComponent extends Component { @tracked configFilePath; @tracked initialUpstreams; @tracked workerTags = A([]); - @tracked newWorkerKey; - @tracked newWorkerValue; @tracked enableRecordingStoragePath = false; @tracked recording_storage_path = ''; @@ -189,10 +187,8 @@ unzip *.zip ;\\ } @action - addWorkerTag() { - this.workerTags.pushObject(new Tag(this.newWorkerKey, this.newWorkerValue)); - this.newWorkerKey = ''; - this.newWorkerValue = ''; + addWorkerTag(e) { + this.workerTags.pushObject(new Tag(e.key, e.value)); } @action