mirror of
https://github.com/hcengineering/platform.git
synced 2025-06-07 08:21:08 +00:00
Move doc panel in chat to right side (#4415)
Signed-off-by: Kristina Fefelova <kristin.fefelova@gmail.com>
This commit is contained in:
parent
181f1bdefd
commit
04b3103372
@ -63,6 +63,6 @@
|
|||||||
<ThreadViewPanel _id={threadId} on:close />
|
<ThreadViewPanel _id={threadId} on:close />
|
||||||
{:else if object}
|
{:else if object}
|
||||||
<div class="antiComponent">
|
<div class="antiComponent">
|
||||||
<ChannelPresenter {object} {context} allowClose on:close />
|
<ChannelPresenter {object} {context} embedded allowClose on:close />
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
|
@ -14,34 +14,54 @@
|
|||||||
-->
|
-->
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { Ref, Doc } from '@hcengineering/core'
|
import { Ref, Doc } from '@hcengineering/core'
|
||||||
import { getLocation, navigate } from '@hcengineering/ui'
|
import { defineSeparators, location as locationStore, panelSeparators, Separator } from '@hcengineering/ui'
|
||||||
import { DocNotifyContext } from '@hcengineering/notification'
|
import { DocNotifyContext } from '@hcengineering/notification'
|
||||||
import activity, { ActivityMessage, ActivityMessagesFilter } from '@hcengineering/activity'
|
import activity, { ActivityMessagesFilter } from '@hcengineering/activity'
|
||||||
import { ChatMessage } from '@hcengineering/chunter'
|
import { getClient } from '@hcengineering/presentation'
|
||||||
|
|
||||||
import Channel from './Channel.svelte'
|
import Channel from './Channel.svelte'
|
||||||
import PinnedMessages from './PinnedMessages.svelte'
|
import PinnedMessages from './PinnedMessages.svelte'
|
||||||
import ChannelHeader from './ChannelHeader.svelte'
|
import ChannelHeader from './ChannelHeader.svelte'
|
||||||
|
import DocChatPanel from './chat/DocChatPanel.svelte'
|
||||||
|
import chunter from '../plugin'
|
||||||
|
|
||||||
export let context: DocNotifyContext
|
export let context: DocNotifyContext
|
||||||
export let object: Doc
|
export let object: Doc
|
||||||
export let filterId: Ref<ActivityMessagesFilter> = activity.ids.AllFilter
|
export let filterId: Ref<ActivityMessagesFilter> = activity.ids.AllFilter
|
||||||
export let allowClose = false
|
export let allowClose = false
|
||||||
|
export let embedded = false
|
||||||
|
|
||||||
function openThread (_id: Ref<ChatMessage>) {
|
const client = getClient()
|
||||||
const loc = getLocation()
|
const hierarchy = client.getHierarchy()
|
||||||
loc.path[4] = _id
|
|
||||||
navigate(loc)
|
let isThreadOpened = false
|
||||||
}
|
|
||||||
|
$: isDocChat = !hierarchy.isDerived(object._class, chunter.class.ChunterSpace)
|
||||||
|
$: asideShown = !embedded && isDocChat && !isThreadOpened
|
||||||
|
|
||||||
|
locationStore.subscribe((newLocation) => {
|
||||||
|
isThreadOpened = newLocation.path[4] != null
|
||||||
|
})
|
||||||
|
|
||||||
|
defineSeparators('aside', panelSeparators)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<div class="popupPanel panel" class:embedded>
|
||||||
<ChannelHeader {object} {allowClose} on:close />
|
<ChannelHeader {object} {allowClose} on:close />
|
||||||
|
<div class="popupPanel-body" class:asideShown>
|
||||||
|
<div class="popupPanel-body__main">
|
||||||
<PinnedMessages {context} />
|
<PinnedMessages {context} />
|
||||||
<Channel
|
<Channel {context} {object} {filterId} />
|
||||||
{context}
|
</div>
|
||||||
{object}
|
|
||||||
{filterId}
|
{#if asideShown}
|
||||||
on:openThread={(e) => {
|
<Separator name="aside" float={false} index={0} />
|
||||||
openThread(e.detail)
|
<div class="popupPanel-body__aside" class:float={false} class:shown={asideShown}>
|
||||||
}}
|
<Separator name="aside" float index={0} />
|
||||||
/>
|
<div class="antiPanel-wrap__content">
|
||||||
|
<DocChatPanel {object} {filterId} />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@ -69,11 +69,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
defineSeparators('chat', [
|
|
||||||
{ minSize: 20, maxSize: 40, size: 30, float: 'navigator' },
|
|
||||||
{ size: 'auto', minSize: 30, maxSize: 'auto', float: undefined }
|
|
||||||
])
|
|
||||||
|
|
||||||
$: selectedContextId &&
|
$: selectedContextId &&
|
||||||
notifyContextQuery.query(
|
notifyContextQuery.query(
|
||||||
notification.class.DocNotifyContext,
|
notification.class.DocNotifyContext,
|
||||||
@ -88,9 +83,10 @@
|
|||||||
object = res[0]
|
object = res[0]
|
||||||
})
|
})
|
||||||
|
|
||||||
$: isDocChatOpened =
|
defineSeparators('chat', [
|
||||||
selectedContext !== undefined &&
|
{ minSize: 20, maxSize: 40, size: 30, float: 'navigator' },
|
||||||
![chunter.class.Channel, chunter.class.DirectMessage].includes(selectedContext.attachedToClass)
|
{ size: 'auto', minSize: 30, maxSize: 'auto', float: undefined }
|
||||||
|
])
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="flex-row-top h-full">
|
<div class="flex-row-top h-full">
|
||||||
@ -101,12 +97,8 @@
|
|||||||
: 'landscape'} background-comp-header-color"
|
: 'landscape'} background-comp-header-color"
|
||||||
>
|
>
|
||||||
<div class="antiPanel-wrap__content">
|
<div class="antiPanel-wrap__content">
|
||||||
{#if !isDocChatOpened}
|
|
||||||
<NavHeader label={chunter.string.Chat} />
|
<NavHeader label={chunter.string.Chat} />
|
||||||
<ChatNavigator {selectedContextId} {currentSpecial} />
|
<ChatNavigator {selectedContextId} {currentSpecial} />
|
||||||
{:else if object}
|
|
||||||
<DocChatPanel {object} {filterId} />
|
|
||||||
{/if}
|
|
||||||
</div>
|
</div>
|
||||||
<Separator name="chat" float={navFloat ? 'navigator' : true} index={0} />
|
<Separator name="chat" float={navFloat ? 'navigator' : true} index={0} />
|
||||||
</div>
|
</div>
|
||||||
@ -132,8 +124,7 @@
|
|||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
{/if}
|
{:else if selectedContext && object}
|
||||||
{#if selectedContext && object}
|
|
||||||
{#key selectedContext._id}
|
{#key selectedContext._id}
|
||||||
<ChannelView context={selectedContext} {object} {filterId} />
|
<ChannelView context={selectedContext} {object} {filterId} />
|
||||||
{/key}
|
{/key}
|
||||||
|
@ -78,7 +78,6 @@
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="popupPanel panel">
|
|
||||||
<div class="actions">
|
<div class="actions">
|
||||||
<ActionIcon
|
<ActionIcon
|
||||||
icon={view.icon.Open}
|
icon={view.icon.Open}
|
||||||
@ -127,7 +126,6 @@
|
|||||||
{/await}
|
{/await}
|
||||||
{/key}
|
{/key}
|
||||||
{/each}
|
{/each}
|
||||||
</div>
|
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.header {
|
.header {
|
||||||
|
Loading…
Reference in New Issue
Block a user