mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-08 18:57:42 +02:00
Move inbox if communication is enabled (#9819)
Signed-off-by: Artem Savchenko <armisav@gmail.com>
This commit is contained in:
@@ -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)
|
||||
)
|
||||
|
||||
@@ -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<Application>(workbench.class.Application, { hidden: false, _id: { $nin: excludedApps } })
|
||||
.filter((it) => isAllowedToRole(it.accessLevel, account))
|
||||
|
||||
if (isCommunicationEnabled) {
|
||||
const notificationApp = client
|
||||
.getModel()
|
||||
.findAllSync<Application>(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 @@
|
||||
/>
|
||||
</div>
|
||||
<!-- <ActivityStatus status="active" /> -->
|
||||
{#if !isExcludedApp(notificationId)}
|
||||
{#if !isExcludedApp(notificationId) && !isCommunicationEnabled}
|
||||
<NavLink
|
||||
app={notificationId}
|
||||
shrink={0}
|
||||
|
||||
Reference in New Issue
Block a user