chore: update codegen config for enum naming convention (#9751)
Co-authored-by: etiennejouan <jouan.etienne@gmail.com>
This commit is contained in:
@ -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
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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(
|
||||
|
||||
Reference in New Issue
Block a user