message channel change 2 (#15269)
Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
+50
@@ -65,6 +65,12 @@ export enum MessageFolderImportPolicy {
|
||||
SELECTED_FOLDERS = 'SELECTED_FOLDERS',
|
||||
}
|
||||
|
||||
export enum MessageChannelPendingGroupEmailsAction {
|
||||
GROUP_EMAILS_DELETION = 'GROUP_EMAILS_DELETION',
|
||||
GROUP_EMAILS_IMPORT = 'GROUP_EMAILS_IMPORT',
|
||||
NONE = 'NONE',
|
||||
}
|
||||
|
||||
registerEnumType(MessageChannelVisibility, {
|
||||
name: 'MessageChannelVisibility',
|
||||
});
|
||||
@@ -89,6 +95,10 @@ registerEnumType(MessageFolderImportPolicy, {
|
||||
name: 'MessageFolderImportPolicy',
|
||||
});
|
||||
|
||||
registerEnumType(MessageChannelPendingGroupEmailsAction, {
|
||||
name: 'MessageChannelPendingGroupEmailsAction',
|
||||
});
|
||||
|
||||
@WorkspaceEntity({
|
||||
standardId: STANDARD_OBJECT_IDS.messageChannel,
|
||||
namePlural: 'messageChannels',
|
||||
@@ -249,6 +259,46 @@ export class MessageChannelWorkspaceEntity extends BaseWorkspaceEntity {
|
||||
})
|
||||
excludeGroupEmails: boolean;
|
||||
|
||||
@WorkspaceField({
|
||||
standardId: MESSAGE_CHANNEL_STANDARD_FIELD_IDS.syncAllFolders,
|
||||
type: FieldMetadataType.BOOLEAN,
|
||||
label: msg`Sync all folders`,
|
||||
description: msg`Sync all folders including new ones`,
|
||||
icon: 'IconFolders',
|
||||
defaultValue: true,
|
||||
})
|
||||
syncAllFolders: boolean;
|
||||
|
||||
@WorkspaceField({
|
||||
standardId: MESSAGE_CHANNEL_STANDARD_FIELD_IDS.pendingGroupEmailsAction,
|
||||
type: FieldMetadataType.SELECT,
|
||||
label: msg`Pending group emails action`,
|
||||
description: msg`Pending action for group emails`,
|
||||
icon: 'IconUsersGroup',
|
||||
options: [
|
||||
{
|
||||
value: MessageChannelPendingGroupEmailsAction.GROUP_EMAILS_DELETION,
|
||||
label: 'Group emails deletion',
|
||||
position: 0,
|
||||
color: 'red',
|
||||
},
|
||||
{
|
||||
value: MessageChannelPendingGroupEmailsAction.GROUP_EMAILS_IMPORT,
|
||||
label: 'Group emails import',
|
||||
position: 1,
|
||||
color: 'green',
|
||||
},
|
||||
{
|
||||
value: MessageChannelPendingGroupEmailsAction.NONE,
|
||||
label: 'None',
|
||||
position: 2,
|
||||
color: 'blue',
|
||||
},
|
||||
],
|
||||
defaultValue: `'${MessageChannelPendingGroupEmailsAction.NONE}'`,
|
||||
})
|
||||
pendingGroupEmailsAction: MessageChannelPendingGroupEmailsAction;
|
||||
|
||||
@WorkspaceField({
|
||||
standardId: MESSAGE_CHANNEL_STANDARD_FIELD_IDS.isSyncEnabled,
|
||||
type: FieldMetadataType.BOOLEAN,
|
||||
|
||||
+42
@@ -1,3 +1,5 @@
|
||||
import { registerEnumType } from '@nestjs/graphql';
|
||||
|
||||
import { msg } from '@lingui/core/macro';
|
||||
import { FieldMetadataType } from 'twenty-shared/types';
|
||||
import { Relation } from 'typeorm';
|
||||
@@ -18,6 +20,16 @@ import { STANDARD_OBJECT_ICONS } from 'src/engine/workspace-manager/workspace-sy
|
||||
import { STANDARD_OBJECT_IDS } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids';
|
||||
import { MessageChannelWorkspaceEntity } from 'src/modules/messaging/common/standard-objects/message-channel.workspace-entity';
|
||||
|
||||
export enum MessageFolderPendingSyncAction {
|
||||
FOLDER_DELETION = 'FOLDER_DELETION',
|
||||
FOLDER_IMPORT = 'FOLDER_IMPORT',
|
||||
NONE = 'NONE',
|
||||
}
|
||||
|
||||
registerEnumType(MessageFolderPendingSyncAction, {
|
||||
name: 'MessageFolderPendingSyncAction',
|
||||
});
|
||||
|
||||
@WorkspaceEntity({
|
||||
standardId: STANDARD_OBJECT_IDS.messageFolder,
|
||||
namePlural: 'messageFolders',
|
||||
@@ -90,6 +102,36 @@ export class MessageFolderWorkspaceEntity extends BaseWorkspaceEntity {
|
||||
@WorkspaceIsNullable()
|
||||
externalId: string | null;
|
||||
|
||||
@WorkspaceField({
|
||||
standardId: MESSAGE_FOLDER_STANDARD_FIELD_IDS.pendingSyncAction,
|
||||
type: FieldMetadataType.SELECT,
|
||||
label: msg`Pending Sync Action`,
|
||||
description: msg`Pending action for folder sync`,
|
||||
icon: 'IconReload',
|
||||
options: [
|
||||
{
|
||||
value: MessageFolderPendingSyncAction.FOLDER_DELETION,
|
||||
label: 'Folder deletion',
|
||||
position: 0,
|
||||
color: 'red',
|
||||
},
|
||||
{
|
||||
value: MessageFolderPendingSyncAction.FOLDER_IMPORT,
|
||||
label: 'Folder import',
|
||||
position: 1,
|
||||
color: 'green',
|
||||
},
|
||||
{
|
||||
value: MessageFolderPendingSyncAction.NONE,
|
||||
label: 'None',
|
||||
position: 2,
|
||||
color: 'blue',
|
||||
},
|
||||
],
|
||||
defaultValue: `'${MessageFolderPendingSyncAction.NONE}'`,
|
||||
})
|
||||
pendingSyncAction: MessageFolderPendingSyncAction;
|
||||
|
||||
@WorkspaceJoinColumn('messageChannel')
|
||||
messageChannelId: string;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user