From 7b98fbc3d2499feb6d680d193a2e09d8627bed3a Mon Sep 17 00:00:00 2001 From: Kristina Date: Fri, 20 Sep 2024 09:12:06 +0400 Subject: [PATCH] [Part 1]: Sidebar fixes (#6640) --- models/chunter/src/actions.ts | 10 ------ models/chunter/src/plugin.ts | 1 - .../src/components/ChannelHeader.svelte | 2 ++ .../src/components/ChannelSidebarView.svelte | 29 +++++++-------- .../src/components/ChannelView.svelte | 1 + .../src/components/Header.svelte | 35 +++++++++++++++---- .../threads/ThreadSidebarView.svelte | 8 ++--- plugins/chunter-resources/src/index.ts | 2 -- plugins/chunter-resources/src/navigation.ts | 29 +++++++++------ .../src/components/VideoWidget.svelte | 1 + plugins/workbench-resources/src/sidebar.ts | 2 +- tests/sanity/tests/model/channel-page.ts | 2 +- 12 files changed, 71 insertions(+), 51 deletions(-) diff --git a/models/chunter/src/actions.ts b/models/chunter/src/actions.ts index e2d65dd7d8..a7b7ab219f 100644 --- a/models/chunter/src/actions.ts +++ b/models/chunter/src/actions.ts @@ -308,14 +308,4 @@ function defineChannelActions (builder: Builder): void { target: notification.class.DocNotifyContext, context: { mode: ['context', 'browser'], group: 'tools' } }) - - createAction(builder, { - action: chunter.actionImpl.OpenInSidebarTab, - label: workbench.string.OpenInSidebarNewTab, - icon: view.icon.DetailsFilled, - input: 'focus', - category: chunter.category.Chunter, - target: notification.class.DocNotifyContext, - context: { mode: ['context', 'browser'], group: 'tools' } - }) } diff --git a/models/chunter/src/plugin.ts b/models/chunter/src/plugin.ts index e85892870e..c0fbc87557 100644 --- a/models/chunter/src/plugin.ts +++ b/models/chunter/src/plugin.ts @@ -52,7 +52,6 @@ export default mergeIds(chunterId, chunter, { DeleteChatMessage: '' as ViewAction, ReplyToThread: '' as ViewAction, OpenInSidebar: '' as ViewAction, - OpenInSidebarTab: '' as ViewAction, TranslateMessage: '' as ViewAction, ShowOriginalMessage: '' as ViewAction }, diff --git a/plugins/chunter-resources/src/components/ChannelHeader.svelte b/plugins/chunter-resources/src/components/ChannelHeader.svelte index 60bb596db5..37fd340167 100644 --- a/plugins/chunter-resources/src/components/ChannelHeader.svelte +++ b/plugins/chunter-resources/src/components/ChannelHeader.svelte @@ -35,6 +35,7 @@ export let withSearch: boolean = true export let isAsideShown: boolean = false export let filters: Ref[] = [] + export let canOpenInSidebar: boolean = false const client = getClient() const hierarchy = client.getHierarchy() @@ -78,6 +79,7 @@ {withAside} {isAsideShown} {withSearch} + {canOpenInSidebar} on:aside-toggled on:close > diff --git a/plugins/chunter-resources/src/components/ChannelSidebarView.svelte b/plugins/chunter-resources/src/components/ChannelSidebarView.svelte index ce725234c7..e47991f94b 100644 --- a/plugins/chunter-resources/src/components/ChannelSidebarView.svelte +++ b/plugins/chunter-resources/src/components/ChannelSidebarView.svelte @@ -61,21 +61,22 @@ {#if object} - {#key object._id} -
- +
+ + {#key object._id} -
- {/key} + {/key} +
{/if} {#if threadId}
diff --git a/plugins/chunter-resources/src/components/ChannelView.svelte b/plugins/chunter-resources/src/components/ChannelView.svelte index d94bee273e..ef849cd3fc 100644 --- a/plugins/chunter-resources/src/components/ChannelView.svelte +++ b/plugins/chunter-resources/src/components/ChannelView.svelte @@ -103,6 +103,7 @@ canOpen={isDocChat} allowClose={embedded} {isAsideShown} + canOpenInSidebar={true} on:close on:select={handleMessageSelect} on:aside-toggled={() => { diff --git a/plugins/chunter-resources/src/components/Header.svelte b/plugins/chunter-resources/src/components/Header.svelte index fb25f6bbcd..89a1a3b412 100644 --- a/plugins/chunter-resources/src/components/Header.svelte +++ b/plugins/chunter-resources/src/components/Header.svelte @@ -19,11 +19,12 @@ Breadcrumbs, Button, Icon, - IconDetails, Label, SearchInput, Header, - HeaderAdaptive + HeaderAdaptive, + IconSettings, + IconDetailsFilled } from '@hcengineering/ui' import { createEventDispatcher } from 'svelte' import view from '@hcengineering/view' @@ -31,9 +32,11 @@ import { getClient } from '@hcengineering/presentation' import { Doc, Ref } from '@hcengineering/core' import { ActivityMessagesFilter } from '@hcengineering/activity' + import workbench from '@hcengineering/workbench' import { userSearch } from '../index' - import { navigateToSpecial } from '../navigation' + import chunter from '../plugin' + import { navigateToSpecial, openChannelInSidebar } from '../navigation' import ChannelMessagesFilter from './ChannelMessagesFilter.svelte' export let object: Doc | undefined = undefined @@ -53,6 +56,7 @@ export let filters: Ref[] = [] export let adaptive: HeaderAdaptive = 'default' export let hideActions: boolean = false + export let canOpenInSidebar: boolean = false const client = getClient() const dispatch = createEventDispatcher() @@ -131,23 +135,40 @@ + {#if canOpenInSidebar} +