mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-17 05:47:32 +00:00
UBERF-5232: fix wrong activity message title (#4498)
Signed-off-by: Kristina Fefelova <kristin.fefelova@gmail.com>
This commit is contained in:
parent
498fe01395
commit
bc9d3e396d
plugins/activity-resources/src/components/doc-update-message
@ -13,11 +13,8 @@
|
|||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
-->
|
-->
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { AttachedDoc, Attribute, Class, Collection, Doc, Ref } from '@hcengineering/core'
|
|
||||||
import { Icon, Label } from '@hcengineering/ui'
|
import { Icon, Label } from '@hcengineering/ui'
|
||||||
import { IntlString } from '@hcengineering/platform'
|
import { Asset, IntlString } from '@hcengineering/platform'
|
||||||
import { getClient } from '@hcengineering/presentation'
|
|
||||||
import view from '@hcengineering/view'
|
|
||||||
import activity, { DisplayDocUpdateMessage, DocUpdateMessage, DocUpdateMessageViewlet } from '@hcengineering/activity'
|
import activity, { DisplayDocUpdateMessage, DocUpdateMessage, DocUpdateMessageViewlet } from '@hcengineering/activity'
|
||||||
|
|
||||||
import DocUpdateMessageObjectValue from './DocUpdateMessageObjectValue.svelte'
|
import DocUpdateMessageObjectValue from './DocUpdateMessageObjectValue.svelte'
|
||||||
@ -26,11 +23,7 @@
|
|||||||
export let viewlet: DocUpdateMessageViewlet | undefined
|
export let viewlet: DocUpdateMessageViewlet | undefined
|
||||||
export let objectName: IntlString | undefined
|
export let objectName: IntlString | undefined
|
||||||
export let collectionName: IntlString | undefined
|
export let collectionName: IntlString | undefined
|
||||||
export let collectionAttribute: Attribute<Collection<AttachedDoc>> | undefined = undefined
|
export let objectIcon: Asset | undefined
|
||||||
|
|
||||||
const client = getClient()
|
|
||||||
const hierarchy = client.getHierarchy()
|
|
||||||
const clazz = hierarchy.getClass(message.objectClass)
|
|
||||||
|
|
||||||
const isOwn = message.objectId === message.attachedTo
|
const isOwn = message.objectId === message.attachedTo
|
||||||
|
|
||||||
@ -38,12 +31,11 @@
|
|||||||
|
|
||||||
$: valueMessages = message.previousMessages?.length ? [...message.previousMessages, message] : [message]
|
$: valueMessages = message.previousMessages?.length ? [...message.previousMessages, message] : [message]
|
||||||
$: hasDifferentActions = message.previousMessages?.some(({ action }) => action !== message.action)
|
$: hasDifferentActions = message.previousMessages?.some(({ action }) => action !== message.action)
|
||||||
$: icon = viewlet?.icon ?? collectionAttribute?.icon ?? clazz.icon ?? activity.icon.Activity
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<span class="mr-1">
|
<span class="mr-1">
|
||||||
<Icon {icon} size="small" />
|
<Icon icon={viewlet?.icon ?? objectIcon ?? activity.icon.Activity} size="small" />
|
||||||
</span>
|
</span>
|
||||||
{#if hasDifferentActions}
|
{#if hasDifferentActions}
|
||||||
<Label label={activity.string.UpdatedCollection} />
|
<Label label={activity.string.UpdatedCollection} />
|
||||||
|
@ -27,6 +27,7 @@
|
|||||||
import { createQuery, getClient } from '@hcengineering/presentation'
|
import { createQuery, getClient } from '@hcengineering/presentation'
|
||||||
import { Component, ShowMore, Action } from '@hcengineering/ui'
|
import { Component, ShowMore, Action } from '@hcengineering/ui'
|
||||||
import { AttributeModel } from '@hcengineering/view'
|
import { AttributeModel } from '@hcengineering/view'
|
||||||
|
import { buildRemovedDoc, checkIsObjectRemoved } from '@hcengineering/view-resources'
|
||||||
|
|
||||||
import ActivityMessageTemplate from '../activity-message/ActivityMessageTemplate.svelte'
|
import ActivityMessageTemplate from '../activity-message/ActivityMessageTemplate.svelte'
|
||||||
import DocUpdateMessageAttributes from './DocUpdateMessageAttributes.svelte'
|
import DocUpdateMessageAttributes from './DocUpdateMessageAttributes.svelte'
|
||||||
@ -34,7 +35,6 @@
|
|||||||
import DocUpdateMessageHeader from './DocUpdateMessageHeader.svelte'
|
import DocUpdateMessageHeader from './DocUpdateMessageHeader.svelte'
|
||||||
|
|
||||||
import { getAttributeModel, getCollectionAttribute } from '../../activityMessagesUtils'
|
import { getAttributeModel, getCollectionAttribute } from '../../activityMessagesUtils'
|
||||||
import { buildRemovedDoc, checkIsObjectRemoved } from '@hcengineering/view-resources'
|
|
||||||
|
|
||||||
export let value: DisplayDocUpdateMessage
|
export let value: DisplayDocUpdateMessage
|
||||||
export let showNotify: boolean = false
|
export let showNotify: boolean = false
|
||||||
@ -60,11 +60,14 @@
|
|||||||
const objectQuery = createQuery()
|
const objectQuery = createQuery()
|
||||||
const parentObjectQuery = createQuery()
|
const parentObjectQuery = createQuery()
|
||||||
|
|
||||||
const collectionAttribute = getCollectionAttribute(hierarchy, value.attachedToClass, value.updateCollection)
|
let objectName: IntlString | undefined = undefined
|
||||||
const clazz = hierarchy.getClass(value.objectClass)
|
let collectionName: IntlString | undefined = undefined
|
||||||
const objectName: IntlString | undefined =
|
|
||||||
(collectionAttribute?.type as Collection<AttachedDoc>)?.itemLabel || clazz.label
|
$: collectionAttribute = getCollectionAttribute(hierarchy, value.attachedToClass, value.updateCollection)
|
||||||
const collectionName = collectionAttribute?.label
|
$: clazz = hierarchy.getClass(value.objectClass)
|
||||||
|
|
||||||
|
$: objectName = (collectionAttribute?.type as Collection<AttachedDoc>)?.itemLabel || clazz.label
|
||||||
|
$: collectionName = collectionAttribute?.label
|
||||||
|
|
||||||
let user: PersonAccount | undefined = undefined
|
let user: PersonAccount | undefined = undefined
|
||||||
let person: Person | undefined = undefined
|
let person: Person | undefined = undefined
|
||||||
@ -190,7 +193,13 @@
|
|||||||
</ShowMore>
|
</ShowMore>
|
||||||
{:else if value.action === 'create' || value.action === 'remove'}
|
{:else if value.action === 'create' || value.action === 'remove'}
|
||||||
<ShowMore>
|
<ShowMore>
|
||||||
<DocUpdateMessageContent message={value} {viewlet} {objectName} {collectionName} {collectionAttribute} />
|
<DocUpdateMessageContent
|
||||||
|
message={value}
|
||||||
|
{viewlet}
|
||||||
|
{objectName}
|
||||||
|
{collectionName}
|
||||||
|
objectIcon={collectionAttribute?.icon ?? clazz.icon}
|
||||||
|
/>
|
||||||
</ShowMore>
|
</ShowMore>
|
||||||
{:else if value.attributeUpdates && attributeModel}
|
{:else if value.attributeUpdates && attributeModel}
|
||||||
<DocUpdateMessageAttributes attributeUpdates={value.attributeUpdates} {attributeModel} {viewlet} />
|
<DocUpdateMessageAttributes attributeUpdates={value.attributeUpdates} {attributeModel} {viewlet} />
|
||||||
|
Loading…
Reference in New Issue
Block a user