diff --git a/models/notification/src/index.ts b/models/notification/src/index.ts index b092b10ef0..3142c6b0cf 100644 --- a/models/notification/src/index.ts +++ b/models/notification/src/index.ts @@ -238,6 +238,7 @@ export class TActivityInboxNotification extends TInboxNotification implements Ac @Model(notification.class.CommonInboxNotification, notification.class.InboxNotification) export class TCommonInboxNotification extends TInboxNotification implements CommonInboxNotification { + header?: IntlString @Prop(TypeIntlString(), notification.string.Message) message!: IntlString diff --git a/models/notification/src/migration.ts b/models/notification/src/migration.ts index fe838f407f..bfe0dacccb 100644 --- a/models/notification/src/migration.ts +++ b/models/notification/src/migration.ts @@ -32,10 +32,10 @@ import { tryMigrate } from '@hcengineering/model' import notification, { + type ActivityInboxNotification, type DocNotifyContext, type DocUpdates, type DocUpdateTx, - type InboxNotification, notificationId } from '@hcengineering/notification' import activity, { type ActivityMessage, type DocUpdateMessage } from '@hcengineering/activity' @@ -44,7 +44,7 @@ import { DOMAIN_NOTIFICATION } from './index' interface InboxData { context: DocNotifyContext - notifications: InboxNotification[] + notifications: ActivityInboxNotification[] } const DOMAIN_ACTIVITY = 'activity' as Domain @@ -105,7 +105,7 @@ async function getInboxNotifications ( client: MigrationClient, tx: DocUpdateTx, context: DocNotifyContext -): Promise { +): Promise { const messages = await getActivityMessages(client, tx, context) if (messages.length === 0) { @@ -114,7 +114,7 @@ async function getInboxNotifications ( return messages.map((message) => ({ _id: generateId(), - _class: notification.class.InboxNotification, + _class: notification.class.ActivityInboxNotification, space: context.space, user: context.user, isViewed: !tx.isNew, diff --git a/plugins/activity-resources/src/components/ActivityDocLink.svelte b/plugins/activity-resources/src/components/ActivityDocLink.svelte new file mode 100644 index 0000000000..8fc29546b8 --- /dev/null +++ b/plugins/activity-resources/src/components/ActivityDocLink.svelte @@ -0,0 +1,42 @@ + + + +{#if preposition} + +{/if} + + + {title} + + + + diff --git a/plugins/activity-resources/src/components/activity-message/ActivityMessageHeader.svelte b/plugins/activity-resources/src/components/activity-message/ActivityMessageHeader.svelte index 74f8b7c6fa..619cd4dc97 100644 --- a/plugins/activity-resources/src/components/activity-message/ActivityMessageHeader.svelte +++ b/plugins/activity-resources/src/components/activity-message/ActivityMessageHeader.svelte @@ -16,12 +16,13 @@ import { ActivityMessage } from '@hcengineering/activity' import { Person } from '@hcengineering/contact' import { Doc } from '@hcengineering/core' - import notification from '../../plugin' import { Label } from '@hcengineering/ui' - import { DocNavLink } from '@hcengineering/view-resources' - import { LinkData, getLinkData } from '../../activityMessagesUtils' import { IntlString } from '@hcengineering/platform' + import { LinkData, getLinkData } from '../../activityMessagesUtils' + import ActivityDocLink from '../ActivityDocLink.svelte' + import notification from '../../plugin' + export let message: ActivityMessage export let person: Person | undefined export let object: Doc | undefined @@ -43,15 +44,16 @@ {#if linkData} - - - - {linkData.title} - - - {#if isEdited} - - {/if} + +{/if} + +{#if isEdited} + {/if}