chore: update codegen config for enum naming convention (#9751)

Co-authored-by: etiennejouan <jouan.etienne@gmail.com>
This commit is contained in:
Etienne
2025-01-21 11:34:33 +01:00
committed by GitHub
parent d4b038f24a
commit e1731bb31e
222 changed files with 1245 additions and 1235 deletions

View File

@ -19,24 +19,24 @@ export const RELATION_TYPES: Record<
isImageFlipped?: boolean;
}
> = {
[RelationDefinitionType.OneToMany]: {
[RelationDefinitionType.ONE_TO_MANY]: {
label: 'Has many',
Icon: IllustrationIconOneToMany,
imageSrc: OneToManySvg,
},
[RelationDefinitionType.OneToOne]: {
[RelationDefinitionType.ONE_TO_ONE]: {
label: 'Has one',
Icon: IllustrationIconOneToOne,
imageSrc: OneToOneSvg,
},
[RelationDefinitionType.ManyToOne]: {
[RelationDefinitionType.MANY_TO_ONE]: {
label: 'Belongs to one',
Icon: IllustrationIconOneToMany,
imageSrc: OneToManySvg,
isImageFlipped: true,
},
// Not supported yet
[RelationDefinitionType.ManyToMany]: {
[RelationDefinitionType.MANY_TO_MANY]: {
label: 'Belongs to many',
Icon: IllustrationIconManyToMany,
imageSrc: OneToManySvg,

View File

@ -34,7 +34,7 @@ type SettingsCompositeFieldTypeConfigArray = Record<
>;
export const SETTINGS_COMPOSITE_FIELD_TYPE_CONFIGS = {
[FieldMetadataType.Currency]: {
[FieldMetadataType.CURRENCY]: {
label: 'Currency',
Icon: IllustrationIconCurrency,
subFields: ['amountMicros'],
@ -49,7 +49,7 @@ export const SETTINGS_COMPOSITE_FIELD_TYPE_CONFIGS = {
},
category: 'Basic',
} as const satisfies SettingsCompositeFieldTypeConfig<FieldCurrencyValue>,
[FieldMetadataType.Emails]: {
[FieldMetadataType.EMAILS]: {
label: 'Emails',
Icon: IllustrationIconMail,
subFields: ['primaryEmail', 'additionalEmails'],
@ -68,7 +68,7 @@ export const SETTINGS_COMPOSITE_FIELD_TYPE_CONFIGS = {
},
category: 'Basic',
} as const satisfies SettingsCompositeFieldTypeConfig<FieldEmailsValue>,
[FieldMetadataType.Links]: {
[FieldMetadataType.LINKS]: {
label: 'Links',
Icon: IllustrationIconLink,
exampleValue: {
@ -85,7 +85,7 @@ export const SETTINGS_COMPOSITE_FIELD_TYPE_CONFIGS = {
secondaryLinks: 'Secondary Links',
},
} as const satisfies SettingsCompositeFieldTypeConfig<FieldLinksValue>,
[FieldMetadataType.Phones]: {
[FieldMetadataType.PHONES]: {
label: 'Phones',
Icon: IllustrationIconPhone,
exampleValue: {
@ -110,7 +110,7 @@ export const SETTINGS_COMPOSITE_FIELD_TYPE_CONFIGS = {
},
category: 'Basic',
} as const satisfies SettingsCompositeFieldTypeConfig<FieldPhonesValue>,
[FieldMetadataType.FullName]: {
[FieldMetadataType.FULL_NAME]: {
label: 'Full Name',
Icon: IllustrationIconUser,
exampleValue: { firstName: 'John', lastName: 'Doe' },
@ -122,7 +122,7 @@ export const SETTINGS_COMPOSITE_FIELD_TYPE_CONFIGS = {
lastName: 'Last Name',
},
} as const satisfies SettingsCompositeFieldTypeConfig<FieldFullNameValue>,
[FieldMetadataType.Address]: {
[FieldMetadataType.ADDRESS]: {
label: 'Address',
Icon: IllustrationIconMap,
subFields: [
@ -165,7 +165,7 @@ export const SETTINGS_COMPOSITE_FIELD_TYPE_CONFIGS = {
},
category: 'Basic',
} as const satisfies SettingsCompositeFieldTypeConfig<FieldAddressValue>,
[FieldMetadataType.Actor]: {
[FieldMetadataType.ACTOR]: {
label: 'Actor',
Icon: IllustrationIconSetting,
category: 'Basic',

View File

@ -52,83 +52,83 @@ type SettingsNonCompositeFieldTypeConfigArray = Record<
// TODO: can we derive this from backend definitions ?
export const SETTINGS_NON_COMPOSITE_FIELD_TYPE_CONFIGS: SettingsNonCompositeFieldTypeConfigArray =
{
[FieldMetadataType.Uuid]: {
[FieldMetadataType.UUID]: {
label: 'Unique ID',
Icon: IllustrationIconUid,
exampleValue: '00000000-0000-0000-0000-000000000000',
category: 'Advanced',
} as const satisfies SettingsFieldTypeConfig<FieldUUidValue>,
[FieldMetadataType.Text]: {
[FieldMetadataType.TEXT]: {
label: 'Text',
Icon: IllustrationIconText,
exampleValue:
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum magna enim, dapibus non enim in, lacinia faucibus nunc. Sed interdum ante sed felis facilisis, eget ultricies neque molestie. Mauris auctor, justo eu volutpat cursus, libero erat tempus nulla, non sodales lorem lacus a est.',
category: 'Basic',
} as const satisfies SettingsFieldTypeConfig<FieldTextValue>,
[FieldMetadataType.Numeric]: {
[FieldMetadataType.NUMERIC]: {
label: 'Numeric',
Icon: IllustrationIconNumbers,
exampleValue: 2000,
category: 'Basic',
} as const satisfies SettingsFieldTypeConfig<FieldNumberValue>,
[FieldMetadataType.Number]: {
[FieldMetadataType.NUMBER]: {
label: 'Number',
Icon: IllustrationIconNumbers,
exampleValue: 2000,
category: 'Basic',
} as const satisfies SettingsFieldTypeConfig<FieldNumberValue>,
[FieldMetadataType.Boolean]: {
[FieldMetadataType.BOOLEAN]: {
label: 'True/False',
Icon: IllustrationIconToggle,
exampleValue: true,
category: 'Basic',
} as const satisfies SettingsFieldTypeConfig<FieldBooleanValue>,
[FieldMetadataType.DateTime]: {
[FieldMetadataType.DATE_TIME]: {
label: 'Date and Time',
Icon: IllustrationIconCalendarTime,
exampleValue: DEFAULT_DATE_VALUE.toISOString(),
category: 'Basic',
} as const satisfies SettingsFieldTypeConfig<FieldDateTimeValue>,
[FieldMetadataType.Date]: {
[FieldMetadataType.DATE]: {
label: 'Date',
Icon: IllustrationIconCalendarEvent,
exampleValue: DEFAULT_DATE_VALUE.toISOString(),
category: 'Basic',
} as const satisfies SettingsFieldTypeConfig<FieldDateValue>,
[FieldMetadataType.Select]: {
[FieldMetadataType.SELECT]: {
label: 'Select',
Icon: IllustrationIconTag,
category: 'Basic',
} as const satisfies SettingsFieldTypeConfig<FieldSelectValue>,
[FieldMetadataType.MultiSelect]: {
[FieldMetadataType.MULTI_SELECT]: {
label: 'Multi-select',
Icon: IllustrationIconTags,
category: 'Basic',
} as const satisfies SettingsFieldTypeConfig<FieldMultiSelectValue>,
[FieldMetadataType.Relation]: {
[FieldMetadataType.RELATION]: {
label: 'Relation',
Icon: IllustrationIconOneToMany,
category: 'Relation',
} as const satisfies SettingsFieldTypeConfig<FieldRelationValue<any>>,
[FieldMetadataType.Rating]: {
[FieldMetadataType.RATING]: {
label: 'Rating',
Icon: IllustrationIconStar,
exampleValue: 'RATING_3',
category: 'Basic',
} as const satisfies SettingsFieldTypeConfig<FieldRatingValue>,
[FieldMetadataType.RawJson]: {
[FieldMetadataType.RAW_JSON]: {
label: 'JSON',
Icon: IllustrationIconJson,
exampleValue: { key: 'value' },
category: 'Advanced',
} as const satisfies SettingsFieldTypeConfig<FieldJsonValue>,
[FieldMetadataType.RichText]: {
[FieldMetadataType.RICH_TEXT]: {
label: 'Rich Text',
Icon: IllustrationIconSetting,
exampleValue: "{ key: 'value' }",
category: 'Basic',
} as const satisfies SettingsFieldTypeConfig<FieldRichTextValue>,
[FieldMetadataType.Array]: {
[FieldMetadataType.ARRAY]: {
label: 'Array',
Icon: IllustrationIconArray,
category: 'Advanced',