Uh oh!
There was an error while loading. Please reload this page.
feat(fields): pickers for the Sharing Rule form (object / criteria / recipient) - #2421
Merged
Merged
Conversation
…recipient) Three widget-hint field components make the generic object form render pickers where an admin previously had to type machine data (driven by the framework `widget` hints on sys_sharing_rule; generalizes the capability-multiselect pattern). All degrade to the underlying `type` renderer when unregistered. - object-ref: choose a registered object by name (searchable Combobox), backed by the new DataSource.getObjects() (ObjectStackAdapter lists code- and DB-defined objects via /api/v1/meta/object), falling back to sys_metadata. - filter-condition: visual FilterBuilder scoped to the fields of the object chosen in a sibling field (getObjectSchema), round-tripping the stored MongoDB-style FilterCondition JSON. Unrepresentable / invalid criteria fall back to a raw-JSON editor (always-available toggle) — nothing is lost. - recipient-picker: record picker whose target object follows a sibling recipient_type (user/team/business_unit/position), storing the value the evaluator matches on (record id, or the position name); resets on type change. Wiring: the three keys join DATA_SOURCE_FIELD_TYPES (form.tsx) so the form threads dataSource + dependentValues, and INLINE_EXCLUDED_FIELD_TYPES. DataSource.getObjects() is optional on the interface; the adapter implements it. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013wGu7aa1YXhHseojW9CBRf
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
os-zhuang
marked this pull request as ready for review
July 13, 2026 07:35
Uh oh!
There was an error while loading. Please reload this page.
akarma-synetal pushed a commit
to akarma-synetal/objectui
that referenced
this pull request
Aug 17, 2026
…bjectstack-ai#4790) (objectstack-ai#4816) * refactor(core,components): one reference-field family, not a form-private copy (objectstack-ai#4790) `EXPANDABLE_FIELD_TYPES` (core) and the form renderer's private `DATA_SOURCE_FIELD_TYPES` both encoded "this field's value is a foreign key", and the core side's TSDoc claimed to mirror the form's. It did, for 15 days: the form's copy gained `capability-multiselect` (objectstack-ai#2403) and the three widget-hint pickers (objectstack-ai#2421) on 2026-07-13, after which the two sets were not in a subset relation in either direction and no gate could say so. The form now derives: `needsDataSourceWiring` asks core's set for the reference half and a local `DATA_SOURCE_ONLY_WIDGET_TYPES` for the three picker names, which are widget hints and can never be a declarable field type. Behaviour change, and the live half of the drift: a `user` field now receives `dataSource` / `dependentValues` / `dependsOnLabels` like every other reference field. It previously received none of the three; the first two have a context fallback inside the widget, `dependsOnLabels` has none, so a dependency-gated user picker interpolated raw API names into its "select ... first" hint. Each surface keeps its own normalization, as with CASCADE_OPTION_WIDGET_TYPES. The form gains an identity pin: a re-inlined private copy with identical members fails it while every membership assertion stays green. Co-authored-by: Claude <noreply@anthropic.com> * chore: changeset for the form data-source wiring convergence (objectstack-ai#4790) Co-authored-by: Claude <noreply@anthropic.com> --------- Co-authored-by: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
Three new widget-hint field components make the generic object form render pickers where an admin previously had to type machine data. They're reached via a field's
widget:hint (resolved asfield:<widget>), driven by the framework'swidgetdeclarations onsys_sharing_rule(objectstack-ai/framework#2878, same branch) — generalizing the existingcapability-multiselectpattern. All degrade to the underlyingtyperenderer when unregistered, so this repo and the framework land independently.Widgets
object-ref— choose a registered object by name (searchableCombobox), backed by a newDataSource.getObjects()(theObjectStackAdapterlists code- and DB-defined objects via/api/v1/meta/object), falling back to asys_metadataquery. Stores the object'sname.filter-condition— a visualFilterBuilderscoped to the fields of the object chosen in a sibling field (viagetObjectSchema), round-tripping the stored MongoDB-style FilterCondition JSON (the exact shape the sharing engine spreads intoengine.find). Criteria the builder can't represent (or invalid JSON) fall back to a raw-JSON editor, with an always-available "Edit as JSON" toggle — nothing is hidden or lost.recipient-picker— a record picker whose target object follows a siblingrecipient_type(user→sys_user,team→sys_team,business_unit/unit_and_subordinates→sys_business_unit,position→sys_position), storing the value the evaluator matches on (a record id, or the position name). Resets the stored id when the type changes.Wiring
DATA_SOURCE_FIELD_TYPES(form.tsx) so the form threadsdataSource+dependentValuesto them, andINLINE_EXCLUDED_FIELD_TYPES(authored in the record form, not a grid cell).DataSource.getObjects()is optional on the interface; the ObjectStack adapter implements it.Verification
@object-ui/components,@object-ui/fieldstype-check ✅@object-ui/data-objectstacktype-check: only pre-existing errors inexportDownload.test.ts(untouched) — none in thegetObjectschange.registry-collision,field-type-coverage,FieldEditWidgetdrift-guard — 98/98 ✅🤖 Generated with Claude Code
Generated by Claude Code