Fix header of mention push (#5591)

Signed-off-by: Kristina Fefelova <kristin.fefelova@gmail.com>
This commit is contained in:
Kristina 2024-05-14 12:40:48 +04:00 committed by GitHub
parent 7b999d7b47
commit b60067cc92
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 16 additions and 5 deletions

View File

@ -38,7 +38,7 @@
"Mentioned": "Mentioned",
"You": "You",
"Mentions": "Mentions",
"MentionedYouIn": "Mentioned you in",
"MentionedYouIn": "Mentioned you in {title}",
"Messages": "Messages",
"Thread": "Thread",
"AddReaction": "Add reaction",

View File

@ -37,6 +37,6 @@
"Mentioned": "Mencionado",
"You": "Tú",
"Mentions": "Menciones",
"MentionedYouIn": "Has sido Mencionado en"
"MentionedYouIn": "Has sido Mencionado en {title}"
}
}

View File

@ -37,6 +37,6 @@
"Mentioned": "Mencionado",
"You": "Tu",
"Mentions": "Menções",
"MentionedYouIn": "Foste Mencionado em"
"MentionedYouIn": "Foste Mencionado em {title}"
}
}

View File

@ -38,7 +38,7 @@
"Mentioned": "Упомянул(а)",
"You": "Вы",
"Mentions": "Упоминания",
"MentionedYouIn": "Упомянул(а) вас в",
"MentionedYouIn": "Упомянул(а) вас в {title}",
"Messages": "Cообщения",
"Thread": "Обсуждение",
"AddReaction": "Добавить реакцию",

View File

@ -41,6 +41,7 @@
export let headerObject: Doc | undefined = undefined
export let headerIcon: Asset | undefined = undefined
export let header: IntlString | undefined = undefined
export let headerParams: Record<string, any> = {}
const client = getClient()
const limit = 300
@ -124,7 +125,10 @@
{#if !isCompact}
{#if headerObject}
<DocNavLink object={headerObject} colorInherit>
<Label label={header ?? client.getHierarchy().getClass(headerObject._class).label} />
<Label
label={header ?? client.getHierarchy().getClass(headerObject._class).label}
params={headerParams}
/>
</DocNavLink>
{:else if person}
<EmployeePresenter value={person} shouldShowAvatar={false} compact showStatus={false} />

View File

@ -47,6 +47,7 @@
<BasePreview
headerIcon={value.headerIcon}
header={value.header}
headerParams={value.intlParams}
{headerObject}
text={content}
account={value.createdBy ?? value.modifiedBy}

View File

@ -304,6 +304,12 @@ async function getMessageNotifyResult (
return { allowed: false, emails: [], push: false }
}
const mixin = control.hierarchy.as(doc, notification.mixin.Collaborators)
if (mixin === undefined || !mixin.collaborators.includes(receiver)) {
return { allowed: false, emails: [], push: false }
}
if (!hierarchy.isDerived(reference.attachedDocClass, activity.class.ActivityMessage)) {
return { allowed: false, emails: [], push: false }
}