c31671ce04
* add dot-to-dash helper * fix context menu on policy page and add test for deletion * use dot-to-dash where we use confirm component * fix acceptance test
46 lines
1.6 KiB
Handlebars
46 lines
1.6 KiB
Handlebars
{{#popup-menu name="alias-menu"}}
|
|
{{#with params.firstObject as |item|}}
|
|
<nav class="menu">
|
|
<ul class="menu-list">
|
|
<li class="action">
|
|
{{#link-to "vault.cluster.access.identity.aliases.show" (pluralize item.parentType) item.id "details"}}
|
|
Details
|
|
{{/link-to}}
|
|
</li>
|
|
{{#if item.updatePath.isPending}}
|
|
<li class="action">
|
|
<button disabled type="button" class="link button is-loading is-transparent">
|
|
loading
|
|
</button>
|
|
</li>
|
|
{{else}}
|
|
{{#if item.canEdit}}
|
|
<li class="action">
|
|
{{#link-to "vault.cluster.access.identity.aliases.edit" (pluralize item.parentType) item.id}}
|
|
Edit
|
|
{{/link-to}}
|
|
</li>
|
|
{{/if}}
|
|
{{#if item.canDelete}}
|
|
<li class="action">
|
|
{{#confirm-action
|
|
data-test-item-delete=true
|
|
confirmButtonClasses="button is-primary"
|
|
buttonClasses="link is-destroy"
|
|
onConfirmAction=(action "performTransaction" item)
|
|
confirmMessage=(concat "Are you sure you want to delete " item.id "?")
|
|
showConfirm=(get this (concat "shouldDelete-" (dot-to-dash item.id)))
|
|
class=(if (get this (concat "shouldDelete-" (dot-to-dash item.id))) "message is-block is-warning is-outline")
|
|
containerClasses="message-body is-block"
|
|
messageClasses="is-block"
|
|
}}
|
|
Delete
|
|
{{/confirm-action}}
|
|
</li>
|
|
{{/if}}
|
|
{{/if}}
|
|
</ul>
|
|
</nav>
|
|
{{/with}}
|
|
{{/popup-menu}}
|