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
{{ message }}
Repository navigation
Commit 3c18a37
Browse filesBrowse the repository at this point in the historyBrowse files
fix(studio): show, keep and author the optional controlled-by-parent master
ADR-0055 §1 as amended lets a controlled_by_parent object's only
master_detail be declared required: false. Studio now names that master
in the OWD overview (via the spec's controlledByParentMasterOf), keeps an
explicit required: false on save, and lets the field inspector clear
Required on the only master_detail, with help text on the null-master
owner rule.
Claude-Session: https://claude.ai/code/session_01FEkQ5mJLhZasj7G83LSvsv
Co-Authored-By: Claude <noreply@anthropic.com>
fix(studio): Studio shows, keeps and authors the optional master of a controlled-by-parent object (#30974)
7
+
8
+
Clause-②: no
9
+
Metadata-protocol: none
10
+
11
+
Since ADR-0055 §1 as amended (#30905, ruling A), a `controlled_by_parent` object's ONLY `master_detail` may be declared `required: false`: an optional master, whose records may name no master and are then visible only to their owner and to View All Records on the object. Studio still treated every master as required. It now follows the spec:
12
+
13
+
-**Display.** The package OWD overview names the master the spec's `controlledByParentMasterOf` names, so an optional master is shown as the master instead of "no master". An omitted `required` on the object's only `master_detail` is shown as the master too, the way the builder and stored data read it.
14
+
-**Save.** Switching an object to Controlled by parent (in the OWD overview or the object's Settings tab) still sets `required: true` on each `master_detail` that writes no `required`, and now keeps an explicit `required: false`. A Studio save no longer turns an optional master required.
15
+
-**Authoring.** On the object's only `master_detail`, the field inspector's Required box is no longer locked on: clearing it writes `required: false`, and the help text under it explains the optional master and who can see a record that names none. Beside another `master_detail` the lock stands, since the spec admits no optional master there.
16
+
-**New string.**`@object-ui/i18n`'s studio namespace gains `designer.field.requiredCbpOptionalMaster` (en, zh).
Copy file name to clipboardExpand all lines: ui/packages/app-shell/src/views/metadata-admin/inspectors/ObjectFieldInspector.cbpRequiredMaster-12326.test.tsx
+42-11Lines changed: 42 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -8,11 +8,12 @@
8
8
* Since `@objectstack/spec` 18 (objectstack#23100, ADR-0055 §1) such an object
9
9
* derives its master from exactly one `master_detail` declared
10
10
* `required: true`. Since ADR-0055 §1 as amended (objectstack#30905 ruling A)
11
-
* the spec also reads an object's only `master_detail` that is not required as
12
-
* an OPTIONAL master, whose rows may name none; the designer keeps writing
13
-
* `required: true`, so the master it shows is one every row names. The
14
-
* installed spec's `ObjectSchema` is the oracle for the object each edit
15
-
* leaves behind.
11
+
* an object's ONLY `master_detail` may be declared `required: false`, an
12
+
* OPTIONAL master whose rows may name none. On that field the box stays free,
13
+
* clearing it writes `required: false`, and the help text explains the
14
+
* null-master owner rule (objectstack#30974). Beside another `master_detail`
15
+
* the lock stands. The installed spec's `ObjectSchema` is the oracle for the
16
+
* object each edit leaves behind.
16
17
*/
17
18
18
19
import'@testing-library/jest-dom/vitest';
@@ -89,23 +90,51 @@ function mount(object: Row, selected: string) {
0 commit comments