Skip to content

Commit

Permalink
Disable Delete button if only one KV is left, and remove entity warni…
Browse files Browse the repository at this point in the history
…ngs on Add More
  • Loading branch information
philrenaud committed May 25, 2023
1 parent 3222cbe commit 41bae45
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .changelog/17319.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
ui: fixed a handful of UX-related bugs during variable editing
```
1 change: 1 addition & 0 deletions ui/app/components/variable-form.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@
class="delete-row button is-danger is-inverted"
type="button"
{{on "click" (action this.deleteRow entry)}}
disabled={{eq this.keyValues.length 1}}
>
Delete
</button>
Expand Down
5 changes: 4 additions & 1 deletion ui/app/components/variable-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,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) {
Expand Down
2 changes: 1 addition & 1 deletion ui/app/components/variable-form/related-entities.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
{{else if @job}}
job <LinkTo @route="jobs.job" @model={{concat @job "@" @namespace}}>{{@job}} <FlightIcon @name="external-link" /></LinkTo>
{{else}}
all nomad jobs
all nomad jobs in this namespace
{{/if}}
</span>
</p>

0 comments on commit 41bae45

Please sign in to comment.