UBERF-5012: use flat message view if doc has only one notification (#4410)

Signed-off-by: Kristina Fefelova <kristin.fefelova@gmail.com>
This commit is contained in:
Kristina
2024-01-22 22:45:15 +07:00
committed by GitHub
parent 2c207fd13d
commit 77617e85ff
13 changed files with 196 additions and 60 deletions
@@ -216,7 +216,7 @@
overflow: hidden;
border: 1px solid transparent;
border-radius: 0.25rem;
width: calc(100% - 2rem);
width: 100%;
&.clickable {
cursor: pointer;
@@ -17,12 +17,17 @@
import activity, { ActivityMessage, DisplayActivityMessage } from '@hcengineering/activity'
import { createQuery } from '@hcengineering/presentation'
import { Ref } from '@hcengineering/core'
import { getLocation, navigate } from '@hcengineering/ui'
import { Action, getLocation, navigate } from '@hcengineering/ui'
import ActivityMessagePresenter from '../activity-message/ActivityMessagePresenter.svelte'
export let message: DisplayActivityMessage
export let notification: ActivityInboxNotification
export let embedded = false
export let showNotify = true
export let withActions = true
export let actions: Action[] = []
export let excludedActions: string[] = []
export let onClick: (() => void) | undefined = undefined
const parentQuery = createQuery()
@@ -43,7 +48,28 @@
</script>
{#if embedded && parentMessage}
<ActivityMessagePresenter value={parentMessage} skipLabel embedded onReply={handleReply} {onClick} />
<ActivityMessagePresenter
value={parentMessage}
skipLabel
embedded
{withActions}
{actions}
{excludedActions}
withFlatActions={false}
onReply={handleReply}
{onClick}
/>
{:else if !embedded && message}
<ActivityMessagePresenter value={message} skipLabel showEmbedded onReply={handleReply} {onClick} />
<ActivityMessagePresenter
value={message}
skipLabel
showEmbedded
showNotify={showNotify && !notification.isViewed}
{withActions}
{actions}
{excludedActions}
withFlatActions={false}
onReply={handleReply}
{onClick}
/>
{/if}