diff --git a/models/controlled-documents/src/index.ts b/models/controlled-documents/src/index.ts index 78395b2a3d..3897bac4c0 100644 --- a/models/controlled-documents/src/index.ts +++ b/models/controlled-documents/src/index.ts @@ -926,6 +926,11 @@ export function defineNotifications (builder: Builder): void { [notification.providers.PlatformNotification]: true, [notification.providers.BrowserNotification]: false, [notification.providers.EmailNotification]: false + }, + templates: { + textTemplate: '{sender} changed {doc} status', + htmlTemplate: '
{sender} changed {doc} status
', + subjectTemplate: '{doc} status changed' } }, documents.notification.StateNotification @@ -941,12 +946,17 @@ export function defineNotifications (builder: Builder): void { label: documents.string.CoAuthors, group: documents.notification.DocumentsNotificationGroup, field: 'coAuthors', - txClasses: [core.class.TxUpdateDoc], + txClasses: [core.class.TxCreateDoc, core.class.TxUpdateDoc], objectClass: documents.class.ControlledDocument, providers: { [notification.providers.PlatformNotification]: true, - [notification.providers.BrowserNotification]: false, - [notification.providers.EmailNotification]: false + [notification.providers.BrowserNotification]: true, + [notification.providers.EmailNotification]: true + }, + templates: { + textTemplate: '{sender} assigned you as a co-author of {doc}', + htmlTemplate: '{sender} assigned you as a co-author of {doc}
', + subjectTemplate: 'Co-authoring assignment for {doc}' } }, documents.notification.CoAuthorsNotification @@ -978,7 +988,7 @@ export function defineNotifications (builder: Builder): void { 'changeControl', 'coAuthors' ], - ['owner'] + ['owner', 'comments', 'reviewers', 'approvers'] ) } diff --git a/models/controlled-documents/src/types.ts b/models/controlled-documents/src/types.ts index f6faafadb5..a40f13b757 100644 --- a/models/controlled-documents/src/types.ts +++ b/models/controlled-documents/src/types.ts @@ -270,7 +270,6 @@ export class TDocument extends TDoc implements Document { state!: DocumentState @Prop(TypeCollaborativeDoc(), documents.string.CollaborativeDocument) - @Hidden() content!: CollaborativeDoc @Prop(Collection(tags.class.TagReference), documents.string.Labels) diff --git a/models/document/src/index.ts b/models/document/src/index.ts index f731f14beb..ce4dd7eddf 100644 --- a/models/document/src/index.ts +++ b/models/document/src/index.ts @@ -93,7 +93,6 @@ export class TDocument extends TAttachedDoc implements Document { name!: string @Prop(TypeCollaborativeDoc(), document.string.Document) - @Hidden() content!: CollaborativeDoc @Prop(TypeRef(core.class.Account), document.string.LockedBy) diff --git a/models/request/src/index.ts b/models/request/src/index.ts index 2634bb6b64..a6d0bf2ef4 100644 --- a/models/request/src/index.ts +++ b/models/request/src/index.ts @@ -135,9 +135,14 @@ export function createModel (builder: Builder): void { label: request.string.Request, allowedForAuthor: true, providers: { - [notification.providers.BrowserNotification]: false, + [notification.providers.BrowserNotification]: true, [notification.providers.PlatformNotification]: true, - [notification.providers.EmailNotification]: false + [notification.providers.EmailNotification]: true + }, + templates: { + textTemplate: '{sender} sent you a {doc}', + htmlTemplate: '{sender} sent you a {doc}
', + subjectTemplate: '{doc}' } }, request.ids.CreateRequestNotification diff --git a/models/server-request/package.json b/models/server-request/package.json index acda396189..2c2f390b8b 100644 --- a/models/server-request/package.json +++ b/models/server-request/package.json @@ -33,6 +33,8 @@ "@hcengineering/model-core": "^0.6.0", "@hcengineering/platform": "^0.6.11", "@hcengineering/server-request": "^0.6.0", - "@hcengineering/server-core": "^0.6.1" + "@hcengineering/server-core": "^0.6.1", + "@hcengineering/model-request": "^0.6.0", + "@hcengineering/server-notification": "^0.6.1" } } diff --git a/models/server-request/src/index.ts b/models/server-request/src/index.ts index 177b3df120..007cceb17d 100644 --- a/models/server-request/src/index.ts +++ b/models/server-request/src/index.ts @@ -18,6 +18,8 @@ import { type Builder } from '@hcengineering/model' import core from '@hcengineering/core' import serverCore from '@hcengineering/server-core' import serverRequest from '@hcengineering/server-request' +import serverNotification from '@hcengineering/server-notification' +import request from '@hcengineering/model-request' export { serverRequestId } from '@hcengineering/server-request' @@ -25,4 +27,8 @@ export function createModel (builder: Builder): void { builder.createDoc(serverCore.class.Trigger, core.space.Model, { trigger: serverRequest.trigger.OnRequest }) + + builder.mixin(request.class.Request, core.class.Class, serverNotification.mixin.TextPresenter, { + presenter: serverRequest.function.RequestTextPresenter + }) } diff --git a/models/view/src/index.ts b/models/view/src/index.ts index c939c22683..8b378b6a8b 100644 --- a/models/view/src/index.ts +++ b/models/view/src/index.ts @@ -500,6 +500,10 @@ export function createModel (builder: Builder): void { editor: view.component.CollaborativeDocEditor }) + builder.mixin(core.class.TypeCollaborativeDoc, core.class.Class, view.mixin.ActivityAttributePresenter, { + presenter: view.component.CollaborativeDocActivityPresenter + }) + builder.mixin(core.class.TypeCollaborativeDocVersion, core.class.Class, view.mixin.InlineAttributEditor, { editor: view.component.CollaborativeDocEditor }) diff --git a/models/view/src/plugin.ts b/models/view/src/plugin.ts index a26003dda8..a53ffd21ed 100644 --- a/models/view/src/plugin.ts +++ b/models/view/src/plugin.ts @@ -74,6 +74,7 @@ export default mergeIds(viewId, view, { HTMLEditor: '' as AnyComponent, CollaborativeHTMLEditor: '' as AnyComponent, CollaborativeDocEditor: '' as AnyComponent, + CollaborativeDocActivityPresenter: '' as AnyComponent, MarkupEditor: '' as AnyComponent, MarkupEditorPopup: '' as AnyComponent, ListView: '' as AnyComponent, diff --git a/plugins/activity-resources/src/utils.ts b/plugins/activity-resources/src/utils.ts index 2e0a262325..4bd458ed2a 100644 --- a/plugins/activity-resources/src/utils.ts +++ b/plugins/activity-resources/src/utils.ts @@ -138,7 +138,8 @@ export function getIsTextType (attributeModel?: AttributeModel): boolean { return ( attributeModel.attribute?.type?._class === core.class.TypeMarkup || - attributeModel.attribute?.type?._class === core.class.TypeCollaborativeMarkup + attributeModel.attribute?.type?._class === core.class.TypeCollaborativeMarkup || + attributeModel.attribute?.type?._class === core.class.TypeCollaborativeDoc ) } diff --git a/plugins/controlled-documents-resources/src/components/document/DocTeam.svelte b/plugins/controlled-documents-resources/src/components/document/DocTeam.svelte index 4a04aefd41..1420b0f9b1 100644 --- a/plugins/controlled-documents-resources/src/components/document/DocTeam.svelte +++ b/plugins/controlled-documents-resources/src/components/document/DocTeam.svelte @@ -118,7 +118,7 @@