Skip to content

Commit

Permalink
use new Confirm
Browse files Browse the repository at this point in the history
  • Loading branch information
andaley committed Oct 16, 2019
1 parent 7374206 commit 47b44b9
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions ui/app/templates/components/generated-item-list.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
<Item.content>
<Icon @glyph="folder-outline" class="has-text-grey-light" @size="l" />{{list.item.id}}
</Item.content>
<Item.menu>
<Item.menu as |Menu|>
<li class="action">
{{#link-to "vault.cluster.access.method.item.show" list.item.id class="is-block"}}
View {{singularize itemType}}
Expand All @@ -79,20 +79,22 @@
{{/link-to}}
</li>
<li>
<ConfirmAction @buttonClasses="link is-destroy" @onConfirmAction={{action
(perform
Item.callMethod
"destroyRecord"
list.item
(concat "Successfully deleted " (singularize itemType) " " list.item.id ".")
(concat "There was an error deleting this " (singularize itemType))
(action "refreshItemList")
)
}} @confirmMessage={{concat "Are you sure you want to delete " (singularize itemType) " " list.item.id "?"}}
@cancelButtonText="Cancel" data-test-secret-delete="true">
Delete
{{singularize itemType}}
</ConfirmAction>
<Menu.Message
@id={{list.item.id}}
@buttonClasses="link is-destroy"
@onConfirm={{action
(perform
Item.callMethod
"destroyRecord"
list.item
(concat "Successfully deleted " (singularize itemType) " " list.item.id ".")
(concat "There was an error deleting this " (singularize itemType))
(action "refreshItemList")
)
}}
@message={{concat "Are you sure you want to delete " (singularize itemType) " " list.item.id "?"}}
data-test-secret-delete="true"
@triggerText={{concat "Delete " (singularize itemType)}}/>
</li>
</Item.menu>
</ListItem>
Expand Down

0 comments on commit 47b44b9

Please sign in to comment.