diff --git a/examples/schema-catalog/src/schemas/plugin-form/object-form-record.json b/examples/schema-catalog/src/schemas/plugin-form/object-form-record.json index 7f0233776..a8c038958 100644 --- a/examples/schema-catalog/src/schemas/plugin-form/object-form-record.json +++ b/examples/schema-catalog/src/schemas/plugin-form/object-form-record.json @@ -4,6 +4,6 @@ "mode": "edit", "recordId": "1", "columns": 2, - "fields": ["name", "email", "department"], + "fields": ["name", "email", "role", "department", "status"], "submitText": "Save changes" } diff --git a/examples/schema-catalog/src/schemas/plugin-form/object-form-tabbed-sections.json b/examples/schema-catalog/src/schemas/plugin-form/object-form-tabbed-sections.json index cb6d7ba75..dfa2ef290 100644 --- a/examples/schema-catalog/src/schemas/plugin-form/object-form-tabbed-sections.json +++ b/examples/schema-catalog/src/schemas/plugin-form/object-form-tabbed-sections.json @@ -7,7 +7,8 @@ "defaultTab": "identity", "sections": [ { "name": "identity", "label": "Identity", "columns": 2, "fields": ["name", "email"] }, - { "name": "organisation", "label": "Organisation", "fields": ["department", "created_at"] } + { "name": "organisation", "label": "Organisation", "fields": ["department", "created_at"] }, + { "name": "access", "label": "Access", "fields": ["role", "status"] } ], "submitText": "Save changes" } diff --git a/examples/schema-catalog/test/catalog-gallery-render.test.tsx b/examples/schema-catalog/test/catalog-gallery-render.test.tsx index cad7f9d76..c069defa0 100644 --- a/examples/schema-catalog/test/catalog-gallery-render.test.tsx +++ b/examples/schema-catalog/test/catalog-gallery-render.test.tsx @@ -1402,3 +1402,165 @@ describe('objectui#6317 — a `select` field declares the options its rows use', ).toEqual(mirrorFields); }); }); + +/** + * objectui#6537 — the two `plugin-form` entries stop steering around the + * fixture's `select` fields. + * + * ## What the entries were working around + * + * Both `plugin-form` entries authored a field list that omitted `role` and + * `status` — the only two `select` fields the `users` fixture declares: + * `object-form-record` listed `["name","email","department"]` and + * `object-form-tabbed-sections` sectioned over `[name,email]` / + * `[department,created_at]`. That was never an authoring choice. Until + * objectui#6317 this mirror declared both fields with NO `options`, and + * `ObjectForm` copies a field's options through verbatim (`formField.options = + * field.options || []`), so a form over either one painted the "No options + * available" empty state — on a docs page whose whole purpose is to show the + * component working. The five `plugin-grid` / `plugin-view` entries over the + * same object never steered around them, because `ObjectGrid` SYNTHESISES + * options for an option-less select from the loaded rows. That asymmetry is + * what #6317 measured, and it is why only the FORM entries carried a + * workaround. + * + * #6317 declared the options in the host fixture's `users` schema and in this + * mirror, so the constraint is gone and both entries carry the full field + * surface again. + * + * Measured through this file's own render path, before and after this card: + * + * object-form-record + * before "NameEmailDepartmentCancelSave changes" + * after "NameEmailRoleAdminAdminMemberViewerDepartmentStatusActiveActive + * InvitedSuspendedCancelSave changes" + * object-form-tabbed-sections + * before "IdentityOrganisationNameEmailDepartmentCreatedCancelSave changes" + * after "IdentityOrganisationAccessNameEmailDepartmentCreatedRoleAdmin + * AdminMemberViewerStatusActiveActiveInvitedSuspendedCancelSave + * changes" + * + * ("Admin" twice: the closed trigger shows the selected option's label, and + * the option list carries it again.) The record's own values join the form's + * controls with them — `["Alice Johnson","alice@example.com","Engineering"]` + * becomes `["Alice Johnson","alice@example.com","admin","Engineering", + * "active"]` — so the two fields stop being dropped on the way in. + * + * That the text MOVES is the point, and it is the half #6317 could not show: + * the seven `users`-bound tiles were byte-identical across that card because + * the grid synthesises what the declaration was missing. The form path has no + * such fallback, so here the declaration is visible. + * + * The tabbed entry is measurable from its `identity` default tab because + * `TabbedForm` keeps EVERY panel mounted inside one `