mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-28 04:25:03 +02:00
TSK-1263 Inbox configurator (#3067)
Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
@@ -13,12 +13,25 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
import { Account, AttachedDoc, Class, Doc, Mixin, Ref, Space, Timestamp, TxCUD } from '@hcengineering/core'
|
||||
import {
|
||||
Account,
|
||||
AnyAttribute,
|
||||
AttachedDoc,
|
||||
Class,
|
||||
Doc,
|
||||
Mixin,
|
||||
Ref,
|
||||
Space,
|
||||
Timestamp,
|
||||
Tx,
|
||||
TxCUD
|
||||
} from '@hcengineering/core'
|
||||
import type { Asset, IntlString, Plugin, Resource } from '@hcengineering/platform'
|
||||
import { plugin } from '@hcengineering/platform'
|
||||
import { IntegrationType } from '@hcengineering/setting'
|
||||
import { AnyComponent } from '@hcengineering/ui'
|
||||
import { Writable } from './types'
|
||||
import { Preference } from '@hcengineering/preference'
|
||||
export * from './types'
|
||||
|
||||
/**
|
||||
@@ -64,9 +77,17 @@ export enum NotificationStatus {
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export interface NotificationType extends Doc {
|
||||
hidden: boolean
|
||||
export interface NotificationGroup extends Doc {
|
||||
label: IntlString
|
||||
icon: Asset
|
||||
// using for autogenerated settings
|
||||
objectClass?: Ref<Class<Doc>>
|
||||
}
|
||||
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export interface NotificationTemplate {
|
||||
textTemplate: string
|
||||
htmlTemplate: string
|
||||
subjectTemplate: string
|
||||
@@ -75,17 +96,40 @@ export interface NotificationType extends Doc {
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export interface NotificationProvider extends Doc {
|
||||
export interface NotificationType extends Doc {
|
||||
// For show/hide with attributes
|
||||
attribute?: Ref<AnyAttribute>
|
||||
// Is autogenerated
|
||||
generated: boolean
|
||||
// allowed to to change setting (probably we should show it, but disable toggle??)
|
||||
hidden: boolean
|
||||
label: IntlString
|
||||
default: boolean
|
||||
group: Ref<NotificationGroup>
|
||||
txClasses: Ref<Class<Tx>>[]
|
||||
objectClass: Ref<Class<Doc>>
|
||||
// check parent doc class
|
||||
attachedToClass?: Ref<Class<Doc>>
|
||||
// use for update/mixin txes
|
||||
field?: string
|
||||
// allowed providers and default value for it
|
||||
providers: Record<Ref<NotificationProvider>, boolean>
|
||||
// templates for email (and browser/push?)
|
||||
templates?: NotificationTemplate
|
||||
}
|
||||
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export interface NotificationSetting extends Doc {
|
||||
export interface NotificationProvider extends Doc {
|
||||
label: IntlString
|
||||
}
|
||||
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export interface NotificationSetting extends Preference {
|
||||
attachedTo: Ref<NotificationProvider>
|
||||
type: Ref<NotificationType>
|
||||
provider: Ref<NotificationProvider>
|
||||
enabled: boolean
|
||||
}
|
||||
|
||||
@@ -181,15 +225,16 @@ const notification = plugin(notificationId, {
|
||||
NotificationType: '' as Ref<Class<NotificationType>>,
|
||||
NotificationProvider: '' as Ref<Class<NotificationProvider>>,
|
||||
NotificationSetting: '' as Ref<Class<NotificationSetting>>,
|
||||
DocUpdates: '' as Ref<Class<DocUpdates>>
|
||||
DocUpdates: '' as Ref<Class<DocUpdates>>,
|
||||
NotificationGroup: '' as Ref<Class<NotificationGroup>>
|
||||
},
|
||||
ids: {
|
||||
MentionNotification: '' as Ref<NotificationType>,
|
||||
DMNotification: '' as Ref<NotificationType>,
|
||||
NotificationSettings: '' as Ref<Doc>
|
||||
},
|
||||
providers: {
|
||||
PlatformNotification: '' as Ref<NotificationProvider>,
|
||||
BrowserNotification: '' as Ref<NotificationProvider>,
|
||||
EmailNotification: '' as Ref<NotificationProvider>,
|
||||
NotificationSettings: '' as Ref<Doc>
|
||||
EmailNotification: '' as Ref<NotificationProvider>
|
||||
},
|
||||
integrationType: {
|
||||
MobileApp: '' as Ref<IntegrationType>
|
||||
|
||||
Reference in New Issue
Block a user