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

@ -9,7 +9,7 @@ describe('isSelectOptionDefaultValue', () => {
const optionValue = 'OPTION_1';
const fieldMetadataItem = {
defaultValue: `'${optionValue}'`,
type: FieldMetadataType.Select,
type: FieldMetadataType.SELECT,
};
// When
@ -24,7 +24,7 @@ describe('isSelectOptionDefaultValue', () => {
const optionValue = 'OPTION_1';
const fieldMetadataItem = {
defaultValue: "'OPTION_2'",
type: FieldMetadataType.Select,
type: FieldMetadataType.SELECT,
};
// When
@ -41,7 +41,7 @@ describe('isSelectOptionDefaultValue', () => {
const optionValue = 'OPTION_1';
const fieldMetadataItem = {
defaultValue: ["'OPTION_1'", "'OPTION_2'"],
type: FieldMetadataType.MultiSelect,
type: FieldMetadataType.MULTI_SELECT,
};
// When
@ -56,7 +56,7 @@ describe('isSelectOptionDefaultValue', () => {
const optionValue = 'OPTION_1';
const fieldMetadataItem = {
defaultValue: ["'OPTION_2'", "'OPTION_3'"],
type: FieldMetadataType.MultiSelect,
type: FieldMetadataType.MULTI_SELECT,
};
// When

View File

@ -13,7 +13,7 @@ export const getFieldPreviewValueFromRecord = ({
// Relation fields (to many)
if (
fieldMetadataItem.type === FieldMetadataType.Relation &&
fieldMetadataItem.type === FieldMetadataType.RELATION &&
Array.isArray(recordFieldValue?.edges)
) {
return recordFieldValue.edges[0]?.node;

View File

@ -6,14 +6,14 @@ export const isSelectOptionDefaultValue = (
optionValue: string,
fieldMetadataItem: Pick<FieldMetadataItem, 'defaultValue' | 'type'>,
): boolean => {
if (fieldMetadataItem.type === FieldMetadataType.Select) {
if (fieldMetadataItem.type === FieldMetadataType.SELECT) {
return (
applySimpleQuotesToString(optionValue) === fieldMetadataItem.defaultValue
);
}
if (
fieldMetadataItem.type === FieldMetadataType.MultiSelect &&
fieldMetadataItem.type === FieldMetadataType.MULTI_SELECT &&
Array.isArray(fieldMetadataItem.defaultValue)
) {
return fieldMetadataItem.defaultValue.includes(