UBER-277 Reminders don't have notifications (#3315)

Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
Denis Bykhov
2023-06-01 12:48:36 +07:00
committed by GitHub
parent 58ba8fbe07
commit 2dfe0f330c
9 changed files with 79 additions and 7 deletions
@@ -38,7 +38,8 @@ import core, {
TxProcessor,
TxRemoveDoc,
TxUpdateDoc,
generateId
generateId,
matchQuery
} from '@hcengineering/core'
import notification, {
ClassCollaborators,
@@ -159,11 +160,17 @@ async function getHtmlPart (doc: Doc, control: TriggerControl): Promise<string |
return htmlPart
}
function getHTMLPresenter (_class: Ref<Class<Doc>>, hierarchy: Hierarchy): HTMLPresenter | undefined {
/**
* @public
*/
export function getHTMLPresenter (_class: Ref<Class<Doc>>, hierarchy: Hierarchy): HTMLPresenter | undefined {
return hierarchy.classHierarchyMixin(_class, serverNotification.mixin.HTMLPresenter)
}
function getTextPresenter (_class: Ref<Class<Doc>>, hierarchy: Hierarchy): TextPresenter | undefined {
/**
* @public
*/
export function getTextPresenter (_class: Ref<Class<Doc>>, hierarchy: Hierarchy): TextPresenter | undefined {
return hierarchy.classHierarchyMixin(_class, serverNotification.mixin.TextPresenter)
}
@@ -362,6 +369,10 @@ function isTypeMatched (
if (!fieldUpdated(type.field, (extractedTx as TxMixin<Doc, Doc>).attributes)) return false
}
}
if (type.txMatch !== undefined) {
const res = matchQuery([extractedTx], type.txMatch, extractedTx._class, control.hierarchy, true)
if (res.length === 0) return false
}
return true
}