Hello @anon7311026
It seems to working for me now, Indeed I think the issue was caused by the field action_a_mener_enum So what I did was:
collection.replaceFieldOperator(field+'_enum', "Equal", async (value, context) => {
return {
field: field, operator: "Equal", value
}
});
I overrided the Field Operator for the field to keep it filtering with the original field name without the “_enum”
The full code
export function setFieldEnums(collection, field, enumValues) {
const OPERATORS = ['Present',
'Blank',
'Missing',
'Equal',
'NotEqual',
'LessThan',
'GreaterThan',
'In',
'NotIn',
'Matches',
'ILike',
'Like',
'StartsWith',
'EndsWith',
'Contains',
'NotContains',
'LongerThan',
'ShorterThan',
'Before',
'After',
'AfterXHoursAgo',
'BeforeXHoursAgo',
'Past',
'Future',
'PreviousMonthToDate',
'PreviousMonth',
'PreviousQuarterToDate',
'PreviousQuarter',
'PreviousWeekToDate',
'PreviousWeek',
'PreviousXDaysToDate',
'PreviousXDays',
'PreviousYearToDate',
'PreviousYear',
'Today',
'Yesterday',
'IncludesAll']
collection.addField(field + '_enum', {
columnType: 'Enum',
enumValues: enumValues,
dependencies: [field],
getValues(records) {
return records.map(record => record[field]);
},
})
.removeField(field)
.replaceFieldWriting(field + '_enum', async value => {
return { [field]: value };
});
OPERATORS.forEach(operator => {
collection.replaceFieldOperator(field + '_enum', operator, async (value, context) => {
return {
field, operator, value
}
});
});
}