chore: update codegen config for enum naming convention (#9751)
Co-authored-by: etiennejouan <jouan.etienne@gmail.com>
This commit is contained in:
@ -74,7 +74,7 @@ export const ObjectOptionsDropdownRecordGroupFieldsContent = () => {
|
||||
objectNamePlural,
|
||||
},
|
||||
{
|
||||
fieldType: FieldMetadataType.Select,
|
||||
fieldType: FieldMetadataType.SELECT,
|
||||
},
|
||||
);
|
||||
|
||||
|
||||
@ -7,8 +7,8 @@ jest.mock('@/object-metadata/hooks/useObjectMetadataItem', () => ({
|
||||
useObjectMetadataItem: jest.fn(() => ({
|
||||
objectMetadataItem: {
|
||||
fields: [
|
||||
{ type: FieldMetadataType.Currency, name: 'price' },
|
||||
{ type: FieldMetadataType.Text, name: 'name' },
|
||||
{ type: FieldMetadataType.CURRENCY, name: 'price' },
|
||||
{ type: FieldMetadataType.TEXT, name: 'name' },
|
||||
],
|
||||
},
|
||||
})),
|
||||
|
||||
@ -26,9 +26,9 @@ describe('useSearchRecordGroupField', () => {
|
||||
const mockContextValue = {
|
||||
objectMetadataItem: {
|
||||
fields: [
|
||||
{ type: FieldMetadataType.Select, label: 'First' },
|
||||
{ type: FieldMetadataType.Select, label: 'Second' },
|
||||
{ type: FieldMetadataType.Text, label: 'Third' },
|
||||
{ type: FieldMetadataType.SELECT, label: 'First' },
|
||||
{ type: FieldMetadataType.SELECT, label: 'Second' },
|
||||
{ type: FieldMetadataType.TEXT, label: 'Third' },
|
||||
],
|
||||
},
|
||||
};
|
||||
@ -40,7 +40,7 @@ describe('useSearchRecordGroupField', () => {
|
||||
});
|
||||
|
||||
expect(result.current.filteredRecordGroupFieldMetadataItems).toEqual([
|
||||
{ type: FieldMetadataType.Select, label: 'First' },
|
||||
{ type: FieldMetadataType.SELECT, label: 'First' },
|
||||
]);
|
||||
});
|
||||
|
||||
@ -48,9 +48,9 @@ describe('useSearchRecordGroupField', () => {
|
||||
const mockContextValue = {
|
||||
objectMetadataItem: {
|
||||
fields: [
|
||||
{ type: FieldMetadataType.Select, label: 'First' },
|
||||
{ type: FieldMetadataType.Select, label: 'Second' },
|
||||
{ type: FieldMetadataType.Text, label: 'Third' },
|
||||
{ type: FieldMetadataType.SELECT, label: 'First' },
|
||||
{ type: FieldMetadataType.SELECT, label: 'Second' },
|
||||
{ type: FieldMetadataType.TEXT, label: 'Third' },
|
||||
],
|
||||
},
|
||||
};
|
||||
@ -58,8 +58,8 @@ describe('useSearchRecordGroupField', () => {
|
||||
const { result } = renderWithContext(mockContextValue);
|
||||
|
||||
expect(result.current.filteredRecordGroupFieldMetadataItems).toEqual([
|
||||
{ type: FieldMetadataType.Select, label: 'First' },
|
||||
{ type: FieldMetadataType.Select, label: 'Second' },
|
||||
{ type: FieldMetadataType.SELECT, label: 'First' },
|
||||
{ type: FieldMetadataType.SELECT, label: 'Second' },
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
@ -19,7 +19,7 @@ export const useExportProcessRecordsForCSV = (objectNameSingular: string) => {
|
||||
}
|
||||
|
||||
switch (field.type) {
|
||||
case FieldMetadataType.Currency:
|
||||
case FieldMetadataType.CURRENCY:
|
||||
return {
|
||||
...processedRecord,
|
||||
[field.name]: {
|
||||
@ -29,7 +29,7 @@ export const useExportProcessRecordsForCSV = (objectNameSingular: string) => {
|
||||
currencyCode: record[field.name].currencyCode,
|
||||
} satisfies FieldCurrencyValue,
|
||||
};
|
||||
case FieldMetadataType.RawJson:
|
||||
case FieldMetadataType.RAW_JSON:
|
||||
return {
|
||||
...processedRecord,
|
||||
[field.name]: JSON.stringify(record[field.name]),
|
||||
|
||||
@ -16,7 +16,7 @@ export const useSearchRecordGroupField = () => {
|
||||
|
||||
return objectMetadataItem.fields.filter(
|
||||
(field) =>
|
||||
field.type === FieldMetadataType.Select &&
|
||||
field.type === FieldMetadataType.SELECT &&
|
||||
field.label.toLocaleLowerCase().includes(searchInputLowerCase),
|
||||
);
|
||||
}, [objectMetadataItem.fields, recordGroupFieldSearchInput]);
|
||||
|
||||
Reference in New Issue
Block a user