@@ -65,12 +65,19 @@ export const BUILDER_TO_SPEC_OP: Record<string, string> = {
6565// Field type normalization: ObjectUI → FilterBuilder
6666// ---------------------------------------------------------------------------
6767
68+ /**
69+ * Normalize raw field types to the 5 categories supported by FilterBuilder/SortBuilder.
70+ * Lookup-like types (lookup, master_detail, user, owner) map to 'select' because
71+ * FilterBuilder handles them identically when options are provided — the distinction
72+ * between select and lookup operators is handled within FilterBuilder itself via the
73+ * original field.type passed through ListView's filterFields.
74+ */
6875export function normalizeFieldType ( rawType ?: string ) : 'text' | 'number' | 'boolean' | 'date' | 'select' {
6976 const t = ( rawType || '' ) . toLowerCase ( ) ;
7077 if ( [ 'integer' , 'int' , 'float' , 'double' , 'number' , 'currency' , 'money' , 'percent' , 'rating' ] . includes ( t ) ) return 'number' ;
71- if ( [ 'date' , 'datetime' , 'datetime_tz' , 'timestamp' ] . includes ( t ) ) return 'date' ;
78+ if ( [ 'date' , 'datetime' , 'datetime_tz' , 'timestamp' , 'time' ] . includes ( t ) ) return 'date' ;
7279 if ( [ 'boolean' , 'bool' , 'checkbox' , 'switch' ] . includes ( t ) ) return 'boolean' ;
73- if ( [ 'select' , 'picklist' , 'single_select' , 'multi_select' , 'enum' ] . includes ( t ) ) return 'select' ;
80+ if ( [ 'select' , 'picklist' , 'single_select' , 'multi_select' , 'enum' , 'status' , 'lookup' , 'master_detail' , 'user' , 'owner' ] . includes ( t ) ) return 'select' ;
7481 return 'text' ;
7582}
7683
0 commit comments