diff --git a/plugins/activity-resources/src/activityMessagesUtils.ts b/plugins/activity-resources/src/activityMessagesUtils.ts index 72623ba79e9..9fbcd5815e4 100644 --- a/plugins/activity-resources/src/activityMessagesUtils.ts +++ b/plugins/activity-resources/src/activityMessagesUtils.ts @@ -244,7 +244,7 @@ function groupByTime (messages: T[]): T[][] { function getDocUpdateMessageKey (message: DocUpdateMessage): string { const personAccountById = get(personAccountByIdStore) - const person = personAccountById.get(message.modifiedBy as any)?.person ?? message.modifiedBy + const person = personAccountById.get(message.createdBy as any)?.person ?? message.createdBy if (message.action === 'update') { return [message._class, message.attachedTo, message.action, person, getAttributeUpdatesKey(message)].join('_') diff --git a/plugins/activity-resources/src/components/Replies.svelte b/plugins/activity-resources/src/components/Replies.svelte index fd185721095..309cda26d63 100644 --- a/plugins/activity-resources/src/components/Replies.svelte +++ b/plugins/activity-resources/src/components/Replies.svelte @@ -86,6 +86,7 @@ } const loc = getLocation() loc.path[4] = message._id + loc.query = { ...loc.query, thread: message._id } navigate(loc) } diff --git a/plugins/activity-resources/src/components/activity-message/ActivityMessageTemplate.svelte b/plugins/activity-resources/src/components/activity-message/ActivityMessageTemplate.svelte index fe1a2c34f6f..1a9b59c1316 100644 --- a/plugins/activity-resources/src/components/activity-message/ActivityMessageTemplate.svelte +++ b/plugins/activity-resources/src/components/activity-message/ActivityMessageTemplate.svelte @@ -178,8 +178,9 @@ class:opened={isActionMenuOpened || message.isPinned} > {#if withActions} + + {#if withFlatActions} - @@ -231,11 +232,9 @@ } &.embedded { - padding: 0; - - .content { - padding: 0.75rem 0.75rem 0.75rem 0; - } + padding: 0.75rem 0 0 0; + gap: 0.25rem; + border-radius: 0; } .actions { @@ -292,7 +291,7 @@ } .embeddedMarker { - width: 6px; + width: 0.25rem; border-radius: 0.5rem; background: var(--secondary-button-default); } diff --git a/plugins/activity-resources/src/components/reactions/ReactionNotificationPresenter.svelte b/plugins/activity-resources/src/components/reactions/ReactionNotificationPresenter.svelte index 2adc4f3b25d..5a99f747223 100644 --- a/plugins/activity-resources/src/components/reactions/ReactionNotificationPresenter.svelte +++ b/plugins/activity-resources/src/components/reactions/ReactionNotificationPresenter.svelte @@ -41,8 +41,10 @@ function handleReply (): void { const loc = getLocation() + loc.fragment = notification.docNotifyContext - loc.query = { message: notification.attachedTo } + loc.query = { thread: parentMessage?._id ?? message._id } + navigate(loc) } diff --git a/plugins/activity-resources/src/index.ts b/plugins/activity-resources/src/index.ts index 20ad3d42731..85a9660d31d 100644 --- a/plugins/activity-resources/src/index.ts +++ b/plugins/activity-resources/src/index.ts @@ -38,6 +38,7 @@ export { default as ActivityDocLink } from './components/ActivityDocLink.svelte' export { default as ReactionPresenter } from './components/reactions/ReactionPresenter.svelte' export { default as ActivityMessageNotificationLabel } from './components/activity-message/ActivityMessageNotificationLabel.svelte' export { default as ActivityMessageHeader } from './components/activity-message/ActivityMessageHeader.svelte' +export { default as AddReactionAction } from './components/reactions/AddReactionAction.svelte' export default async (): Promise => ({ component: { diff --git a/plugins/chunter-resources/src/components/Channel.svelte b/plugins/chunter-resources/src/components/Channel.svelte index 00a68fdf650..5df6b9ea4a4 100644 --- a/plugins/chunter-resources/src/components/Channel.svelte +++ b/plugins/chunter-resources/src/components/Channel.svelte @@ -48,7 +48,7 @@ onDestroy(unsubscribe) - $: isDocChannel = !hierarchy.isDerived(context.attachedToClass, chunter.class.ChunterSpace) + $: isDocChannel = !hierarchy.isDerived(object._class, chunter.class.ChunterSpace) $: messagesClass = isDocChannel ? activity.class.ActivityMessage : chunter.class.ChatMessage $: collection = isDocChannel ? 'comments' : 'messages' diff --git a/plugins/chunter-resources/src/components/ChannelPanel.svelte b/plugins/chunter-resources/src/components/ChannelPanel.svelte index 5221e8f0e31..c7557c5e988 100644 --- a/plugins/chunter-resources/src/components/ChannelPanel.svelte +++ b/plugins/chunter-resources/src/components/ChannelPanel.svelte @@ -13,13 +13,13 @@ // limitations under the License. --> {#if visibleNotification} @@ -74,13 +105,15 @@ > {#if isCompact} -
- -
-
+
+ {#if message} + + {/if} + +
{:else}
@@ -96,30 +129,23 @@ {:else}
- {#await getDocIdentifier(client, value.attachedTo, value.attachedToClass) then title} - {#if title} - {title} - {:else} -
{/if} - -
- -
- -
- -
- +
+ +
+
+ +
@@ -135,7 +161,8 @@ cursor: pointer; border: 1px solid transparent; border-radius: 0.5rem; - padding: 0 1rem; + padding: 0.5rem 1rem; + padding-right: 0; margin: 0.5rem 0; &.compact { @@ -155,6 +182,22 @@ font-weight: 500; max-width: 20.5rem; } + + .actions { + position: absolute; + visibility: hidden; + top: 0.75rem; + right: 0.75rem; + color: var(--theme-halfcontent-color); + + &.opened { + visibility: visible; + } + } + + &:hover > .actions { + visibility: visible; + } } .labels { @@ -163,28 +206,17 @@ } .notification { - margin-top: 1rem; + margin-top: 0.25rem; margin-left: 4rem; } .notifyMarker { position: absolute; - right: 1.875rem; - top: 0; - - &.compact { - right: 2.875rem; - top: 0.5rem; - } - } - - .actions { - position: absolute; - right: 0; + left: 0.25rem; top: 0; &.compact { - right: 1rem; + left: 0.25rem; top: 0.5rem; } } diff --git a/plugins/notification-resources/src/components/inbox/ActivityInboxNotificationPresenter.svelte b/plugins/notification-resources/src/components/inbox/ActivityInboxNotificationPresenter.svelte index 71d36fa38b0..e1e7e4c88d4 100644 --- a/plugins/notification-resources/src/components/inbox/ActivityInboxNotificationPresenter.svelte +++ b/plugins/notification-resources/src/components/inbox/ActivityInboxNotificationPresenter.svelte @@ -40,8 +40,8 @@ const client = getClient() const messagesQuery = createQuery() - const notificationsClient = InboxNotificationsClientImpl.getClient() - const notificationsStore = notificationsClient.inboxNotifications + const inboxClient = InboxNotificationsClientImpl.getClient() + const notificationsStore = inboxClient.inboxNotifications let messages: ActivityMessage[] = [] let viewlet: ActivityNotificationViewlet | undefined = undefined @@ -81,6 +81,7 @@ function updateViewlet (viewlets: ActivityNotificationViewlet[], message?: DisplayActivityMessage) { if (viewlets.length === 0 || message === undefined) { + viewlet = undefined return } @@ -91,6 +92,8 @@ return } } + + viewlet = undefined } function handleReply (message?: DisplayActivityMessage): void { @@ -99,7 +102,7 @@ } const loc = getLocation() loc.fragment = value.docNotifyContext - loc.query = { message: message._id } + loc.query = { thread: message._id } navigate(loc) } diff --git a/plugins/notification-resources/src/components/inbox/Inbox.svelte b/plugins/notification-resources/src/components/inbox/Inbox.svelte index 99fdb3d8e8d..23a52b3e6ce 100644 --- a/plugins/notification-resources/src/components/inbox/Inbox.svelte +++ b/plugins/notification-resources/src/components/inbox/Inbox.svelte @@ -96,6 +96,10 @@ $: filteredNotifications = filterNotifications(selectedTabId, displayNotifications, $notifyContextsStore) + locationStore.subscribe((newLocation) => { + syncLocation(newLocation) + }) + async function syncLocation (newLocation: Location) { const loc = await resolveLocation(newLocation) diff --git a/plugins/notification-resources/src/utils.ts b/plugins/notification-resources/src/utils.ts index ad27bd6c360..ee2ab4d2010 100644 --- a/plugins/notification-resources/src/utils.ts +++ b/plugins/notification-resources/src/utils.ts @@ -49,16 +49,9 @@ import { InboxNotificationsClientImpl } from './inboxNotificationsClient' * @public */ export async function hasMarkAsUnreadAction (doc: DisplayInboxNotification): Promise { - const inboxNotificationsClient = InboxNotificationsClientImpl.getClient() - - const combinedIds = - doc._class === notification.class.ActivityInboxNotification - ? (doc as DisplayActivityInboxNotification).combinedIds - : [doc._id] + const canRead = await hasMarkAsReadAction(doc) - return get(inboxNotificationsClient.inboxNotifications).some( - ({ _id, isViewed }) => combinedIds.includes(_id) && isViewed - ) + return !canRead } export async function hasMarkAsReadAction (doc: DisplayInboxNotification): Promise { @@ -353,11 +346,11 @@ async function generateLocation ( loc: { path: [appComponent, workspace, inboxId], fragment: contextId, - query: { message: message !== undefined ? (messageId as string) : null } + query: { ...loc.query, message: message !== undefined ? (messageId as string) : null } }, defaultLocation: { path: [appComponent, workspace, inboxId], - query: { message: message !== undefined ? (messageId as string) : null } + query: { ...loc.query, message: message !== undefined ? (messageId as string) : null } } } }