Add call recording transcript and summary widget types (#23864)
Registers two record-page widget types for call recordings: CALL_RECORDING_SUMMARY and CALL_RECORDING_TRANSCRIPT. - Widget type and configuration type enums, configuration DTOs, and creation/update validators - Core pageLayoutWidget_type_enum migration (2.29 fast instance command) - Shared configuration types and regenerated metadata client schemas Widget components and their placement on the callRecording record page layout come in a follow-up PR. <!-- This is an auto-generated description by cubic. --> <a href="https://cubic.dev/pr/twentyhq/twenty/pull/23864?utm_source=github" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img alt="Review in cubic" src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a> <!-- End of auto-generated description by cubic. -->
This commit is contained in:
@@ -1060,6 +1060,8 @@ enum WidgetType {
|
||||
FRONT_COMPONENT
|
||||
RECORD_TABLE
|
||||
EMAIL_THREAD
|
||||
CALL_RECORDING_SUMMARY
|
||||
CALL_RECORDING_TRANSCRIPT
|
||||
MESSAGE_CAMPAIGN_BODY
|
||||
MESSAGE_CAMPAIGN_DETAILS
|
||||
}
|
||||
@@ -1089,7 +1091,7 @@ type PageLayoutWidgetCanvasPosition {
|
||||
layoutMode: PageLayoutTabLayoutMode!
|
||||
}
|
||||
|
||||
union WidgetConfiguration = AggregateChartConfiguration | StandaloneRichTextConfiguration | PieChartConfiguration | LineChartConfiguration | IframeConfiguration | BarChartConfiguration | CalendarConfiguration | FrontComponentConfiguration | EmailsConfiguration | EmailThreadConfiguration | MessageCampaignBodyConfiguration | MessageCampaignDetailsConfiguration | FieldConfiguration | FieldRichTextConfiguration | FieldsConfiguration | FilesConfiguration | NotesConfiguration | TasksConfiguration | TimelineConfiguration | ViewConfiguration | RecordTableConfiguration | WorkflowConfiguration | WorkflowRunConfiguration | WorkflowVersionConfiguration
|
||||
union WidgetConfiguration = AggregateChartConfiguration | StandaloneRichTextConfiguration | PieChartConfiguration | LineChartConfiguration | IframeConfiguration | BarChartConfiguration | CalendarConfiguration | FrontComponentConfiguration | EmailsConfiguration | EmailThreadConfiguration | CallRecordingSummaryConfiguration | CallRecordingTranscriptConfiguration | MessageCampaignBodyConfiguration | MessageCampaignDetailsConfiguration | FieldConfiguration | FieldRichTextConfiguration | FieldsConfiguration | FilesConfiguration | NotesConfiguration | TasksConfiguration | TimelineConfiguration | ViewConfiguration | RecordTableConfiguration | WorkflowConfiguration | WorkflowRunConfiguration | WorkflowVersionConfiguration
|
||||
|
||||
type AggregateChartConfiguration {
|
||||
configurationType: WidgetConfigurationType!
|
||||
@@ -1130,6 +1132,8 @@ enum WidgetConfigurationType {
|
||||
FRONT_COMPONENT
|
||||
RECORD_TABLE
|
||||
EMAIL_THREAD
|
||||
CALL_RECORDING_SUMMARY
|
||||
CALL_RECORDING_TRANSCRIPT
|
||||
MESSAGE_CAMPAIGN_BODY
|
||||
MESSAGE_CAMPAIGN_DETAILS
|
||||
}
|
||||
@@ -1298,6 +1302,14 @@ type EmailThreadConfiguration {
|
||||
configurationType: WidgetConfigurationType!
|
||||
}
|
||||
|
||||
type CallRecordingSummaryConfiguration {
|
||||
configurationType: WidgetConfigurationType!
|
||||
}
|
||||
|
||||
type CallRecordingTranscriptConfiguration {
|
||||
configurationType: WidgetConfigurationType!
|
||||
}
|
||||
|
||||
type MessageCampaignBodyConfiguration {
|
||||
configurationType: WidgetConfigurationType!
|
||||
}
|
||||
|
||||
@@ -759,7 +759,7 @@ export interface PageLayoutWidget {
|
||||
__typename: 'PageLayoutWidget'
|
||||
}
|
||||
|
||||
export type WidgetType = 'VIEW' | 'IFRAME' | 'FIELD' | 'FIELDS' | 'GRAPH' | 'STANDALONE_RICH_TEXT' | 'TIMELINE' | 'TASKS' | 'NOTES' | 'FILES' | 'EMAILS' | 'CALENDAR' | 'FIELD_RICH_TEXT' | 'WORKFLOW' | 'WORKFLOW_VERSION' | 'WORKFLOW_RUN' | 'FRONT_COMPONENT' | 'RECORD_TABLE' | 'EMAIL_THREAD' | 'MESSAGE_CAMPAIGN_BODY' | 'MESSAGE_CAMPAIGN_DETAILS'
|
||||
export type WidgetType = 'VIEW' | 'IFRAME' | 'FIELD' | 'FIELDS' | 'GRAPH' | 'STANDALONE_RICH_TEXT' | 'TIMELINE' | 'TASKS' | 'NOTES' | 'FILES' | 'EMAILS' | 'CALENDAR' | 'FIELD_RICH_TEXT' | 'WORKFLOW' | 'WORKFLOW_VERSION' | 'WORKFLOW_RUN' | 'FRONT_COMPONENT' | 'RECORD_TABLE' | 'EMAIL_THREAD' | 'CALL_RECORDING_SUMMARY' | 'CALL_RECORDING_TRANSCRIPT' | 'MESSAGE_CAMPAIGN_BODY' | 'MESSAGE_CAMPAIGN_DETAILS'
|
||||
|
||||
export type PageLayoutWidgetPosition = (PageLayoutWidgetGridPosition | PageLayoutWidgetVerticalListPosition | PageLayoutWidgetCanvasPosition) & { __isUnion?: true }
|
||||
|
||||
@@ -785,7 +785,7 @@ export interface PageLayoutWidgetCanvasPosition {
|
||||
__typename: 'PageLayoutWidgetCanvasPosition'
|
||||
}
|
||||
|
||||
export type WidgetConfiguration = (AggregateChartConfiguration | StandaloneRichTextConfiguration | PieChartConfiguration | LineChartConfiguration | IframeConfiguration | BarChartConfiguration | CalendarConfiguration | FrontComponentConfiguration | EmailsConfiguration | EmailThreadConfiguration | MessageCampaignBodyConfiguration | MessageCampaignDetailsConfiguration | FieldConfiguration | FieldRichTextConfiguration | FieldsConfiguration | FilesConfiguration | NotesConfiguration | TasksConfiguration | TimelineConfiguration | ViewConfiguration | RecordTableConfiguration | WorkflowConfiguration | WorkflowRunConfiguration | WorkflowVersionConfiguration) & { __isUnion?: true }
|
||||
export type WidgetConfiguration = (AggregateChartConfiguration | StandaloneRichTextConfiguration | PieChartConfiguration | LineChartConfiguration | IframeConfiguration | BarChartConfiguration | CalendarConfiguration | FrontComponentConfiguration | EmailsConfiguration | EmailThreadConfiguration | CallRecordingSummaryConfiguration | CallRecordingTranscriptConfiguration | MessageCampaignBodyConfiguration | MessageCampaignDetailsConfiguration | FieldConfiguration | FieldRichTextConfiguration | FieldsConfiguration | FilesConfiguration | NotesConfiguration | TasksConfiguration | TimelineConfiguration | ViewConfiguration | RecordTableConfiguration | WorkflowConfiguration | WorkflowRunConfiguration | WorkflowVersionConfiguration) & { __isUnion?: true }
|
||||
|
||||
export interface AggregateChartConfiguration {
|
||||
configurationType: WidgetConfigurationType
|
||||
@@ -804,7 +804,7 @@ export interface AggregateChartConfiguration {
|
||||
__typename: 'AggregateChartConfiguration'
|
||||
}
|
||||
|
||||
export type WidgetConfigurationType = 'AGGREGATE_CHART' | 'PIE_CHART' | 'BAR_CHART' | 'LINE_CHART' | 'IFRAME' | 'STANDALONE_RICH_TEXT' | 'VIEW' | 'FIELD' | 'FIELDS' | 'TIMELINE' | 'TASKS' | 'NOTES' | 'FILES' | 'EMAILS' | 'CALENDAR' | 'FIELD_RICH_TEXT' | 'WORKFLOW' | 'WORKFLOW_VERSION' | 'WORKFLOW_RUN' | 'FRONT_COMPONENT' | 'RECORD_TABLE' | 'EMAIL_THREAD' | 'MESSAGE_CAMPAIGN_BODY' | 'MESSAGE_CAMPAIGN_DETAILS'
|
||||
export type WidgetConfigurationType = 'AGGREGATE_CHART' | 'PIE_CHART' | 'BAR_CHART' | 'LINE_CHART' | 'IFRAME' | 'STANDALONE_RICH_TEXT' | 'VIEW' | 'FIELD' | 'FIELDS' | 'TIMELINE' | 'TASKS' | 'NOTES' | 'FILES' | 'EMAILS' | 'CALENDAR' | 'FIELD_RICH_TEXT' | 'WORKFLOW' | 'WORKFLOW_VERSION' | 'WORKFLOW_RUN' | 'FRONT_COMPONENT' | 'RECORD_TABLE' | 'EMAIL_THREAD' | 'CALL_RECORDING_SUMMARY' | 'CALL_RECORDING_TRANSCRIPT' | 'MESSAGE_CAMPAIGN_BODY' | 'MESSAGE_CAMPAIGN_DETAILS'
|
||||
|
||||
|
||||
/** Format used to display the chart value */
|
||||
@@ -951,6 +951,16 @@ export interface EmailThreadConfiguration {
|
||||
__typename: 'EmailThreadConfiguration'
|
||||
}
|
||||
|
||||
export interface CallRecordingSummaryConfiguration {
|
||||
configurationType: WidgetConfigurationType
|
||||
__typename: 'CallRecordingSummaryConfiguration'
|
||||
}
|
||||
|
||||
export interface CallRecordingTranscriptConfiguration {
|
||||
configurationType: WidgetConfigurationType
|
||||
__typename: 'CallRecordingTranscriptConfiguration'
|
||||
}
|
||||
|
||||
export interface MessageCampaignBodyConfiguration {
|
||||
configurationType: WidgetConfigurationType
|
||||
__typename: 'MessageCampaignBodyConfiguration'
|
||||
@@ -4011,6 +4021,8 @@ export interface WidgetConfigurationGenqlSelection{
|
||||
on_FrontComponentConfiguration?:FrontComponentConfigurationGenqlSelection,
|
||||
on_EmailsConfiguration?:EmailsConfigurationGenqlSelection,
|
||||
on_EmailThreadConfiguration?:EmailThreadConfigurationGenqlSelection,
|
||||
on_CallRecordingSummaryConfiguration?:CallRecordingSummaryConfigurationGenqlSelection,
|
||||
on_CallRecordingTranscriptConfiguration?:CallRecordingTranscriptConfigurationGenqlSelection,
|
||||
on_MessageCampaignBodyConfiguration?:MessageCampaignBodyConfigurationGenqlSelection,
|
||||
on_MessageCampaignDetailsConfiguration?:MessageCampaignDetailsConfigurationGenqlSelection,
|
||||
on_FieldConfiguration?:FieldConfigurationGenqlSelection,
|
||||
@@ -4176,6 +4188,18 @@ export interface EmailThreadConfigurationGenqlSelection{
|
||||
__scalar?: boolean | number
|
||||
}
|
||||
|
||||
export interface CallRecordingSummaryConfigurationGenqlSelection{
|
||||
configurationType?: boolean | number
|
||||
__typename?: boolean | number
|
||||
__scalar?: boolean | number
|
||||
}
|
||||
|
||||
export interface CallRecordingTranscriptConfigurationGenqlSelection{
|
||||
configurationType?: boolean | number
|
||||
__typename?: boolean | number
|
||||
__scalar?: boolean | number
|
||||
}
|
||||
|
||||
export interface MessageCampaignBodyConfigurationGenqlSelection{
|
||||
configurationType?: boolean | number
|
||||
__typename?: boolean | number
|
||||
@@ -7369,7 +7393,7 @@ export interface LogicFunctionLogsInput {applicationId?: (Scalars['UUID'] | null
|
||||
|
||||
|
||||
|
||||
const WidgetConfiguration_possibleTypes: string[] = ['AggregateChartConfiguration','StandaloneRichTextConfiguration','PieChartConfiguration','LineChartConfiguration','IframeConfiguration','BarChartConfiguration','CalendarConfiguration','FrontComponentConfiguration','EmailsConfiguration','EmailThreadConfiguration','MessageCampaignBodyConfiguration','MessageCampaignDetailsConfiguration','FieldConfiguration','FieldRichTextConfiguration','FieldsConfiguration','FilesConfiguration','NotesConfiguration','TasksConfiguration','TimelineConfiguration','ViewConfiguration','RecordTableConfiguration','WorkflowConfiguration','WorkflowRunConfiguration','WorkflowVersionConfiguration']
|
||||
const WidgetConfiguration_possibleTypes: string[] = ['AggregateChartConfiguration','StandaloneRichTextConfiguration','PieChartConfiguration','LineChartConfiguration','IframeConfiguration','BarChartConfiguration','CalendarConfiguration','FrontComponentConfiguration','EmailsConfiguration','EmailThreadConfiguration','CallRecordingSummaryConfiguration','CallRecordingTranscriptConfiguration','MessageCampaignBodyConfiguration','MessageCampaignDetailsConfiguration','FieldConfiguration','FieldRichTextConfiguration','FieldsConfiguration','FilesConfiguration','NotesConfiguration','TasksConfiguration','TimelineConfiguration','ViewConfiguration','RecordTableConfiguration','WorkflowConfiguration','WorkflowRunConfiguration','WorkflowVersionConfiguration']
|
||||
export const isWidgetConfiguration = (obj?: { __typename?: any } | null): obj is WidgetConfiguration => {
|
||||
if (!obj?.__typename) throw new Error('__typename is missing in "isWidgetConfiguration"')
|
||||
return WidgetConfiguration_possibleTypes.includes(obj.__typename)
|
||||
@@ -7457,6 +7481,22 @@ export interface LogicFunctionLogsInput {applicationId?: (Scalars['UUID'] | null
|
||||
|
||||
|
||||
|
||||
const CallRecordingSummaryConfiguration_possibleTypes: string[] = ['CallRecordingSummaryConfiguration']
|
||||
export const isCallRecordingSummaryConfiguration = (obj?: { __typename?: any } | null): obj is CallRecordingSummaryConfiguration => {
|
||||
if (!obj?.__typename) throw new Error('__typename is missing in "isCallRecordingSummaryConfiguration"')
|
||||
return CallRecordingSummaryConfiguration_possibleTypes.includes(obj.__typename)
|
||||
}
|
||||
|
||||
|
||||
|
||||
const CallRecordingTranscriptConfiguration_possibleTypes: string[] = ['CallRecordingTranscriptConfiguration']
|
||||
export const isCallRecordingTranscriptConfiguration = (obj?: { __typename?: any } | null): obj is CallRecordingTranscriptConfiguration => {
|
||||
if (!obj?.__typename) throw new Error('__typename is missing in "isCallRecordingTranscriptConfiguration"')
|
||||
return CallRecordingTranscriptConfiguration_possibleTypes.includes(obj.__typename)
|
||||
}
|
||||
|
||||
|
||||
|
||||
const MessageCampaignBodyConfiguration_possibleTypes: string[] = ['MessageCampaignBodyConfiguration']
|
||||
export const isMessageCampaignBodyConfiguration = (obj?: { __typename?: any } | null): obj is MessageCampaignBodyConfiguration => {
|
||||
if (!obj?.__typename) throw new Error('__typename is missing in "isMessageCampaignBodyConfiguration"')
|
||||
@@ -9468,6 +9508,8 @@ export const enumWidgetType = {
|
||||
FRONT_COMPONENT: 'FRONT_COMPONENT' as const,
|
||||
RECORD_TABLE: 'RECORD_TABLE' as const,
|
||||
EMAIL_THREAD: 'EMAIL_THREAD' as const,
|
||||
CALL_RECORDING_SUMMARY: 'CALL_RECORDING_SUMMARY' as const,
|
||||
CALL_RECORDING_TRANSCRIPT: 'CALL_RECORDING_TRANSCRIPT' as const,
|
||||
MESSAGE_CAMPAIGN_BODY: 'MESSAGE_CAMPAIGN_BODY' as const,
|
||||
MESSAGE_CAMPAIGN_DETAILS: 'MESSAGE_CAMPAIGN_DETAILS' as const
|
||||
}
|
||||
@@ -9501,6 +9543,8 @@ export const enumWidgetConfigurationType = {
|
||||
FRONT_COMPONENT: 'FRONT_COMPONENT' as const,
|
||||
RECORD_TABLE: 'RECORD_TABLE' as const,
|
||||
EMAIL_THREAD: 'EMAIL_THREAD' as const,
|
||||
CALL_RECORDING_SUMMARY: 'CALL_RECORDING_SUMMARY' as const,
|
||||
CALL_RECORDING_TRANSCRIPT: 'CALL_RECORDING_TRANSCRIPT' as const,
|
||||
MESSAGE_CAMPAIGN_BODY: 'MESSAGE_CAMPAIGN_BODY' as const,
|
||||
MESSAGE_CAMPAIGN_DETAILS: 'MESSAGE_CAMPAIGN_DETAILS' as const
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
+6
@@ -156,6 +156,12 @@ export const PAGE_LAYOUT_WIDGET_FRAGMENT = gql`
|
||||
... on EmailThreadConfiguration {
|
||||
configurationType
|
||||
}
|
||||
... on CallRecordingSummaryConfiguration {
|
||||
configurationType
|
||||
}
|
||||
... on CallRecordingTranscriptConfiguration {
|
||||
configurationType
|
||||
}
|
||||
... on MessageCampaignBodyConfiguration {
|
||||
configurationType
|
||||
}
|
||||
|
||||
+14
@@ -3,6 +3,8 @@ import {
|
||||
type AggregateChartConfiguration,
|
||||
type BarChartConfiguration,
|
||||
type CalendarConfiguration,
|
||||
type CallRecordingSummaryConfiguration,
|
||||
type CallRecordingTranscriptConfiguration,
|
||||
type EmailThreadConfiguration,
|
||||
type EmailsConfiguration,
|
||||
type FieldRichTextConfiguration,
|
||||
@@ -52,6 +54,18 @@ type WidgetConfigurationTypenameMap = {
|
||||
> & {
|
||||
configurationType: WidgetConfigurationType.EMAIL_THREAD;
|
||||
};
|
||||
CallRecordingSummaryConfiguration: Omit<
|
||||
CallRecordingSummaryConfiguration,
|
||||
'configurationType'
|
||||
> & {
|
||||
configurationType: WidgetConfigurationType.CALL_RECORDING_SUMMARY;
|
||||
};
|
||||
CallRecordingTranscriptConfiguration: Omit<
|
||||
CallRecordingTranscriptConfiguration,
|
||||
'configurationType'
|
||||
> & {
|
||||
configurationType: WidgetConfigurationType.CALL_RECORDING_TRANSCRIPT;
|
||||
};
|
||||
MessageCampaignBodyConfiguration: Omit<
|
||||
MessageCampaignBodyConfiguration,
|
||||
'configurationType'
|
||||
|
||||
+50
@@ -0,0 +1,50 @@
|
||||
import { type QueryRunner } from 'typeorm';
|
||||
|
||||
import { RegisteredInstanceCommand } from 'src/engine/core-modules/upgrade/decorators/registered-instance-command.decorator';
|
||||
import { type FastInstanceCommand } from 'src/engine/core-modules/upgrade/interfaces/fast-instance-command.interface';
|
||||
|
||||
@RegisteredInstanceCommand('2.29.0', 1786009374684)
|
||||
export class AddCallRecordingWidgetTypesFastInstanceCommand implements FastInstanceCommand {
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(
|
||||
'ALTER TYPE "core"."pageLayoutWidget_type_enum" RENAME TO "pageLayoutWidget_type_enum_old"',
|
||||
);
|
||||
await queryRunner.query(
|
||||
"CREATE TYPE \"core\".\"pageLayoutWidget_type_enum\" AS ENUM('VIEW', 'IFRAME', 'FIELD', 'FIELDS', 'GRAPH', 'STANDALONE_RICH_TEXT', 'TIMELINE', 'TASKS', 'NOTES', 'FILES', 'EMAILS', 'CALENDAR', 'FIELD_RICH_TEXT', 'WORKFLOW', 'WORKFLOW_VERSION', 'WORKFLOW_RUN', 'FRONT_COMPONENT', 'RECORD_TABLE', 'EMAIL_THREAD', 'CALL_RECORDING_SUMMARY', 'CALL_RECORDING_TRANSCRIPT', 'MESSAGE_CAMPAIGN_BODY', 'MESSAGE_CAMPAIGN_DETAILS')",
|
||||
);
|
||||
await queryRunner.query(
|
||||
'ALTER TABLE "core"."pageLayoutWidget" ALTER COLUMN "type" DROP DEFAULT',
|
||||
);
|
||||
await queryRunner.query(
|
||||
'ALTER TABLE "core"."pageLayoutWidget" ALTER COLUMN "type" TYPE "core"."pageLayoutWidget_type_enum" USING "type"::"text"::"core"."pageLayoutWidget_type_enum"',
|
||||
);
|
||||
await queryRunner.query(
|
||||
'ALTER TABLE "core"."pageLayoutWidget" ALTER COLUMN "type" SET DEFAULT \'VIEW\'',
|
||||
);
|
||||
await queryRunner.query(
|
||||
'DROP TYPE "core"."pageLayoutWidget_type_enum_old"',
|
||||
);
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(
|
||||
`DELETE FROM "core"."pageLayoutWidget" WHERE "type" IN ('CALL_RECORDING_SUMMARY', 'CALL_RECORDING_TRANSCRIPT')`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
"CREATE TYPE \"core\".\"pageLayoutWidget_type_enum_old\" AS ENUM('VIEW', 'IFRAME', 'FIELD', 'FIELDS', 'GRAPH', 'STANDALONE_RICH_TEXT', 'TIMELINE', 'TASKS', 'NOTES', 'FILES', 'EMAILS', 'CALENDAR', 'FIELD_RICH_TEXT', 'WORKFLOW', 'WORKFLOW_VERSION', 'WORKFLOW_RUN', 'FRONT_COMPONENT', 'RECORD_TABLE', 'EMAIL_THREAD', 'MESSAGE_CAMPAIGN_BODY', 'MESSAGE_CAMPAIGN_DETAILS')",
|
||||
);
|
||||
await queryRunner.query(
|
||||
'ALTER TABLE "core"."pageLayoutWidget" ALTER COLUMN "type" DROP DEFAULT',
|
||||
);
|
||||
await queryRunner.query(
|
||||
'ALTER TABLE "core"."pageLayoutWidget" ALTER COLUMN "type" TYPE "core"."pageLayoutWidget_type_enum_old" USING "type"::"text"::"core"."pageLayoutWidget_type_enum_old"',
|
||||
);
|
||||
await queryRunner.query(
|
||||
'ALTER TABLE "core"."pageLayoutWidget" ALTER COLUMN "type" SET DEFAULT \'VIEW\'',
|
||||
);
|
||||
await queryRunner.query('DROP TYPE "core"."pageLayoutWidget_type_enum"');
|
||||
await queryRunner.query(
|
||||
'ALTER TYPE "core"."pageLayoutWidget_type_enum_old" RENAME TO "pageLayoutWidget_type_enum"',
|
||||
);
|
||||
}
|
||||
}
|
||||
+2
@@ -135,6 +135,7 @@ import { AddConnectedAccountHandleProviderIndexFastInstanceCommand } from 'src/d
|
||||
import { AddOpenRecordInToObjectMetadataFastInstanceCommand } from 'src/database/commands/upgrade-version-command/2-27/2-27-instance-command-fast-1785504900000-add-open-record-in-to-object-metadata';
|
||||
import { CreateUserSessionCoreTableFastInstanceCommand } from 'src/database/commands/upgrade-version-command/2-27/2-27-instance-command-fast-1785518325511-create-user-session-core-table';
|
||||
import { CreateApplicationAuthorizationCoreTableFastInstanceCommand } from 'src/database/commands/upgrade-version-command/2-27/2-27-instance-command-fast-1785681272278-create-application-authorization-core-table';
|
||||
import { AddCallRecordingWidgetTypesFastInstanceCommand } from 'src/database/commands/upgrade-version-command/2-29/2-29-instance-command-fast-1786009374684-add-call-recording-widget-types';
|
||||
|
||||
export const INSTANCE_COMMANDS = [
|
||||
AddViewFieldGroupIdIndexOnViewFieldFastInstanceCommand,
|
||||
@@ -272,4 +273,5 @@ export const INSTANCE_COMMANDS = [
|
||||
AddOpenRecordInToObjectMetadataFastInstanceCommand,
|
||||
CreateUserSessionCoreTableFastInstanceCommand,
|
||||
CreateApplicationAuthorizationCoreTableFastInstanceCommand,
|
||||
AddCallRecordingWidgetTypesFastInstanceCommand,
|
||||
];
|
||||
|
||||
+12
@@ -95,6 +95,12 @@ export class FlatPageLayoutWidgetTypeValidatorService {
|
||||
EMAIL_THREAD: validateSimpleRecordPageWidgetForCreation(
|
||||
WidgetConfigurationType.EMAIL_THREAD,
|
||||
),
|
||||
CALL_RECORDING_SUMMARY: validateSimpleRecordPageWidgetForCreation(
|
||||
WidgetConfigurationType.CALL_RECORDING_SUMMARY,
|
||||
),
|
||||
CALL_RECORDING_TRANSCRIPT: validateSimpleRecordPageWidgetForCreation(
|
||||
WidgetConfigurationType.CALL_RECORDING_TRANSCRIPT,
|
||||
),
|
||||
MESSAGE_CAMPAIGN_BODY: validateSimpleRecordPageWidgetForCreation(
|
||||
WidgetConfigurationType.MESSAGE_CAMPAIGN_BODY,
|
||||
),
|
||||
@@ -155,6 +161,12 @@ export class FlatPageLayoutWidgetTypeValidatorService {
|
||||
EMAIL_THREAD: validateSimpleRecordPageWidgetForUpdate(
|
||||
WidgetConfigurationType.EMAIL_THREAD,
|
||||
),
|
||||
CALL_RECORDING_SUMMARY: validateSimpleRecordPageWidgetForUpdate(
|
||||
WidgetConfigurationType.CALL_RECORDING_SUMMARY,
|
||||
),
|
||||
CALL_RECORDING_TRANSCRIPT: validateSimpleRecordPageWidgetForUpdate(
|
||||
WidgetConfigurationType.CALL_RECORDING_TRANSCRIPT,
|
||||
),
|
||||
MESSAGE_CAMPAIGN_BODY: validateSimpleRecordPageWidgetForUpdate(
|
||||
WidgetConfigurationType.MESSAGE_CAMPAIGN_BODY,
|
||||
),
|
||||
|
||||
+2
@@ -396,6 +396,8 @@ export const fromPageLayoutWidgetConfigurationToUniversalConfiguration = ({
|
||||
case WidgetConfigurationType.IFRAME:
|
||||
case WidgetConfigurationType.STANDALONE_RICH_TEXT:
|
||||
case WidgetConfigurationType.EMAIL_THREAD:
|
||||
case WidgetConfigurationType.CALL_RECORDING_SUMMARY:
|
||||
case WidgetConfigurationType.CALL_RECORDING_TRANSCRIPT:
|
||||
case WidgetConfigurationType.MESSAGE_CAMPAIGN_BODY:
|
||||
case WidgetConfigurationType.MESSAGE_CAMPAIGN_DETAILS:
|
||||
return configuration;
|
||||
|
||||
+4
@@ -1,4 +1,6 @@
|
||||
import { AggregateChartConfigurationDTO } from 'src/engine/metadata-modules/page-layout-widget/dtos/aggregate-chart-configuration.dto';
|
||||
import { CallRecordingSummaryConfigurationDTO } from 'src/engine/metadata-modules/page-layout-widget/dtos/call-recording-summary-configuration.dto';
|
||||
import { CallRecordingTranscriptConfigurationDTO } from 'src/engine/metadata-modules/page-layout-widget/dtos/call-recording-transcript-configuration.dto';
|
||||
import { EmailThreadConfigurationDTO } from 'src/engine/metadata-modules/page-layout-widget/dtos/email-thread-configuration.dto';
|
||||
import { MessageCampaignBodyConfigurationDTO } from 'src/engine/metadata-modules/page-layout-widget/dtos/message-campaign-body-configuration.dto';
|
||||
import { MessageCampaignDetailsConfigurationDTO } from 'src/engine/metadata-modules/page-layout-widget/dtos/message-campaign-details-configuration.dto';
|
||||
@@ -37,6 +39,8 @@ export const ALL_WIDGET_CONFIGURATION_TYPE_VALIDATOR_BY_WIDGET_CONFIGURATION_TYP
|
||||
FRONT_COMPONENT: FrontComponentConfigurationDTO,
|
||||
EMAILS: EmailsConfigurationDTO,
|
||||
EMAIL_THREAD: EmailThreadConfigurationDTO,
|
||||
CALL_RECORDING_SUMMARY: CallRecordingSummaryConfigurationDTO,
|
||||
CALL_RECORDING_TRANSCRIPT: CallRecordingTranscriptConfigurationDTO,
|
||||
MESSAGE_CAMPAIGN_BODY: MessageCampaignBodyConfigurationDTO,
|
||||
MESSAGE_CAMPAIGN_DETAILS: MessageCampaignDetailsConfigurationDTO,
|
||||
FIELD: FieldConfigurationDTO,
|
||||
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
import { Field, ObjectType } from '@nestjs/graphql';
|
||||
|
||||
import { IsIn, IsNotEmpty } from 'class-validator';
|
||||
import { type CallRecordingSummaryConfiguration } from 'twenty-shared/types';
|
||||
|
||||
import { WidgetConfigurationType } from 'src/engine/metadata-modules/page-layout-widget/enums/widget-configuration-type.type';
|
||||
|
||||
@ObjectType('CallRecordingSummaryConfiguration')
|
||||
export class CallRecordingSummaryConfigurationDTO implements CallRecordingSummaryConfiguration {
|
||||
@Field(() => WidgetConfigurationType)
|
||||
@IsIn([WidgetConfigurationType.CALL_RECORDING_SUMMARY])
|
||||
@IsNotEmpty()
|
||||
configurationType: WidgetConfigurationType.CALL_RECORDING_SUMMARY;
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
import { Field, ObjectType } from '@nestjs/graphql';
|
||||
|
||||
import { IsIn, IsNotEmpty } from 'class-validator';
|
||||
import { type CallRecordingTranscriptConfiguration } from 'twenty-shared/types';
|
||||
|
||||
import { WidgetConfigurationType } from 'src/engine/metadata-modules/page-layout-widget/enums/widget-configuration-type.type';
|
||||
|
||||
@ObjectType('CallRecordingTranscriptConfiguration')
|
||||
export class CallRecordingTranscriptConfigurationDTO implements CallRecordingTranscriptConfiguration {
|
||||
@Field(() => WidgetConfigurationType)
|
||||
@IsIn([WidgetConfigurationType.CALL_RECORDING_TRANSCRIPT])
|
||||
@IsNotEmpty()
|
||||
configurationType: WidgetConfigurationType.CALL_RECORDING_TRANSCRIPT;
|
||||
}
|
||||
+2
@@ -27,6 +27,8 @@ export enum WidgetConfigurationType {
|
||||
FRONT_COMPONENT = 'FRONT_COMPONENT',
|
||||
RECORD_TABLE = 'RECORD_TABLE',
|
||||
EMAIL_THREAD = 'EMAIL_THREAD',
|
||||
CALL_RECORDING_SUMMARY = 'CALL_RECORDING_SUMMARY',
|
||||
CALL_RECORDING_TRANSCRIPT = 'CALL_RECORDING_TRANSCRIPT',
|
||||
MESSAGE_CAMPAIGN_BODY = 'MESSAGE_CAMPAIGN_BODY',
|
||||
MESSAGE_CAMPAIGN_DETAILS = 'MESSAGE_CAMPAIGN_DETAILS',
|
||||
}
|
||||
|
||||
+2
@@ -18,6 +18,8 @@ export enum WidgetType {
|
||||
FRONT_COMPONENT = 'FRONT_COMPONENT',
|
||||
RECORD_TABLE = 'RECORD_TABLE',
|
||||
EMAIL_THREAD = 'EMAIL_THREAD',
|
||||
CALL_RECORDING_SUMMARY = 'CALL_RECORDING_SUMMARY',
|
||||
CALL_RECORDING_TRANSCRIPT = 'CALL_RECORDING_TRANSCRIPT',
|
||||
MESSAGE_CAMPAIGN_BODY = 'MESSAGE_CAMPAIGN_BODY',
|
||||
MESSAGE_CAMPAIGN_DETAILS = 'MESSAGE_CAMPAIGN_DETAILS',
|
||||
}
|
||||
|
||||
+61
@@ -24,6 +24,67 @@ import { WidgetConfigurationType } from 'src/engine/metadata-modules/page-layout
|
||||
import { validateWidgetConfigurationInput } from 'src/engine/metadata-modules/page-layout-widget/utils/validate-widget-configuration-input.util';
|
||||
|
||||
describe('validateWidgetConfigurationInput', () => {
|
||||
describe('EMAIL_THREAD widget', () => {
|
||||
it('should not throw for valid email thread configuration', () => {
|
||||
expect(() =>
|
||||
validateWidgetConfigurationInput({
|
||||
configuration: {
|
||||
configurationType: WidgetConfigurationType.EMAIL_THREAD,
|
||||
},
|
||||
}),
|
||||
).not.toThrow();
|
||||
});
|
||||
});
|
||||
|
||||
describe('MESSAGE_CAMPAIGN_BODY widget', () => {
|
||||
it('should not throw for valid message campaign body configuration', () => {
|
||||
expect(() =>
|
||||
validateWidgetConfigurationInput({
|
||||
configuration: {
|
||||
configurationType: WidgetConfigurationType.MESSAGE_CAMPAIGN_BODY,
|
||||
},
|
||||
}),
|
||||
).not.toThrow();
|
||||
});
|
||||
});
|
||||
|
||||
describe('MESSAGE_CAMPAIGN_DETAILS widget', () => {
|
||||
it('should not throw for valid message campaign details configuration', () => {
|
||||
expect(() =>
|
||||
validateWidgetConfigurationInput({
|
||||
configuration: {
|
||||
configurationType: WidgetConfigurationType.MESSAGE_CAMPAIGN_DETAILS,
|
||||
},
|
||||
}),
|
||||
).not.toThrow();
|
||||
});
|
||||
});
|
||||
|
||||
describe('CALL_RECORDING_SUMMARY widget', () => {
|
||||
it('should not throw for valid call recording summary configuration', () => {
|
||||
expect(() =>
|
||||
validateWidgetConfigurationInput({
|
||||
configuration: {
|
||||
configurationType: WidgetConfigurationType.CALL_RECORDING_SUMMARY,
|
||||
},
|
||||
}),
|
||||
).not.toThrow();
|
||||
});
|
||||
});
|
||||
|
||||
describe('CALL_RECORDING_TRANSCRIPT widget', () => {
|
||||
it('should not throw for valid call recording transcript configuration', () => {
|
||||
expect(() =>
|
||||
validateWidgetConfigurationInput({
|
||||
configuration: {
|
||||
configurationType:
|
||||
WidgetConfigurationType.CALL_RECORDING_TRANSCRIPT,
|
||||
},
|
||||
}),
|
||||
).not.toThrow();
|
||||
});
|
||||
});
|
||||
|
||||
describe('IFRAME widget', () => {
|
||||
it('should not throw for valid iframe configuration', () => {
|
||||
expect(() =>
|
||||
|
||||
+35
@@ -2,10 +2,15 @@ import { isNotEmptyObject, type ValidationError } from 'class-validator';
|
||||
|
||||
import { AggregateChartConfigurationDTO } from 'src/engine/metadata-modules/page-layout-widget/dtos/aggregate-chart-configuration.dto';
|
||||
import { BarChartConfigurationDTO } from 'src/engine/metadata-modules/page-layout-widget/dtos/bar-chart-configuration.dto';
|
||||
import { CallRecordingSummaryConfigurationDTO } from 'src/engine/metadata-modules/page-layout-widget/dtos/call-recording-summary-configuration.dto';
|
||||
import { CallRecordingTranscriptConfigurationDTO } from 'src/engine/metadata-modules/page-layout-widget/dtos/call-recording-transcript-configuration.dto';
|
||||
import { EmailThreadConfigurationDTO } from 'src/engine/metadata-modules/page-layout-widget/dtos/email-thread-configuration.dto';
|
||||
import { FieldConfigurationDTO } from 'src/engine/metadata-modules/page-layout-widget/dtos/field-configuration.dto';
|
||||
import { FrontComponentConfigurationDTO } from 'src/engine/metadata-modules/page-layout-widget/dtos/front-component-configuration.dto';
|
||||
import { IframeConfigurationDTO } from 'src/engine/metadata-modules/page-layout-widget/dtos/iframe-configuration.dto';
|
||||
import { LineChartConfigurationDTO } from 'src/engine/metadata-modules/page-layout-widget/dtos/line-chart-configuration.dto';
|
||||
import { MessageCampaignBodyConfigurationDTO } from 'src/engine/metadata-modules/page-layout-widget/dtos/message-campaign-body-configuration.dto';
|
||||
import { MessageCampaignDetailsConfigurationDTO } from 'src/engine/metadata-modules/page-layout-widget/dtos/message-campaign-details-configuration.dto';
|
||||
import { PieChartConfigurationDTO } from 'src/engine/metadata-modules/page-layout-widget/dtos/pie-chart-configuration.dto';
|
||||
import { RecordTableConfigurationDTO } from 'src/engine/metadata-modules/page-layout-widget/dtos/record-table-configuration.dto';
|
||||
import { StandaloneRichTextConfigurationDTO } from 'src/engine/metadata-modules/page-layout-widget/dtos/standalone-rich-text-configuration.dto';
|
||||
@@ -121,6 +126,36 @@ export const validateWidgetConfigurationInput = ({
|
||||
configuration,
|
||||
);
|
||||
break;
|
||||
case WidgetConfigurationType.EMAIL_THREAD:
|
||||
errors = validateWidgetConfigurationByDto(
|
||||
EmailThreadConfigurationDTO,
|
||||
configuration,
|
||||
);
|
||||
break;
|
||||
case WidgetConfigurationType.CALL_RECORDING_SUMMARY:
|
||||
errors = validateWidgetConfigurationByDto(
|
||||
CallRecordingSummaryConfigurationDTO,
|
||||
configuration,
|
||||
);
|
||||
break;
|
||||
case WidgetConfigurationType.CALL_RECORDING_TRANSCRIPT:
|
||||
errors = validateWidgetConfigurationByDto(
|
||||
CallRecordingTranscriptConfigurationDTO,
|
||||
configuration,
|
||||
);
|
||||
break;
|
||||
case WidgetConfigurationType.MESSAGE_CAMPAIGN_BODY:
|
||||
errors = validateWidgetConfigurationByDto(
|
||||
MessageCampaignBodyConfigurationDTO,
|
||||
configuration,
|
||||
);
|
||||
break;
|
||||
case WidgetConfigurationType.MESSAGE_CAMPAIGN_DETAILS:
|
||||
errors = validateWidgetConfigurationByDto(
|
||||
MessageCampaignDetailsConfigurationDTO,
|
||||
configuration,
|
||||
);
|
||||
break;
|
||||
case WidgetConfigurationType.VIEW:
|
||||
throw new PageLayoutWidgetException(
|
||||
'View configuration is not supported yet',
|
||||
|
||||
+6
@@ -39,6 +39,8 @@ const RECORD_PAGE_LAYOUT_WIDGET_TYPES = [
|
||||
WidgetType.WORKFLOW,
|
||||
WidgetType.WORKFLOW_VERSION,
|
||||
WidgetType.WORKFLOW_RUN,
|
||||
WidgetType.CALL_RECORDING_SUMMARY,
|
||||
WidgetType.CALL_RECORDING_TRANSCRIPT,
|
||||
WidgetType.MESSAGE_CAMPAIGN_BODY,
|
||||
WidgetType.MESSAGE_CAMPAIGN_DETAILS,
|
||||
];
|
||||
@@ -62,6 +64,10 @@ const WIDGET_TYPE_TO_CONFIGURATION_TYPE: Partial<
|
||||
[WidgetType.WORKFLOW_RUN]: WidgetConfigurationType.WORKFLOW_RUN,
|
||||
[WidgetType.RECORD_TABLE]: WidgetConfigurationType.RECORD_TABLE,
|
||||
[WidgetType.EMAIL_THREAD]: WidgetConfigurationType.EMAIL_THREAD,
|
||||
[WidgetType.CALL_RECORDING_SUMMARY]:
|
||||
WidgetConfigurationType.CALL_RECORDING_SUMMARY,
|
||||
[WidgetType.CALL_RECORDING_TRANSCRIPT]:
|
||||
WidgetConfigurationType.CALL_RECORDING_TRANSCRIPT,
|
||||
[WidgetType.MESSAGE_CAMPAIGN_BODY]:
|
||||
WidgetConfigurationType.MESSAGE_CAMPAIGN_BODY,
|
||||
[WidgetType.MESSAGE_CAMPAIGN_DETAILS]:
|
||||
|
||||
+2
@@ -378,6 +378,8 @@ export const fromUniversalConfigurationToFlatPageLayoutWidgetConfiguration = ({
|
||||
case WidgetConfigurationType.IFRAME:
|
||||
case WidgetConfigurationType.STANDALONE_RICH_TEXT:
|
||||
case WidgetConfigurationType.EMAIL_THREAD:
|
||||
case WidgetConfigurationType.CALL_RECORDING_SUMMARY:
|
||||
case WidgetConfigurationType.CALL_RECORDING_TRANSCRIPT:
|
||||
case WidgetConfigurationType.MESSAGE_CAMPAIGN_BODY:
|
||||
case WidgetConfigurationType.MESSAGE_CAMPAIGN_DETAILS:
|
||||
return universalConfiguration;
|
||||
|
||||
@@ -212,6 +212,8 @@ export type {
|
||||
EmailThreadConfiguration,
|
||||
MessageCampaignBodyConfiguration,
|
||||
MessageCampaignDetailsConfiguration,
|
||||
CallRecordingSummaryConfiguration,
|
||||
CallRecordingTranscriptConfiguration,
|
||||
CalendarConfiguration,
|
||||
WorkflowConfiguration,
|
||||
WorkflowVersionConfiguration,
|
||||
|
||||
+11
-1
@@ -167,6 +167,14 @@ export type MessageCampaignDetailsConfiguration = {
|
||||
configurationType: 'MESSAGE_CAMPAIGN_DETAILS';
|
||||
};
|
||||
|
||||
export type CallRecordingSummaryConfiguration = {
|
||||
configurationType: 'CALL_RECORDING_SUMMARY';
|
||||
};
|
||||
|
||||
export type CallRecordingTranscriptConfiguration = {
|
||||
configurationType: 'CALL_RECORDING_TRANSCRIPT';
|
||||
};
|
||||
|
||||
export type CalendarConfiguration = {
|
||||
configurationType: 'CALENDAR';
|
||||
};
|
||||
@@ -207,4 +215,6 @@ export type PageLayoutWidgetConfiguration =
|
||||
| WorkflowRunConfiguration
|
||||
| EmailThreadConfiguration
|
||||
| MessageCampaignBodyConfiguration
|
||||
| MessageCampaignDetailsConfiguration;
|
||||
| MessageCampaignDetailsConfiguration
|
||||
| CallRecordingSummaryConfiguration
|
||||
| CallRecordingTranscriptConfiguration;
|
||||
|
||||
Reference in New Issue
Block a user