From ab3df02270607c421bca335eae30361a43e5096e Mon Sep 17 00:00:00 2001 From: Kristina Date: Wed, 9 Oct 2024 15:19:00 +0400 Subject: [PATCH] Chat fixes (#6851) Signed-off-by: Kristina Fefelova --- models/chunter/src/index.ts | 18 ++++++------------ models/chunter/src/migration.ts | 11 +++++++++++ .../components/chat/navigator/NavItem.svelte | 16 ++++++++++++++-- .../src/components/NotifyMarker.svelte | 12 +----------- 4 files changed, 32 insertions(+), 25 deletions(-) diff --git a/models/chunter/src/index.ts b/models/chunter/src/index.ts index 5f13dd5033..b8bb7da2ca 100644 --- a/models/chunter/src/index.ts +++ b/models/chunter/src/index.ts @@ -221,8 +221,12 @@ export function createModel (builder: Builder): void { builder.createDoc>(activity.class.ActivityMessageControl, core.space.Model, { objectClass: chunter.class.DirectMessage, - skip: [{ _class: core.class.TxMixin }, { _class: core.class.TxCreateDoc }, { _class: core.class.TxRemoveDoc }], - allowedFields: ['members'] + skip: [ + { _class: core.class.TxMixin }, + { _class: core.class.TxCreateDoc }, + { _class: core.class.TxRemoveDoc }, + { _class: core.class.TxUpdateDoc } + ] }) builder.createDoc(activity.class.DocUpdateMessageViewlet, core.space.Model, { @@ -241,16 +245,6 @@ export function createModel (builder: Builder): void { } }) - builder.createDoc(activity.class.DocUpdateMessageViewlet, core.space.Model, { - objectClass: chunter.class.DirectMessage, - action: 'update', - config: { - members: { - presenter: chunter.activity.MembersChangedMessage - } - } - }) - builder.mixin(chunter.class.ChatMessage, core.class.Class, activity.mixin.ActivityMessagePreview, { presenter: chunter.component.ChatMessagePreview }) diff --git a/models/chunter/src/migration.ts b/models/chunter/src/migration.ts index 14e1638d62..70d2c2151c 100644 --- a/models/chunter/src/migration.ts +++ b/models/chunter/src/migration.ts @@ -351,6 +351,17 @@ export const chunterOperation: MigrateOperation = { func: async (client) => { await removeDuplicatedDirects(client) } + }, + { + state: 'remove-direct-members-messages', + func: async (client) => { + await client.deleteMany(DOMAIN_ACTIVITY, { + _class: activity.class.DocUpdateMessage, + attachedToClass: chunter.class.DirectMessage, + action: 'update', + 'attributeUpdates.attrKey': 'members' + }) + } } ]) }, diff --git a/plugins/chunter-resources/src/components/chat/navigator/NavItem.svelte b/plugins/chunter-resources/src/components/chat/navigator/NavItem.svelte index aba8a60fec..d9aa6e54be 100644 --- a/plugins/chunter-resources/src/components/chat/navigator/NavItem.svelte +++ b/plugins/chunter-resources/src/components/chat/navigator/NavItem.svelte @@ -98,11 +98,15 @@ {#if count != null && count > 0}
- +
+ +
{:else if secondaryNotifyMarker}
- +
+ +
{/if} @@ -126,4 +130,12 @@ background-color: var(--global-ui-highlight-BackgroundColor); } } + + .notify { + display: flex; + align-items: center; + justify-content: center; + width: 1rem; + height: 1rem; + } diff --git a/plugins/notification-resources/src/components/NotifyMarker.svelte b/plugins/notification-resources/src/components/NotifyMarker.svelte index e4e5e19469..b9cf69670a 100644 --- a/plugins/notification-resources/src/components/NotifyMarker.svelte +++ b/plugins/notification-resources/src/components/NotifyMarker.svelte @@ -14,7 +14,7 @@ -->