mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-16 13:21:57 +00:00
TSK-1016. The avatar for attachments is the same as for Comments (#2878)
Signed-off-by: Alexander Platov <sas_lord@mail.ru>
This commit is contained in:
parent
e7483daa00
commit
7868126e15
@ -42,6 +42,7 @@
|
|||||||
"@hcengineering/contact": "^0.6.11",
|
"@hcengineering/contact": "^0.6.11",
|
||||||
"@hcengineering/notification": "^0.6.8",
|
"@hcengineering/notification": "^0.6.8",
|
||||||
"@hcengineering/view": "^0.6.2",
|
"@hcengineering/view": "^0.6.2",
|
||||||
"@hcengineering/view-resources": "^0.6.0"
|
"@hcengineering/view-resources": "^0.6.0",
|
||||||
|
"@hcengineering/attachment": "^0.6.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import type { TxViewlet } from '@hcengineering/activity'
|
import type { TxViewlet } from '@hcengineering/activity'
|
||||||
import contact, { Employee, EmployeeAccount, getName } from '@hcengineering/contact'
|
import contact, { Employee, EmployeeAccount, getName } from '@hcengineering/contact'
|
||||||
import core, { AnyAttribute, Doc, getCurrentAccount, Ref } from '@hcengineering/core'
|
import core, { AnyAttribute, Doc, getCurrentAccount, Ref, Class } from '@hcengineering/core'
|
||||||
import { Asset } from '@hcengineering/platform'
|
import { Asset } from '@hcengineering/platform'
|
||||||
import { createQuery, getClient } from '@hcengineering/presentation'
|
import { createQuery, getClient } from '@hcengineering/presentation'
|
||||||
import {
|
import {
|
||||||
@ -31,6 +31,7 @@
|
|||||||
TimeSince
|
TimeSince
|
||||||
} from '@hcengineering/ui'
|
} from '@hcengineering/ui'
|
||||||
import type { AttributeModel } from '@hcengineering/view'
|
import type { AttributeModel } from '@hcengineering/view'
|
||||||
|
import attachment from '@hcengineering/attachment'
|
||||||
import { Menu, ObjectPresenter } from '@hcengineering/view-resources'
|
import { Menu, ObjectPresenter } from '@hcengineering/view-resources'
|
||||||
import { ActivityKey, DisplayTx } from '../activity'
|
import { ActivityKey, DisplayTx } from '../activity'
|
||||||
import activity from '../plugin'
|
import activity from '../plugin'
|
||||||
@ -130,6 +131,9 @@
|
|||||||
function isMessageType (attr?: AnyAttribute): boolean {
|
function isMessageType (attr?: AnyAttribute): boolean {
|
||||||
return attr?.type._class === core.class.TypeMarkup
|
return attr?.type._class === core.class.TypeMarkup
|
||||||
}
|
}
|
||||||
|
function isAttachment (_class?: Ref<Class<Doc>>): boolean {
|
||||||
|
return _class === attachment.class.Attachment
|
||||||
|
}
|
||||||
|
|
||||||
async function updateMessageType (model: AttributeModel[], tx: DisplayTx): Promise<boolean> {
|
async function updateMessageType (model: AttributeModel[], tx: DisplayTx): Promise<boolean> {
|
||||||
for (const m of model) {
|
for (const m of model) {
|
||||||
@ -148,14 +152,21 @@
|
|||||||
hasMessageType = res
|
hasMessageType = res
|
||||||
})
|
})
|
||||||
$: isComment = viewlet && viewlet?.editable
|
$: isComment = viewlet && viewlet?.editable
|
||||||
|
$: isAttach = isAttachment(tx.tx.objectClass)
|
||||||
$: isMention = viewlet?.display === 'emphasized' || isMessageType(model[0]?.attribute)
|
$: isMention = viewlet?.display === 'emphasized' || isMessageType(model[0]?.attribute)
|
||||||
$: isColumn = isComment || isMention || hasMessageType
|
$: isColumn = isComment || isMention || hasMessageType
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if (viewlet !== undefined && !((viewlet?.hideOnRemove ?? false) && tx.removed)) || model.length > 0}
|
{#if (viewlet !== undefined && !((viewlet?.hideOnRemove ?? false) && tx.removed)) || model.length > 0}
|
||||||
<div class="msgactivity-container" class:showIcon class:withAvatar={isComment} class:isNew class:isNextNew>
|
<div
|
||||||
|
class="msgactivity-container"
|
||||||
|
class:showIcon
|
||||||
|
class:withAvatar={isComment || isAttach}
|
||||||
|
class:isNew
|
||||||
|
class:isNextNew
|
||||||
|
>
|
||||||
{#if showIcon}
|
{#if showIcon}
|
||||||
{#if isComment}
|
{#if isComment || isAttach}
|
||||||
<div class="msgactivity-avatar">
|
<div class="msgactivity-avatar">
|
||||||
<Component is={contact.component.Avatar} props={{ avatar: employee?.avatar, size: 'medium' }} />
|
<Component is={contact.component.Avatar} props={{ avatar: employee?.avatar, size: 'medium' }} />
|
||||||
</div>
|
</div>
|
||||||
@ -172,7 +183,7 @@
|
|||||||
{/if}
|
{/if}
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
<div class="msgactivity-content" class:content={isColumn} class:comment={isComment}>
|
<div class="msgactivity-content" class:content={isColumn} class:comment={isComment || isAttach}>
|
||||||
<div class="msgactivity-content__header">
|
<div class="msgactivity-content__header">
|
||||||
<div class="msgactivity-content__title labels-row">
|
<div class="msgactivity-content__title labels-row">
|
||||||
<span class="bold">
|
<span class="bold">
|
||||||
|
@ -110,7 +110,7 @@
|
|||||||
position: absolute;
|
position: absolute;
|
||||||
content: '';
|
content: '';
|
||||||
top: 50%;
|
top: 50%;
|
||||||
left: 0;
|
left: 0.125rem;
|
||||||
width: 0.25rem;
|
width: 0.25rem;
|
||||||
height: 0.25rem;
|
height: 0.25rem;
|
||||||
background-color: var(--tag-color);
|
background-color: var(--tag-color);
|
||||||
|
@ -18,10 +18,11 @@
|
|||||||
import { getBooleanLabel } from '../utils'
|
import { getBooleanLabel } from '../utils'
|
||||||
|
|
||||||
export let value: any
|
export let value: any
|
||||||
|
export let inline: boolean = false
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="flex-row-center yesno-container">
|
<div class="{inline ? 'inline-presenter' : 'flex-presenter'} yesno-container">
|
||||||
<BooleanIcon {value} />
|
<div class="icon small-gap"><BooleanIcon {value} /></div>
|
||||||
<span><Label label={getBooleanLabel(value)} /></span>
|
<span><Label label={getBooleanLabel(value)} /></span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -31,7 +32,6 @@
|
|||||||
user-select: none;
|
user-select: none;
|
||||||
|
|
||||||
span {
|
span {
|
||||||
margin-left: 0.25rem;
|
|
||||||
width: 1.6rem;
|
width: 1.6rem;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
text-transform: capitalize;
|
text-transform: capitalize;
|
||||||
|
Loading…
Reference in New Issue
Block a user