UI: Fix cancel button on role transform form (#19135)

This commit is contained in:
Chelsea Shaw 2023-02-10 14:37:22 -06:00 committed by GitHub
parent 674d56d9c7
commit 54c863c747
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 8 deletions

3
changelog/19135.txt Normal file
View File

@ -0,0 +1,3 @@
```release-note:bug
ui (enterprise): Fix cancel button from transform engine role creation page
```

View File

@ -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">
@ -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>