From deb9e069cbb53a4451c61bf46d6caac5a4294bd2 Mon Sep 17 00:00:00 2001 From: Artyom Savchenko Date: Wed, 10 Sep 2025 14:27:47 +0700 Subject: [PATCH] Move inbox if communication is enabled (#9819) Signed-off-by: Artem Savchenko --- .../src/components/Applications.svelte | 17 ++++++++++------- .../src/components/Workbench.svelte | 13 ++++++++++++- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/plugins/workbench-resources/src/components/Applications.svelte b/plugins/workbench-resources/src/components/Applications.svelte index b0da2712c9..42c5416b84 100644 --- a/plugins/workbench-resources/src/components/Applications.svelte +++ b/plugins/workbench-resources/src/components/Applications.svelte @@ -69,13 +69,16 @@ $: topApps = apps .filter((it) => it.position === 'top' && !hiddenAppsIds.includes(it._id) && !excludedApps.includes(it.alias)) .sort((a, b) => (a.order ?? Infinity) - (b.order ?? Infinity)) - $: midApps = apps.filter( - (it) => - !hiddenAppsIds.includes(it._id) && - !excludedApps.includes(it.alias) && - it.position !== 'top' && - it.position !== 'bottom' - ) + $: midApps = apps + .filter( + (it) => + !hiddenAppsIds.includes(it._id) && + !excludedApps.includes(it.alias) && + it.position !== 'top' && + it.position !== 'bottom' + ) + .sort((a, b) => (a.order ?? Infinity) - (b.order ?? Infinity)) + $: bottomApps = apps.filter( (it) => it.position === 'bottom' && !hiddenAppsIds.includes(it._id) && !excludedApps.includes(it.alias) ) diff --git a/plugins/workbench-resources/src/components/Workbench.svelte b/plugins/workbench-resources/src/components/Workbench.svelte index 8db65bd9a2..d7a7fef2ad 100644 --- a/plugins/workbench-resources/src/components/Workbench.svelte +++ b/plugins/workbench-resources/src/components/Workbench.svelte @@ -98,6 +98,7 @@ ViewConfiguration, WorkbenchTab } from '@hcengineering/workbench' + import communication from '@hcengineering/communication' import { getContext, onDestroy, onMount, tick } from 'svelte' import { subscribeMobile } from '../mobile' import workbench from '../plugin' @@ -150,6 +151,7 @@ migrateViewOpttions() const excludedApps = getMetadata(workbench.metadata.ExcludedApplications) ?? [] + const isCommunicationEnabled = getMetadata(communication.metadata.Enabled) ?? false const client = getClient() @@ -158,6 +160,15 @@ .findAllSync(workbench.class.Application, { hidden: false, _id: { $nin: excludedApps } }) .filter((it) => isAllowedToRole(it.accessLevel, account)) + if (isCommunicationEnabled) { + const notificationApp = client + .getModel() + .findAllSync(workbench.class.Application, { alias: notificationId })[0] + if (notificationApp && !apps.some((a) => a._id === notificationApp._id)) { + apps.push(notificationApp) + } + } + let panelInstance: PanelInstance let popupInstance: Popup @@ -832,7 +843,7 @@ /> - {#if !isExcludedApp(notificationId)} + {#if !isExcludedApp(notificationId) && !isCommunicationEnabled}