fix(spec): enforce ViewFilterRuleSchema operator enum + typed sort#3363
fix(spec): enforce ViewFilterRuleSchema operator enum + typed sort#3363akarma-synetal wants to merge 1 commit into
Conversation
- `operator`: z.string() → z.enum([equals, not_equals, contains, not_contains, starts_with, ends_with, greater_than, less_than, greater_than_or_equal, less_than_or_equal, in, not_in, is_empty, is_not_empty, is_null, is_not_null, before, after, between]) so the SchemaForm renderer auto-generates a Select dropdown instead of a generic text input. - `sort`: z.union([z.string(), z.array(...)]) → z.array(...) only. The union form confused the RepeaterField, causing it to render no UI at all for the sort sub-field. - Updated a test fixture (task.view.ts) and share-link object (sys-share-link.object.ts) to use valid operators / array sort. - Fixed spec tests to match the new enum (this_quarter → is_empty, gte → greater_than_or_equal, string sort → array sort). Co-authored-by: Cursor <cursoragent@cursor.com>
|
@akarma-synetal is attempting to deploy a commit to the Object Stack Team on Vercel. A member of the Team first needs to authorize it. |
|
Thanks for tackling this — the underlying need (a real operator enum so SchemaForm can render a dropdown and invalid operators are rejected) was sound, and it shipped in a reworked form via #3373 (now merged to The rework kept your enum direction but adjusted a few things that made the original approach risky:
It also pins Since the change is now on Generated by Claude Code |
Summary
operator:z.string()→z.enum([19 valid operators])so SchemaForm auto-renders a Select dropdownsort:z.union([z.string(), z.array(...)])→z.array(...)so RepeaterField renders sort sub-fields correctlyTest plan
pnpm --filter @objectstack/spec test— 6807 passed, 0 failedMade with Cursor