Import - fixes (#12569)
<img width="800" alt="Screenshot 2025-06-12 at 15 22 49" src="https://github.com/user-attachments/assets/afaa4ef1-b16c-4c05-ba4a-d77ad2ccfa76" /> To test : - unselect an option on select/multi-select matching (matching step) - match a mutli-select field with an other field closes : https://github.com/twentyhq/core-team-issues/issues/1065 closes : https://github.com/twentyhq/core-team-issues/issues/1066
This commit is contained in:
@ -1,3 +1,4 @@
|
||||
import { RATING_VALUES } from '@/object-record/record-field/meta-types/constants/RatingValues';
|
||||
import { emailSchema } from '@/object-record/record-field/validation-schemas/emailSchema';
|
||||
import { SpreadsheetImportFieldValidationDefinition } from '@/spreadsheet-import/types';
|
||||
import { t } from '@lingui/core/macro';
|
||||
@ -214,6 +215,22 @@ export const getSpreadSheetFieldValidationDefinitions = (
|
||||
level: 'error',
|
||||
},
|
||||
];
|
||||
case FieldMetadataType.RATING: {
|
||||
const ratingValues = RATING_VALUES.join(', ');
|
||||
|
||||
return [
|
||||
{
|
||||
rule: 'function',
|
||||
isValid: (value: string) => {
|
||||
return RATING_VALUES.includes(
|
||||
value as (typeof RATING_VALUES)[number],
|
||||
);
|
||||
},
|
||||
errorMessage: `${fieldName} ${t` must be one of ${ratingValues} values`}`,
|
||||
level: 'error',
|
||||
},
|
||||
];
|
||||
}
|
||||
default:
|
||||
return [];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user