Chat fixes (#6851)

Signed-off-by: Kristina Fefelova <kristin.fefelova@gmail.com>
This commit is contained in:
Kristina 2024-10-09 15:19:00 +04:00 committed by GitHub
parent d6bbe79c88
commit ab3df02270
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 32 additions and 25 deletions

View File

@ -221,8 +221,12 @@ export function createModel (builder: Builder): void {
builder.createDoc<ActivityMessageControl<ChunterSpace>>(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
})

View File

@ -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<DocUpdateMessage>(DOMAIN_ACTIVITY, {
_class: activity.class.DocUpdateMessage,
attachedToClass: chunter.class.DirectMessage,
action: 'update',
'attributeUpdates.attrKey': 'members'
})
}
}
])
},

View File

@ -98,11 +98,15 @@
<svelte:fragment slot="notify">
{#if count != null && count > 0}
<div class="antiHSpacer" />
<NotifyMarker {count} />
<div class="notify">
<NotifyMarker {count} />
</div>
<div class="antiHSpacer" />
{:else if secondaryNotifyMarker}
<div class="antiHSpacer" />
<NotifyMarker count={0} kind="with-dot" />
<div class="notify">
<NotifyMarker count={0} kind="simple" size="xx-small" />
</div>
<div class="antiHSpacer" />
{/if}
</svelte:fragment>
@ -126,4 +130,12 @@
background-color: var(--global-ui-highlight-BackgroundColor);
}
}
.notify {
display: flex;
align-items: center;
justify-content: center;
width: 1rem;
height: 1rem;
}
</style>

View File

@ -14,7 +14,7 @@
-->
<script lang="ts">
export let count: number = 0
export let kind: 'primary' | 'simple' | 'with-dot' = 'primary'
export let kind: 'primary' | 'simple' = 'primary'
export let size: 'xx-small' | 'x-small' | 'small' | 'medium' = 'small'
const maxNumber = 9
@ -34,10 +34,6 @@
<div class="notifyMarker {size} {kind}" />
{/if}
{#if kind === 'with-dot'}
<div class="notifyMarker {size} {kind}"></div>
{/if}
<style lang="scss">
.notifyMarker {
display: flex;
@ -48,7 +44,6 @@
font-weight: 700;
&.simple,
&.with-dot,
&.primary {
background-color: var(--global-higlight-Color);
color: var(--global-on-accent-TextColor);
@ -75,10 +70,5 @@
height: 1.25rem;
font-size: 0.625rem;
}
&.with-dot {
font-weight: 400;
font-size: 0.25rem;
}
}
</style>