UBER-322 Company notifications (#3306)

Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
Denis Bykhov 2023-05-31 19:07:47 +06:00 committed by GitHub
parent b36e6b1ea7
commit 5b61ae8fa4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 99 additions and 0 deletions

View File

@ -29,6 +29,7 @@
"@hcengineering/model-chunter": "^0.6.0",
"@hcengineering/model-workbench": "^0.6.1",
"@hcengineering/model-attachment": "^0.6.0",
"@hcengineering/model-notification": "^0.6.0",
"@hcengineering/model-view": "^0.6.0",
"@hcengineering/model-presentation": "^0.6.0",
"@hcengineering/model": "^0.6.4",

View File

@ -52,6 +52,7 @@ import core, { TAccount, TAttachedDoc, TDoc, TSpace } from '@hcengineering/model
import presentation from '@hcengineering/model-presentation'
import view, { ViewAction, Viewlet, createAction } from '@hcengineering/model-view'
import workbench from '@hcengineering/model-workbench'
import { generateClassNotificationTypes } from '@hcengineering/model-notification'
import notification from '@hcengineering/notification'
import type { Asset, IntlString, Resource } from '@hcengineering/platform'
import setting from '@hcengineering/setting'
@ -789,4 +790,42 @@ export function createModel (builder: Builder): void {
builder.mixin(contact.class.Contact, core.class.Class, activity.mixin.ExtraActivityComponent, {
component: contact.component.ActivityChannelMessage
})
builder.createDoc(
notification.class.NotificationGroup,
core.space.Model,
{
label: contact.string.Organizations,
icon: contact.icon.Company,
objectClass: contact.class.Organization
},
contact.ids.OrganizationNotificationGroup
)
generateClassNotificationTypes(
builder,
contact.class.Organization,
contact.ids.OrganizationNotificationGroup,
[],
['comments', 'attachments', 'members']
)
builder.createDoc(
notification.class.NotificationGroup,
core.space.Model,
{
label: contact.string.Persons,
icon: contact.icon.Person,
objectClass: contact.class.Person
},
contact.ids.PersonNotificationGroup
)
generateClassNotificationTypes(
builder,
contact.class.Person,
contact.ids.PersonNotificationGroup,
[],
['comments', 'attachments']
)
}

View File

@ -18,6 +18,7 @@ import contact from '@hcengineering/contact-resources/src/plugin'
import type { Client, Doc, Ref } from '@hcengineering/core'
import {} from '@hcengineering/core'
import { ObjectSearchCategory, ObjectSearchFactory } from '@hcengineering/model-presentation'
import { NotificationGroup } from '@hcengineering/notification'
import { IntlString, mergeIds, Resource } from '@hcengineering/platform'
import { TemplateFieldFunc } from '@hcengineering/templates'
import type { AnyComponent } from '@hcengineering/ui'
@ -104,6 +105,10 @@ export default mergeIds(contactId, contact, {
category: {
Contact: '' as Ref<ActionCategory>
},
ids: {
OrganizationNotificationGroup: '' as Ref<NotificationGroup>,
PersonNotificationGroup: '' as Ref<NotificationGroup>
},
action: {
KickEmployee: '' as Ref<Action>,
MergeEmployee: '' as Ref<Action>

View File

@ -395,6 +395,57 @@ export function createModel (builder: Builder): void {
['comments', 'state', 'doneState']
)
builder.createDoc(
notification.class.NotificationGroup,
core.space.Model,
{
label: lead.string.Customers,
icon: lead.icon.CreateCustomer,
objectClass: lead.mixin.Customer
},
lead.ids.CustomerNotificationGroup
)
generateClassNotificationTypes(
builder,
lead.mixin.Customer,
lead.ids.CustomerNotificationGroup,
[],
['comments', 'attachments']
)
builder.createDoc(
notification.class.NotificationGroup,
core.space.Model,
{
label: lead.string.Funnels,
icon: lead.icon.Funnel,
objectClass: lead.class.Funnel
},
lead.ids.FunnelNotificationGroup
)
builder.createDoc(
notification.class.NotificationType,
core.space.Model,
{
hidden: false,
generated: false,
label: lead.string.LeadCreateLabel,
group: lead.ids.FunnelNotificationGroup,
field: 'space',
txClasses: [core.class.TxCreateDoc, core.class.TxUpdateDoc],
objectClass: lead.class.Funnel,
spaceSubscribe: true,
providers: {
[notification.providers.PlatformNotification]: false
}
},
lead.ids.LeadCreateNotification
)
generateClassNotificationTypes(builder, lead.class.Funnel, lead.ids.FunnelNotificationGroup, [], ['comments'])
builder.createDoc(
view.class.Viewlet,
core.space.Model,

View File

@ -66,6 +66,9 @@ export default mergeIds(leadId, lead, {
},
ids: {
LeadNotificationGroup: '' as Ref<NotificationGroup>,
CustomerNotificationGroup: '' as Ref<NotificationGroup>,
FunnelNotificationGroup: '' as Ref<NotificationGroup>,
LeadCreateNotification: '' as Ref<NotificationType>,
AssigneeNotification: '' as Ref<NotificationType>
}
})