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", "Mentioned": "Mentioned",
"You": "You", "You": "You",
"Mentions": "Mentions", "Mentions": "Mentions",
"MentionedYouIn": "Mentioned you in", "MentionedYouIn": "Mentioned you in {title}",
"Messages": "Messages", "Messages": "Messages",
"Thread": "Thread", "Thread": "Thread",
"AddReaction": "Add reaction", "AddReaction": "Add reaction",

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -304,6 +304,12 @@ async function getMessageNotifyResult (
return { allowed: false, emails: [], push: false } 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)) { if (!hierarchy.isDerived(reference.attachedDocClass, activity.class.ActivityMessage)) {
return { allowed: false, emails: [], push: false } return { allowed: false, emails: [], push: false }
} }