mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-21 07:46:24 +00:00
Add chat ui fixes (#6419)
This commit is contained in:
parent
14aee4e74f
commit
1b355d560e
@ -78,13 +78,13 @@
|
|||||||
|
|
||||||
const replyProvider = client.getModel().findAllSync(activity.class.ReplyProvider, {})[0]
|
const replyProvider = client.getModel().findAllSync(activity.class.ReplyProvider, {})[0]
|
||||||
|
|
||||||
async function handleReply (e: MouseEvent) {
|
async function handleReply (e: MouseEvent): Promise<void> {
|
||||||
e.stopPropagation()
|
e.stopPropagation()
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
|
|
||||||
if (replyProvider) {
|
if (replyProvider) {
|
||||||
const fn = await getResource(replyProvider.function)
|
const fn = await getResource(replyProvider.function)
|
||||||
fn(object)
|
await fn(object)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@ -92,7 +92,7 @@
|
|||||||
{#if !embedded && object.replies && object.replies > 0}
|
{#if !embedded && object.replies && object.replies > 0}
|
||||||
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
||||||
<!-- svelte-ignore a11y-no-static-element-interactions -->
|
<!-- svelte-ignore a11y-no-static-element-interactions -->
|
||||||
<div class="flex-row-center container cursor-pointer mt-2" on:click={handleReply}>
|
<div class="flex-row-center container cursor-pointer mt-2 overflow-label" on:click={handleReply}>
|
||||||
<div class="flex-row-center">
|
<div class="flex-row-center">
|
||||||
<div class="avatars">
|
<div class="avatars">
|
||||||
{#each displayPersons as person}
|
{#each displayPersons as person}
|
||||||
@ -112,12 +112,10 @@
|
|||||||
{#if hasNew}
|
{#if hasNew}
|
||||||
<div class="notifyMarker" />
|
<div class="notifyMarker" />
|
||||||
{/if}
|
{/if}
|
||||||
<div class="lastReply">
|
<span class="lastReply overflow-label">
|
||||||
<Label label={activity.string.LastReply} />
|
<Label label={activity.string.LastReply} />
|
||||||
</div>
|
|
||||||
<div class="time">
|
|
||||||
<TimeSince value={lastReply} />
|
<TimeSince value={lastReply} />
|
||||||
</div>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
@ -126,24 +124,23 @@
|
|||||||
border: 1px solid transparent;
|
border: 1px solid transparent;
|
||||||
border-radius: 0.5rem;
|
border-radius: 0.5rem;
|
||||||
padding: 0.25rem 0.5rem;
|
padding: 0.25rem 0.5rem;
|
||||||
width: fit-content;
|
|
||||||
height: 2.125rem;
|
height: 2.125rem;
|
||||||
margin-left: -0.5rem;
|
margin-left: -0.5rem;
|
||||||
|
min-width: 14.5rem;
|
||||||
|
|
||||||
.plus {
|
.plus {
|
||||||
margin-left: 0.25rem;
|
margin-left: 0.25rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.repliesCount {
|
.repliesCount {
|
||||||
|
flex: 1;
|
||||||
|
max-width: fit-content;
|
||||||
color: var(--theme-link-color);
|
color: var(--theme-link-color);
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
}
|
}
|
||||||
|
|
||||||
.time {
|
|
||||||
font-size: 0.75rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.lastReply {
|
.lastReply {
|
||||||
|
flex: 1;
|
||||||
font-size: 0.75rem;
|
font-size: 0.75rem;
|
||||||
margin-right: 0.25rem;
|
margin-right: 0.25rem;
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
import { createQuery, getClient } from '@hcengineering/presentation'
|
import { createQuery, getClient } from '@hcengineering/presentation'
|
||||||
import activity, { ActivityMessage, ActivityReference } from '@hcengineering/activity'
|
import activity, { ActivityMessage, ActivityReference } from '@hcengineering/activity'
|
||||||
import { ActivityMessagePresenter, sortActivityMessages } from '@hcengineering/activity-resources'
|
import { ActivityMessagePresenter, sortActivityMessages } from '@hcengineering/activity-resources'
|
||||||
import { ActionIcon, IconClose } from '@hcengineering/ui'
|
import { ActionIcon, IconClose, Loading } from '@hcengineering/ui'
|
||||||
import { createEventDispatcher } from 'svelte'
|
import { createEventDispatcher } from 'svelte'
|
||||||
import { ThreadMessage } from '@hcengineering/chunter'
|
import { ThreadMessage } from '@hcengineering/chunter'
|
||||||
import { Class, Doc, Ref, SortingOrder, Space } from '@hcengineering/core'
|
import { Class, Doc, Ref, SortingOrder, Space } from '@hcengineering/core'
|
||||||
@ -38,11 +38,18 @@
|
|||||||
let pinnedThreads: ThreadMessage[] = []
|
let pinnedThreads: ThreadMessage[] = []
|
||||||
let pinnedRefs: ActivityReference[] = []
|
let pinnedRefs: ActivityReference[] = []
|
||||||
|
|
||||||
|
let isPinnedLoaded = false
|
||||||
|
let isThreadsPinnedLoaded = false
|
||||||
|
let isPinnedRefsLoaded = false
|
||||||
|
|
||||||
|
$: isLoaded = isPinnedLoaded && isThreadsPinnedLoaded && isPinnedRefsLoaded
|
||||||
|
|
||||||
$: pinnedQuery.query(
|
$: pinnedQuery.query(
|
||||||
activity.class.ActivityMessage,
|
activity.class.ActivityMessage,
|
||||||
{ attachedTo, isPinned: true, space },
|
{ attachedTo, isPinned: true, space },
|
||||||
(res: ActivityMessage[]) => {
|
(res: ActivityMessage[]) => {
|
||||||
pinnedMessages = res
|
pinnedMessages = res
|
||||||
|
isPinnedLoaded = true
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -51,6 +58,7 @@
|
|||||||
{ objectId: attachedTo, isPinned: true, space },
|
{ objectId: attachedTo, isPinned: true, space },
|
||||||
(res: ThreadMessage[]) => {
|
(res: ThreadMessage[]) => {
|
||||||
pinnedThreads = res
|
pinnedThreads = res
|
||||||
|
isThreadsPinnedLoaded = true
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -60,11 +68,14 @@
|
|||||||
{ attachedTo, isPinned: true, space: { $ne: space } },
|
{ attachedTo, isPinned: true, space: { $ne: space } },
|
||||||
(res) => {
|
(res) => {
|
||||||
pinnedRefs = res
|
pinnedRefs = res
|
||||||
|
isPinnedRefsLoaded = true
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
} else {
|
||||||
|
isPinnedRefsLoaded = true
|
||||||
}
|
}
|
||||||
|
|
||||||
$: if (pinnedMessages.length === 0 && pinnedThreads.length === 0) {
|
$: if (isLoaded && pinnedMessages.length === 0 && pinnedThreads.length === 0 && pinnedRefs.length === 0) {
|
||||||
dispatch('close', undefined)
|
dispatch('close', undefined)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -79,6 +90,9 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="antiPopup vScroll popup">
|
<div class="antiPopup vScroll popup">
|
||||||
|
{#if displayMessages.length === 0}
|
||||||
|
<Loading size="small" />
|
||||||
|
{/if}
|
||||||
{#each displayMessages as message}
|
{#each displayMessages as message}
|
||||||
<div class="message relative">
|
<div class="message relative">
|
||||||
<ActivityMessagePresenter
|
<ActivityMessagePresenter
|
||||||
|
Loading…
Reference in New Issue
Block a user