diff --git a/plugins/view-resources/src/components/navigator/TreeElement.svelte b/plugins/view-resources/src/components/navigator/TreeElement.svelte index fd05dd8c12..06dadc99ce 100644 --- a/plugins/view-resources/src/components/navigator/TreeElement.svelte +++ b/plugins/view-resources/src/components/navigator/TreeElement.svelte @@ -26,8 +26,7 @@ Menu, showPopup, getTreeCollapsed, - setTreeCollapsed, - IconActivity + setTreeCollapsed } from '@hcengineering/ui' import { createEventDispatcher } from 'svelte' @@ -58,14 +57,14 @@ popupMenuActions = result.filter((action) => action.inline !== true) }) - async function onMenuClick (ev: MouseEvent) { + async function onMenuClick (ev: MouseEvent): Promise { showPopup(Menu, { actions: popupMenuActions, ctx: _id }, ev.target as HTMLElement, () => { hovered = false }) hovered = true } - async function onInlineClick (ev: MouseEvent, action: Action) { + async function onInlineClick (ev: MouseEvent, action: Action): Promise { action.action([], ev) } @@ -108,39 +107,30 @@
- {#if !parent} + {#if inlineActions.length > 0} {#each inlineActions as action} -
onInlineClick(ev, action)} - > +
onInlineClick(ev, action)}>
{/each} + {/if} + {#if popupMenuActions.length === 1 && popupMenuActions[0].icon} +
+ { + void popupMenuActions[0].action(_id, ev) + }} + /> +
+ {:else if popupMenuActions.length > 0}
- {:else} - {#await actions() then actionItems} - {#if actionItems.length === 1 && actionItems[0].icon} -
- { - actionItems[0].action(_id, ev) - }} - /> -
- {:else if actionItems.length > 1} -
- -
- {/if} - {/await} {/if} + {#if notifications > 0 && collapsed}
{notifications}
{/if} diff --git a/plugins/workbench-resources/src/components/navigator/SpacesNav.svelte b/plugins/workbench-resources/src/components/navigator/SpacesNav.svelte index 16a7504648..214674cc11 100644 --- a/plugins/workbench-resources/src/components/navigator/SpacesNav.svelte +++ b/plugins/workbench-resources/src/components/navigator/SpacesNav.svelte @@ -97,6 +97,7 @@ result.push({ icon: act.icon ?? IconEdit, label: act.label, + inline: act.inline, action: async (ctx: any, evt: Event) => { const impl = await getResource(act.action) await impl(space, evt, act.actionProps)