diff --git a/plugins/view-assets/lang/en.json b/plugins/view-assets/lang/en.json index 2fbba75393..3366715d84 100644 --- a/plugins/view-assets/lang/en.json +++ b/plugins/view-assets/lang/en.json @@ -107,6 +107,7 @@ "Or": "Or", "HyperlinkPlaceholder": "https://jappleseed.com", "CopyToClipboard": "Copy to clipboard", + "PublicView": "Public", "ChooseIcon": "Choose icon", "IconColor": "Choose icon color", diff --git a/plugins/view-assets/lang/ru.json b/plugins/view-assets/lang/ru.json index 254b44623e..b04330a35b 100644 --- a/plugins/view-assets/lang/ru.json +++ b/plugins/view-assets/lang/ru.json @@ -103,6 +103,7 @@ "Or": "Или", "HyperlinkPlaceholder": "https://jappleseed.com", "CopyToClipboard": "Скопировать в буфер обмена", + "PublicView": "Публичный", "ChooseIcon": "Выбрать иконку", "IconColor": "Выберите цвет", diff --git a/plugins/view-resources/src/components/navigator/TreeElement.svelte b/plugins/view-resources/src/components/navigator/TreeElement.svelte index b2813dab3e..0b9a9cdfdb 100644 --- a/plugins/view-resources/src/components/navigator/TreeElement.svelte +++ b/plugins/view-resources/src/components/navigator/TreeElement.svelte @@ -26,7 +26,8 @@ Menu, showPopup, getTreeCollapsed, - setTreeCollapsed + setTreeCollapsed, + IconActivity } from '@hcengineering/ui' import { createEventDispatcher } from 'svelte' @@ -47,13 +48,25 @@ export let actions: (originalEvent?: MouseEvent) => Promise = async () => [] let hovered = false + let inlineActions: Action[] = [] + let popupMenuActions: Action[] = [] + + $: actions().then((result) => { + inlineActions = result.filter((action) => action.inline === true) + popupMenuActions = result.filter((action) => action.inline !== true) + }) + async function onMenuClick (ev: MouseEvent) { - showPopup(Menu, { actions: await actions(ev), ctx: _id }, ev.target as HTMLElement, () => { + showPopup(Menu, { actions: popupMenuActions, ctx: _id }, ev.target as HTMLElement, () => { hovered = false }) hovered = true } + async function onInlineClick (ev: MouseEvent, action: Action) { + action.action([], ev) + } + const dispatch = createEventDispatcher() $: if (_id) collapsed = getTreeCollapsed(_id) $: setTreeCollapsed(_id, collapsed) @@ -91,6 +104,15 @@
{#if !parent} + {#each inlineActions as action} +
onInlineClick(ev, action)} + > + +
+ {/each}
diff --git a/plugins/view/src/index.ts b/plugins/view/src/index.ts index 8248135423..9ee27d0e9f 100644 --- a/plugins/view/src/index.ts +++ b/plugins/view/src/index.ts @@ -883,7 +883,8 @@ const view = plugin(viewId, { Subscribed: '' as IntlString, HyperlinkPlaceholder: '' as IntlString, CopyToClipboard: '' as IntlString, - NoGrouping: '' as IntlString + NoGrouping: '' as IntlString, + PublicView: '' as IntlString }, icon: { Table: '' as Asset, diff --git a/plugins/workbench-resources/src/components/SavedView.svelte b/plugins/workbench-resources/src/components/SavedView.svelte index 4909263c18..fb747aa3d0 100644 --- a/plugins/workbench-resources/src/components/SavedView.svelte +++ b/plugins/workbench-resources/src/components/SavedView.svelte @@ -1,6 +1,6 @@