From 9d414439b9c1e2e6d9a887db78312c5efdd45a1a Mon Sep 17 00:00:00 2001 From: Alexander Onnikov Date: Wed, 10 Apr 2024 02:20:49 +0700 Subject: [PATCH] Allow child classes in navigator model (#5275) Signed-off-by: Alexander Onnikov --- plugins/document/src/plugin.ts | 5 +---- .../src/components/Navigator.svelte | 3 ++- .../src/components/navigator/StarredNav.svelte | 14 ++++++++++++-- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/plugins/document/src/plugin.ts b/plugins/document/src/plugin.ts index eb7b7a2cd9..6865c7fbc0 100644 --- a/plugins/document/src/plugin.ts +++ b/plugins/document/src/plugin.ts @@ -18,7 +18,7 @@ import { NotificationGroup, NotificationType } from '@hcengineering/notification import type { Asset, Plugin, Resource } from '@hcengineering/platform' import { IntlString, plugin } from '@hcengineering/platform' import type { AnyComponent, Location, ResolvedLocation } from '@hcengineering/ui' -import { Action, Viewlet } from '@hcengineering/view' +import { Action } from '@hcengineering/view' import { Document, DocumentEmbedding, DocumentSnapshot, SavedDocument, Teamspace } from './types' /** @@ -75,9 +75,6 @@ export const documentPlugin = plugin(documentId, { DocumentNotificationGroup: '' as Ref, ContentNotification: '' as Ref }, - viewlet: { - TableBranches: '' as Ref - }, descriptor: { TeamspaceType: '' as Ref }, diff --git a/plugins/workbench-resources/src/components/Navigator.svelte b/plugins/workbench-resources/src/components/Navigator.svelte index 8109abb319..94a561c102 100644 --- a/plugins/workbench-resources/src/components/Navigator.svelte +++ b/plugins/workbench-resources/src/components/Navigator.svelte @@ -42,10 +42,11 @@ let shownSpaces: Space[] = [] $: if (model) { + const classes = getSpecialSpaceClass(model).flatMap((c) => hierarchy.getDescendants(c)) query.query( core.class.Space, { - _class: { $in: getSpecialSpaceClass(model) } + _class: { $in: classes } // temp disabled, need way for default spaces // members: getCurrentAccount()._id }, diff --git a/plugins/workbench-resources/src/components/navigator/StarredNav.svelte b/plugins/workbench-resources/src/components/navigator/StarredNav.svelte index e752e4c508..cca310b370 100644 --- a/plugins/workbench-resources/src/components/navigator/StarredNav.svelte +++ b/plugins/workbench-resources/src/components/navigator/StarredNav.svelte @@ -13,7 +13,7 @@ // limitations under the License. -->