mirror of
https://github.com/hcengineering/platform.git
synced 2026-10-01 14:05:05 +02:00
Add notifications for reviewed documents (#10601)
* Send notification when document reviewed Signed-off-by: Artem Savchenko <armisav@gmail.com> * Clean up Signed-off-by: Artem Savchenko <armisav@gmail.com> --------- Signed-off-by: Artem Savchenko <armisav@gmail.com>
This commit is contained in:
@@ -448,6 +448,21 @@ async function CoAuthorsTypeMatch (
|
||||
return false
|
||||
}
|
||||
|
||||
async function DocumentReviewedTypeMatch (
|
||||
originTx: TxCUD<ControlledDocument>,
|
||||
_doc: Doc,
|
||||
_person: Ref<Person>,
|
||||
_socialIds: PersonId[],
|
||||
_type: NotificationType,
|
||||
_control: TriggerControl
|
||||
): Promise<boolean> {
|
||||
if (originTx._class !== core.class.TxUpdateDoc) return false
|
||||
|
||||
const tx = originTx as TxUpdateDoc<ControlledDocument>
|
||||
|
||||
return tx.operations.controlledState === ControlledDocumentState.Reviewed
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
||||
export default async () => ({
|
||||
trigger: {
|
||||
@@ -460,6 +475,7 @@ export default async () => ({
|
||||
function: {
|
||||
ControlledDocumentTextPresenter,
|
||||
ControlledDocumentHTMLPresenter,
|
||||
CoAuthorsTypeMatch
|
||||
CoAuthorsTypeMatch,
|
||||
DocumentReviewedTypeMatch
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user