7eff7b51aa
* Refactors ConfirmAction implementation as a popover * Improves copy surrounding consequences of destructive actions * Moves 'Delete' buttons to Toolbar
71 lines
2.3 KiB
Handlebars
71 lines
2.3 KiB
Handlebars
{{#popup-menu name="role-aws-nav"}}
|
|
<nav class="menu">
|
|
{{#if (or item.generatePath.isPending item.signPath.isPending)}}
|
|
<ul class="menu-list">
|
|
<li class="action">
|
|
<button disabled type="button" class="link button is-loading is-transparent">
|
|
loading
|
|
</button>
|
|
</li>
|
|
</ul>
|
|
{{else if (or item.canGenerate item.canSign)}}
|
|
<ul class="menu-list">
|
|
{{#if item.canGenerate}}
|
|
<li class="action">
|
|
{{#link-to "vault.cluster.secrets.backend.credentials" item.id (query-params action="issue") data-test-role-pki-link="generate-certificate"}}
|
|
Generate certificate
|
|
{{/link-to}}
|
|
</li>
|
|
{{/if}}
|
|
{{#if item.canSign}}
|
|
<li class="action">
|
|
{{#link-to "vault.cluster.secrets.backend.credentials" item.id (query-params action="sign") data-test-role-pki-link="sign-certificate"}}
|
|
Sign certificate
|
|
{{/link-to}}
|
|
</li>
|
|
{{/if}}
|
|
</ul>
|
|
{{/if}}
|
|
<ul class="menu-list">
|
|
{{#if item.updatePath.isPending}}
|
|
<li class="action">
|
|
<button disabled type="button" class="link button is-loading is-transparent">
|
|
loading
|
|
</button>
|
|
</li>
|
|
<li class="action">
|
|
<button disabled type="button" class="link button is-loading is-transparent">
|
|
loading
|
|
</button>
|
|
</li>
|
|
{{else}}
|
|
{{#if item.canRead}}
|
|
<li class="action">
|
|
{{#link-to "vault.cluster.secrets.backend.show" item.id data-test-role-pki-link="show"}}
|
|
Details
|
|
{{/link-to}}
|
|
</li>
|
|
{{/if}}
|
|
{{#if item.canEdit}}
|
|
<li class="action">
|
|
{{#link-to "vault.cluster.secrets.backend.edit" item.id data-test-role-pki-link="edit"}}
|
|
Edit
|
|
{{/link-to}}
|
|
</li>
|
|
{{/if}}
|
|
{{#if item.canDelete}}
|
|
<li class="action">
|
|
<ConfirmAction
|
|
@buttonClasses="link is-destroy"
|
|
@onConfirmAction={{action "delete" item}}
|
|
data-test-aws-role-delete={{item.id}}
|
|
>
|
|
Delete
|
|
</ConfirmAction>
|
|
</li>
|
|
{{/if}}
|
|
{{/if}}
|
|
</ul>
|
|
</nav>
|
|
{{/popup-menu}}
|