Skip to content

Commit

Permalink
UI: Fix cancel button on role transform form (hashicorp#19135)
Browse files Browse the repository at this point in the history
  • Loading branch information
hashishaw authored Feb 10, 2023
1 parent d08de3e commit 32a009f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
3 changes: 3 additions & 0 deletions changelog/19135.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
ui (enterprise): Fix cancel button from transform engine role creation page
```
22 changes: 14 additions & 8 deletions ui/app/templates/components/transform-role-edit.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,11 @@
<MessageError @model={{this.model}} />
<NamespaceReminder @mode={{this.mode}} @noun="Transform role" />
{{#each this.model.attrs as |attr|}}
<FormField data-test-field @attr={{attr}} @model={{this.model}} />
{{#if (and (eq this.mode "edit") attr.options.readOnly)}}
<ReadonlyFormField @attr={{attr}} @value={{get this.model attr.name}} />
{{else}}
<FormField data-test-field @attr={{attr}} @model={{this.model}} />
{{/if}}
{{/each}}
</div>
<div class="field is-grouped-split box is-fullwidth is-bottomless">
Expand All @@ -75,13 +79,15 @@
Save
{{/if}}
</button>
<SecretLink
@mode={{if (eq this.mode "create") "list" "show"}}
class="button"
@secret={{concat "role/" this.model.id}}
>
Cancel
</SecretLink>
{{#if (eq this.mode "create")}}
<LinkTo @route={{"vault.cluster.secrets.backend.list-root"}} @query={{hash tab="role"}} class="button">
Cancel
</LinkTo>
{{else if (eq this.mode "edit")}}
<LinkTo @route="vault.cluster.secrets.backend.show" @model={{concat "role/" this.model.id}} class="button">
Cancel
</LinkTo>
{{/if}}
</div>
</div>
</form>
Expand Down

0 comments on commit 32a009f

Please sign in to comment.