ui: Fix sticky action popover menus (#8326)

* ui Close more-popover-menus in KV and nspaces on confirmation

* ui: Close more-popovermenus on confirmation on composite-rows
This commit is contained in:
John Cowen 2020-07-17 14:28:32 +01:00 committed by hashicorp-ci
parent 3820dca426
commit 24b87b81d5
4 changed files with 7 additions and 6 deletions

View File

@ -7,7 +7,7 @@
<div role="menu"> <div role="menu">
<YieldSlot @name="confirmation" @params={{ <YieldSlot @name="confirmation" @params={{
block-params (component 'confirmation-alert' block-params (component 'confirmation-alert'
onclick=(action onclick) onclick=(queue (action onclick) (action menu.clickTrigger))
name=(concat menu.confirm guid) name=(concat menu.confirm guid)
) )
}}>{{yield}}</YieldSlot> }}>{{yield}}</YieldSlot>

View File

@ -3,12 +3,13 @@
<BlockSlot @name="trigger"> <BlockSlot @name="trigger">
More More
</BlockSlot> </BlockSlot>
<BlockSlot @name="menu" as |confirm send keypressClick|> <BlockSlot @name="menu" as |confirm send keypressClick clickTrigger|>
{{yield (component 'more-popover-menu/action' menu=(hash {{yield (component 'more-popover-menu/action' menu=(hash
addSubmenu=api.addSubmenu addSubmenu=api.addSubmenu
removeSubmenu=api.removeSubmenu removeSubmenu=api.removeSubmenu
confirm=confirm confirm=confirm
keypressClick=keypressClick keypressClick=keypressClick
clickTrigger=clickTrigger
))}} ))}}
</BlockSlot> </BlockSlot>
</PopoverMenu> </PopoverMenu>

View File

@ -56,7 +56,7 @@
<BlockSlot @name="trigger"> <BlockSlot @name="trigger">
More More
</BlockSlot> </BlockSlot>
<BlockSlot @name="menu" as |confirm send keypressClick|> <BlockSlot @name="menu" as |confirm send keypressClick clickTrigger|>
<li role="none"> <li role="none">
<a data-test-edit role="menuitem" tabindex="-1" href={{href-to (if item.isFolder 'dc.kv.folder' 'dc.kv.edit') item.Key}}>{{if item.isFolder 'View' 'Edit'}}</a> <a data-test-edit role="menuitem" tabindex="-1" href={{href-to (if item.isFolder 'dc.kv.folder' 'dc.kv.edit') item.Key}}>{{if item.isFolder 'View' 'Edit'}}</a>
</li> </li>
@ -74,7 +74,7 @@
</div> </div>
<ul> <ul>
<li class="dangerous"> <li class="dangerous">
<button tabindex="-1" type="button" class="type-delete" onclick={{action send 'delete' item}}>Delete</button> <button tabindex="-1" type="button" class="type-delete" onclick={{queue (action send 'delete' item) (action clickTrigger)}}>Delete</button>
</li> </li>
<li> <li>
<label for={{confirm}}>Cancel</label> <label for={{confirm}}>Cancel</label>

View File

@ -58,7 +58,7 @@
<BlockSlot @name="trigger"> <BlockSlot @name="trigger">
More More
</BlockSlot> </BlockSlot>
<BlockSlot @name="menu" as |confirm send keypressClick|> <BlockSlot @name="menu" as |confirm send keypressClick clickTrigger|>
<li role="none"> <li role="none">
<a data-test-edit role="menuitem" tabindex="-1" href={{href-to 'dc.nspaces.edit' item.Name}}>Edit</a> <a data-test-edit role="menuitem" tabindex="-1" href={{href-to 'dc.nspaces.edit' item.Name}}>Edit</a>
</li> </li>
@ -77,7 +77,7 @@
</div> </div>
<ul> <ul>
<li class="dangerous"> <li class="dangerous">
<button tabindex="-1" type="button" class="type-delete" onclick={{action send 'delete' item}}>Delete</button> <button tabindex="-1" type="button" class="type-delete" onclick={{queue (action send 'delete' item) (queue clickTrigger)}}>Delete</button>
</li> </li>
<li> <li>
<label for={{confirm}}>Cancel</label> <label for={{confirm}}>Cancel</label>