dashboard workspace standard seeds (#16962)
# Introduction In this pull request we're introducing new standard page layout, tabs and widget ( 1 page layout, 1 tab and 8 widgets ) and also a new opportunity field Also now prefilling new records, 6 opportunities and a dashboard. ## Standard declaration ### New workspace creation Relies on existing standard declaration builder ### Backfill command We've been hacking through the standard builder in order to extract only the standard page layout entities, updated their entity dependencies to match the workspace ids so the validation passes ## Remark - Refactored the `PageLayoutWidget` configuration type to be dynamically typed through a generic discriminated union --------- Co-authored-by: prastoin <paul@twenty.com>
This commit is contained in:
+59
@@ -3,13 +3,24 @@ import { type FieldsConfiguration } from '@/page-layout/types/FieldsConfiguratio
|
||||
import {
|
||||
type AggregateChartConfiguration,
|
||||
type BarChartConfiguration,
|
||||
type CalendarConfiguration,
|
||||
type EmailsConfiguration,
|
||||
type FieldRichTextConfiguration,
|
||||
type FilesConfiguration,
|
||||
type GaugeChartConfiguration,
|
||||
type IframeConfiguration,
|
||||
type LineChartConfiguration,
|
||||
type NotesConfiguration,
|
||||
type PieChartConfiguration,
|
||||
type StandaloneRichTextConfiguration,
|
||||
type TasksConfiguration,
|
||||
type TimelineConfiguration,
|
||||
type ViewConfiguration,
|
||||
type WidgetConfiguration,
|
||||
type WidgetConfigurationType,
|
||||
type WorkflowConfiguration,
|
||||
type WorkflowRunConfiguration,
|
||||
type WorkflowVersionConfiguration,
|
||||
} from '~/generated/graphql';
|
||||
|
||||
type WidgetConfigurationTypenameMap = {
|
||||
@@ -22,6 +33,27 @@ type WidgetConfigurationTypenameMap = {
|
||||
BarChartConfiguration: Omit<BarChartConfiguration, 'configurationType'> & {
|
||||
configurationType: WidgetConfigurationType.BAR_CHART;
|
||||
};
|
||||
CalendarConfiguration: Omit<CalendarConfiguration, 'configurationType'> & {
|
||||
configurationType: WidgetConfigurationType.CALENDAR;
|
||||
};
|
||||
EmailsConfiguration: Omit<EmailsConfiguration, 'configurationType'> & {
|
||||
configurationType: WidgetConfigurationType.EMAILS;
|
||||
};
|
||||
FieldConfiguration: Omit<FieldConfiguration, 'configurationType'> & {
|
||||
configurationType: WidgetConfigurationType.FIELD;
|
||||
};
|
||||
FieldRichTextConfiguration: Omit<
|
||||
FieldRichTextConfiguration,
|
||||
'configurationType'
|
||||
> & {
|
||||
configurationType: WidgetConfigurationType.FIELD_RICH_TEXT;
|
||||
};
|
||||
FieldsConfiguration: Omit<FieldsConfiguration, 'configurationType'> & {
|
||||
configurationType: WidgetConfigurationType.FIELDS;
|
||||
};
|
||||
FilesConfiguration: Omit<FilesConfiguration, 'configurationType'> & {
|
||||
configurationType: WidgetConfigurationType.FILES;
|
||||
};
|
||||
GaugeChartConfiguration: Omit<
|
||||
GaugeChartConfiguration,
|
||||
'configurationType'
|
||||
@@ -34,6 +66,9 @@ type WidgetConfigurationTypenameMap = {
|
||||
LineChartConfiguration: Omit<LineChartConfiguration, 'configurationType'> & {
|
||||
configurationType: WidgetConfigurationType.LINE_CHART;
|
||||
};
|
||||
NotesConfiguration: Omit<NotesConfiguration, 'configurationType'> & {
|
||||
configurationType: WidgetConfigurationType.NOTES;
|
||||
};
|
||||
PieChartConfiguration: Omit<PieChartConfiguration, 'configurationType'> & {
|
||||
configurationType: WidgetConfigurationType.PIE_CHART;
|
||||
};
|
||||
@@ -43,6 +78,30 @@ type WidgetConfigurationTypenameMap = {
|
||||
> & {
|
||||
configurationType: WidgetConfigurationType.STANDALONE_RICH_TEXT;
|
||||
};
|
||||
TasksConfiguration: Omit<TasksConfiguration, 'configurationType'> & {
|
||||
configurationType: WidgetConfigurationType.TASKS;
|
||||
};
|
||||
TimelineConfiguration: Omit<TimelineConfiguration, 'configurationType'> & {
|
||||
configurationType: WidgetConfigurationType.TIMELINE;
|
||||
};
|
||||
ViewConfiguration: Omit<ViewConfiguration, 'configurationType'> & {
|
||||
configurationType: WidgetConfigurationType.VIEW;
|
||||
};
|
||||
WorkflowConfiguration: Omit<WorkflowConfiguration, 'configurationType'> & {
|
||||
configurationType: WidgetConfigurationType.WORKFLOW;
|
||||
};
|
||||
WorkflowRunConfiguration: Omit<
|
||||
WorkflowRunConfiguration,
|
||||
'configurationType'
|
||||
> & {
|
||||
configurationType: WidgetConfigurationType.WORKFLOW_RUN;
|
||||
};
|
||||
WorkflowVersionConfiguration: Omit<
|
||||
WorkflowVersionConfiguration,
|
||||
'configurationType'
|
||||
> & {
|
||||
configurationType: WidgetConfigurationType.WORKFLOW_VERSION;
|
||||
};
|
||||
};
|
||||
|
||||
type WidgetConfigurationTypename = keyof WidgetConfigurationTypenameMap;
|
||||
|
||||
Reference in New Issue
Block a user