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:
Artyom Savchenko
2026-03-10 10:25:46 +07:00
committed by GitHub
parent eb3317b1fd
commit cad04875f7
5 changed files with 57 additions and 4 deletions
@@ -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
}
})