You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(spec): enforce ViewFilterRule operator enum with legacy-alias normalization (#3373)
* fix(spec): enforce ViewFilterRule operator enum with legacy-alias normalization
Replace the free-form `operator: z.string()` on ViewFilterRuleSchema with a
canonical `z.enum` (VIEW_FILTER_OPERATORS) wrapped in `z.preprocess` that folds
legacy shorthand/camelCase spellings (eq, gt, isNull, notEquals, …) to canonical
on parse. This surfaces a clean operator enum to JSON-Schema consumers (ObjectUI
SchemaForm renders a dropdown) and rejects genuinely unknown operators, while
already-stored metadata keeps validating and upgrades to one vocabulary.
- Export VIEW_FILTER_OPERATORS, ViewFilterOperator, VIEW_FILTER_OPERATOR_ALIASES
and a normalizeFilterOperator() helper as the single source of truth.
- Pin `widget: 'filter-builder'` on the list view `filter` field in view.form.ts,
matching dataset/page forms so the visual builder renders instead of a repeater.
- Canonicalize plugin-sharing sys_share_link filters (isNull -> is_null,
isNotNull -> is_not_null), preserving null semantics.
- Keep the legacy string `sort` form (deprecation note only); retain the
objectui#2601 regression fixture.
- Relative-date operators (this_quarter, …) are not filter-rule operators; tests
updated to canonical operators and alias-normalization / unknown-rejection
coverage added.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PwbhoMeqh33xFWq5M77QTJ
* docs(spec): regenerate view/component/page references for operator enum
Auto-generated reference docs reflect the ViewFilterRule operator enum
(replacing the free-form `string`). Regenerated via gen:schema && gen:docs.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PwbhoMeqh33xFWq5M77QTJ
* chore(spec): update api-surface snapshot for new ViewFilterRule exports
Additive-only: VIEW_FILTER_OPERATORS, VIEW_FILTER_OPERATOR_ALIASES,
ViewFilterOperator, normalizeFilterOperator (0 breaking, 4 added).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PwbhoMeqh33xFWq5M77QTJ
---------
Co-authored-by: Claude <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: content/docs/references/ui/component.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -366,7 +366,7 @@ Type: `string`
366
366
|**columns**|`string[]`| optional | Fields to display in the related list. Optional: when omitted, columns derive from the related object's highlightFields / default list columns (a related list is just another surface that lists that object). Override chain: child highlightFields → field-level relatedListColumns → this inline list. |
367
367
|**sort**|`string \| { field: string; order: Enum<'asc' \| 'desc'> }[]`| optional | Sort order for related records |
368
368
|**limit**|`integer`| ✅ | Number of records to display initially |
369
-
|**filter**|`{ field: string; operator: string; value?: string \| number \| boolean \| null \| string \| number[] }[]`| optional | Additional filter criteria for related records |
|**kind**|`Enum<'full' \| 'slotted' \| 'html' \| 'react' \| 'jsx'>`| optional | Page override mode. full \| slotted = structured authoring; html = author-written constrained JSX/HTML+Tailwind compiled (parsed, never executed) to the tree (ADR-0080; the legacy value 'jsx' is a deprecated alias); react = real-React source executed at render by the runtime (ADR-0081); it runs author JS, so it is gated by a host capability that defaults ON and is disabled server-side via the OS_PAGE_REACT=off env toggle. |
|**searchableFields**|`string[]`| optional | Fields enabled for search |
347
347
|**filterableFields**|`string[]`| optional | Legacy shorthand for userFilters.fields — bare field names enabled for end-user filtering. Prefer userFilters |
|**searchableFields**|`string[]`| optional | Fields enabled for search |
436
436
|**filterableFields**|`string[]`| optional | Legacy shorthand for userFilters.fields — bare field names enabled for end-user filtering. Prefer userFilters |
@@ -713,7 +713,7 @@ View filter rule
713
713
| Property | Type | Required | Description |
714
714
| :--- | :--- | :--- | :--- |
715
715
|**field**|`string`| ✅ | Field name to filter on |
{field: 'filter',widget: 'filter-builder',dependsOn: 'data.object',helpText: 'Filter conditions — same visual builder as the list toolbar, with field-type-aware operators and value inputs'},
0 commit comments