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:
Alexander Platov 2023-04-03 22:08:08 +03:00 committed by GitHub
parent e7483daa00
commit 7868126e15
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 21 additions and 9 deletions

View File

@ -42,6 +42,7 @@
"@hcengineering/contact": "^0.6.11",
"@hcengineering/notification": "^0.6.8",
"@hcengineering/view": "^0.6.2",
"@hcengineering/view-resources": "^0.6.0"
"@hcengineering/view-resources": "^0.6.0",
"@hcengineering/attachment": "^0.6.1"
}
}

View File

@ -16,7 +16,7 @@
<script lang="ts">
import type { TxViewlet } from '@hcengineering/activity'
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 { createQuery, getClient } from '@hcengineering/presentation'
import {
@ -31,6 +31,7 @@
TimeSince
} from '@hcengineering/ui'
import type { AttributeModel } from '@hcengineering/view'
import attachment from '@hcengineering/attachment'
import { Menu, ObjectPresenter } from '@hcengineering/view-resources'
import { ActivityKey, DisplayTx } from '../activity'
import activity from '../plugin'
@ -130,6 +131,9 @@
function isMessageType (attr?: AnyAttribute): boolean {
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> {
for (const m of model) {
@ -148,14 +152,21 @@
hasMessageType = res
})
$: isComment = viewlet && viewlet?.editable
$: isAttach = isAttachment(tx.tx.objectClass)
$: isMention = viewlet?.display === 'emphasized' || isMessageType(model[0]?.attribute)
$: isColumn = isComment || isMention || hasMessageType
</script>
{#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 isComment}
{#if isComment || isAttach}
<div class="msgactivity-avatar">
<Component is={contact.component.Avatar} props={{ avatar: employee?.avatar, size: 'medium' }} />
</div>
@ -172,7 +183,7 @@
{/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__title labels-row">
<span class="bold">

View File

@ -110,7 +110,7 @@
position: absolute;
content: '';
top: 50%;
left: 0;
left: 0.125rem;
width: 0.25rem;
height: 0.25rem;
background-color: var(--tag-color);

View File

@ -18,10 +18,11 @@
import { getBooleanLabel } from '../utils'
export let value: any
export let inline: boolean = false
</script>
<div class="flex-row-center yesno-container">
<BooleanIcon {value} />
<div class="{inline ? 'inline-presenter' : 'flex-presenter'} yesno-container">
<div class="icon small-gap"><BooleanIcon {value} /></div>
<span><Label label={getBooleanLabel(value)} /></span>
</div>
@ -31,7 +32,6 @@
user-select: none;
span {
margin-left: 0.25rem;
width: 1.6rem;
white-space: nowrap;
text-transform: capitalize;