open-vault/ui/app/templates/components/role-aws-edit.hbs
Joshua Ogle 7eff7b51aa
UI: Confirm Action as a popover
* Refactors ConfirmAction implementation as a popover
* Improves copy surrounding consequences of destructive actions
* Moves 'Delete' buttons to Toolbar
2019-05-17 11:29:21 -06:00

65 lines
1.5 KiB
Handlebars

<PageHeader as |p|>
<p.top>
{{key-value-header
baseKey=model
path="vault.cluster.secrets.backend.list"
mode=mode
root=root
showCurrent=true
}}
</p.top>
<p.levelLeft>
<h1 class="title is-3" data-test-secret-header="true">
{{#if (eq mode "create")}}
Create an AWS Role
{{else if (eq mode 'edit')}}
Edit AWS Role <code>{{model.id}}</code>
{{else}}
AWS Role <code>{{model.id}}</code>
{{/if}}
</h1>
</p.levelLeft>
</PageHeader>
{{#if (eq mode "show")}}
<Toolbar>
<ToolbarActions>
{{#if model.canGenerate}}
<ToolbarSecretLink
@secret={{model.id}}
@mode="credentials"
@data-test-backend-credentials="iam"
>
Generate credentials
</ToolbarSecretLink>
{{/if}}
{{#if (and model.canGenerate (or model.canDelete model.canEdit))}}
<div class="toolbar-separator" />
{{/if}}
{{#if model.canDelete}}
<ConfirmAction
@buttonClasses="toolbar-link"
@onConfirmAction={{action "delete"}}
>
Delete role
</ConfirmAction>
{{/if}}
{{#if model.canEdit}}
<ToolbarSecretLink
@secret={{model.id}}
@mode="edit"
@replace=true
>
Edit role
</ToolbarSecretLink>
{{/if}}
</ToolbarActions>
</Toolbar>
{{/if}}
{{#if (or (eq mode 'edit') (eq mode 'create'))}}
{{partial 'partials/role-aws/form'}}
{{else}}
{{partial 'partials/role-aws/show'}}
{{/if}}