From f5c52fe89306b9b101e3d8b3bb786d2229bd69c5 Mon Sep 17 00:00:00 2001 From: Phil Renaud Date: Thu, 25 May 2023 19:57:30 +0000 Subject: [PATCH] backport of commit 41bae458756a4cfac2a31c6a856a315016e9124e --- .changelog/17319.txt | 3 +++ ui/app/components/variable-form.hbs | 1 + ui/app/components/variable-form.js | 5 ++++- ui/app/components/variable-form/related-entities.hbs | 2 +- 4 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 .changelog/17319.txt diff --git a/.changelog/17319.txt b/.changelog/17319.txt new file mode 100644 index 000000000000..0cecdd827c12 --- /dev/null +++ b/.changelog/17319.txt @@ -0,0 +1,3 @@ +```release-note:bug +ui: fixed a handful of UX-related bugs during variable editing +``` diff --git a/ui/app/components/variable-form.hbs b/ui/app/components/variable-form.hbs index 9e78f0d98a6b..f3672f76ef49 100644 --- a/ui/app/components/variable-form.hbs +++ b/ui/app/components/variable-form.hbs @@ -143,6 +143,7 @@ class="delete-row button is-danger is-inverted" type="button" {{on "click" (action this.deleteRow entry)}} + disabled={{eq this.keyValues.length 1}} > Delete diff --git a/ui/app/components/variable-form.js b/ui/app/components/variable-form.js index 07fa9607d564..693e6a89f8fd 100644 --- a/ui/app/components/variable-form.js +++ b/ui/app/components/variable-form.js @@ -177,7 +177,10 @@ export default class VariableFormComponent extends Component { } @action appendRow() { - this.keyValues.pushObject(copy(EMPTY_KV)); + // Clear our any entity errors + let newRow = copy(EMPTY_KV); + newRow.warnings = EmberObject.create(); + this.keyValues.pushObject(newRow); } @action deleteRow(row) { diff --git a/ui/app/components/variable-form/related-entities.hbs b/ui/app/components/variable-form/related-entities.hbs index d29607fb7c42..109e96e04e0c 100644 --- a/ui/app/components/variable-form/related-entities.hbs +++ b/ui/app/components/variable-form/related-entities.hbs @@ -9,7 +9,7 @@ {{else if @job}} job {{@job}} {{else}} - all nomad jobs + all nomad jobs in this namespace {{/if}}