open-vault/ui/app/templates/partials/role-aws/form.hbs
2018-11-02 11:21:15 -06:00

51 lines
1.6 KiB
Handlebars

<form onsubmit={{action "createOrUpdate" "create"}} onchange={{action "handleChange"}}>
<div class="box is-sideless is-fullwidth is-marginless">
{{message-error model=model}}
<NamespaceReminder @mode={{mode}} @noun="AWS role" />
{{#if (gt model.credentialTypes.length 1)}}
<AlertBanner
@type="warning"
@message="This role has more than one credential_type, currently: {{join ', ' model.credentialTypes}}.
Multiple credential types is deprecated and you must choose one in order to save this role."
/>
{{/if}}
{{#each (if (eq mode 'edit') (drop 1 model.fields) model.fields) as |attr|}}
{{form-field data-test-field attr=attr model=model}}
{{/each}}
</div>
<div class="field is-grouped-split box is-fullwidth is-bottomless">
<div class="control">
<button
type="submit"
disabled={{buttonDisabled}}
class="button is-primary"
data-test-role-aws-create=true
>
{{#if (eq mode 'create')}}
Create role
{{else if (eq mode 'edit')}}
Save
{{/if}}
</button>
{{#secret-link
mode=(if (eq mode "create") "list" "show")
class="button"
secret=model.id
}}
Cancel
{{/secret-link}}
</div>
{{#if (and (eq mode 'edit') model.canDelete)}}
{{#confirm-action
buttonClasses="button"
onConfirmAction=(action "delete")
confirmMessage=(concat "Are you sure you want to delete " model.id "?")
cancelButtonText="Cancel"
}}
Delete
{{/confirm-action}}
{{/if}}
</div>
</form>