Standardize filter syntax to MongoDB-style and complete documentation#53
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
… guide Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
…ters Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
|
@copilot fix build |
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This pull request standardizes filter syntax across the ObjectStack spec from array-based filters to MongoDB-style FilterCondition objects. The change affects dashboard widgets, reports, and client SDK examples, providing a more intuitive and type-safe querying interface.
Changes:
- Replaced old
filter + filterItemsstructure in Reports with a singlefilter: FilterConditionSchema - Updated Dashboard widgets to use FilterConditionSchema instead of
z.any() - Migrated all examples (dashboards, reports, client tests) from array-based syntax
[['field', '=', 'value']]to MongoDB-style{ field: value }or{ field: { $op: value } }
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/spec/src/ui/report.zod.ts | Replaced filter/filterItems with single FilterConditionSchema |
| packages/spec/src/ui/dashboard.zod.ts | Changed filter from z.any() to FilterConditionSchema |
| packages/spec/src/ui/dashboard.test.ts | Updated all 14 test filters to MongoDB-style syntax |
| packages/spec/json-schema/Report.json | Generated JSON schema for new FilterCondition structure |
| packages/spec/json-schema/DashboardWidget.json | Generated JSON schema with FilterCondition allOf pattern |
| packages/spec/json-schema/Dashboard.json | Generated JSON schema with FilterCondition allOf pattern |
| examples/todo/src/client-test.ts | Updated client example to use MongoDB-style filters with 'filters' property |
| examples/crm/src/ui/reports.ts | Converted 6 report filters from old filterItems to FilterCondition |
| examples/crm/src/ui/dashboards.ts | Converted 14 dashboard widget filters to MongoDB-style syntax |
| content/docs/references/ui/analytics/Report.mdx | Updated documentation to reflect filter schema change |
| | **groupingsAcross** | `object[]` | optional | Column groupings (Matrix only) | | ||
| | **filter** | `string` | optional | Filter logic (e.g. "1 AND (2 OR 3)") | | ||
| | **filterItems** | `object[]` | optional | Filter criteria lines | | ||
| | **filter** | `any` | optional | Filter criteria | |
There was a problem hiding this comment.
The filter type documentation should reference FilterCondition instead of any for clarity. This should be consistent with the schema change that uses FilterConditionSchema. Consider updating to: **filter** | FilterCondition | optional | Filter criteria
| | **filter** | `any` | optional | Filter criteria | | |
| | **filter** | `FilterCondition` | optional | Filter criteria | |
…on-GET (ADR §5.2) (#1568) Removes the framework's hardcoded install-policy dead-end. The marketplace proxy is a BROWSE mechanism: it forwards GET/HEAD reads and carries no credentialled cloud auth. It must not pretend to own install *policy*. Previously a non-GET marketplace request returned a 405 `marketplace_method_not_allowed` "install via cloud" — a dead-end the in-env Install button hit (framework#1548). Now non-GET requests PASS THROUGH (`next()`) so a host-supplied install route — mounted after this plugin via the createObjectOSStack `extraPlugins` seam — can claim them; if none does, the app returns its normal 404 instead of a misleading policy 405. This is the "remove framework's hardcoded marketplace policy" half of ADR §5.2, now that the cloud side has landed + deployed: ObjectStack Cloud owns install (the `/cloud-connection/install` route + `sys_package.install_package` action + the tiered cloud-connection gate — cloud PR #53). The framework keeps only the neutral browse mechanism. Test: 3 cases — non-GET passes through (not 405); install-local still passes through; no-control-plane still 503s. Full src/cloud suite (40) stays green. Co-authored-by: Jack Zhuang <277994282+os-zhuang@users.noreply.github.com> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Filter Documentation & Code Standardization - COMPLETED ✅
Issues Identified
Documentation Updates Completed ✅
Code Updates Completed ✅
Summary of Changes
Migration Notes
[['field', '=', 'value']]→ New:{ field: 'value' }[['stage', '!=', 'won'], ['stage', '!=', 'lost']]→ New:{ stage: { $nin: ['won', 'lost'] } }filterobject with FilterConditionfiltersproperty (notwhere) for MongoDB-style filtersOriginal prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.