Skip to content

Commit 4be9dbe

Browse files
committed
test(platform-objects): the six form help leaves carry no design-record vocabulary in any locale; changeset
1 parent ab4f56d commit 4be9dbe

3 files changed

Lines changed: 74 additions & 9 deletions

File tree

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
'@objectstack/spec': patch
3+
'@objectstack/platform-objects': patch
4+
---
5+
6+
Clause-②: no
7+
8+
Six help texts an administrator reads in Setup no longer carry ADR numbers. On the Permission Sets edit form,
9+
`isDefault`, `managedBy` and `packageId` are rewritten as plain sentences that say what the field does, and
10+
`adminScope` drops its "(ADR-0090 D12)" prefix. On the Positions edit form, `delegatable` drops "(ADR-0091 D3)".
11+
The view form's End-user controls description drops "(ADR-0047, Airtable Interface parity)".
12+
13+
The ADR references moved to the comments beside the form rows. The generated metadata-forms translations carry
14+
the new wording in en, zh-CN, ja-JP and es-ES. No key, type or accept/refuse result changes.

‎packages/platform-objects/src/apps/setup-copy-vocabulary.test.ts‎

Lines changed: 54 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,11 @@
2323
* 2. every leaf of the four committed `objects` bundles;
2424
* 3. the type-level `label` / `description` of the four `metadataForms`
2525
* bundles — the sentence a Setup metadata page (Positions, Capabilities,
26-
* Permission Sets) shows under its title. Section descriptions and field
27-
* `helpText` of those forms are the spec's form copy and are not judged
28-
* here;
26+
* Permission Sets) shows under its title, plus the six form leaves named
27+
* in `FORM_HELP_LEAVES` (the Permission Sets and Positions help texts and
28+
* the view form's End-user controls description). The other section
29+
* descriptions and field `helpText` of those forms are the spec's form
30+
* copy and are not judged here;
2931
* 4. `SETUP_APP` and this package's `SETUP_NAV_CONTRIBUTIONS`, and the
3032
* hand-authored `apps.setup` subtree of each locale.
3133
*
@@ -172,6 +174,55 @@ describe('Setup copy carries no design-record vocabulary', () => {
172174
expect(offenders(strings)).toEqual([]);
173175
});
174176

177+
// The help texts an admin reads on Setup's Permission Sets and Positions edit
178+
// forms, and the view form's End-user controls section. Each one carried a
179+
// decision-record reference until the spec form source moved it into the
180+
// comment beside the row; `en` is regenerated from that source, so judging
181+
// the four bundles judges the source too.
182+
const FORM_HELP_LEAVES = [
183+
['permission', 'fields', 'isDefault', 'helpText'],
184+
['permission', 'fields', 'managedBy', 'helpText'],
185+
['permission', 'fields', 'packageId', 'helpText'],
186+
['permission', 'fields', 'adminScope', 'helpText'],
187+
['position', 'fields', 'delegatable', 'helpText'],
188+
['view', 'sections', 'end_user_controls', 'description'],
189+
] as const;
190+
191+
function formHelpLeaves(bundle: unknown, locale: string): Array<[string, string]> {
192+
return FORM_HELP_LEAVES.map((path) => {
193+
const value = path.reduce<unknown>((node, key) => (node as Record<string, unknown> | undefined)?.[key], bundle);
194+
const at = `${locale}.metadataForms.${path.join('.')}`;
195+
expect(value, `${at} is in the population`).toBeTypeOf('string');
196+
return [at, value as string];
197+
});
198+
}
199+
200+
it.each(Object.keys(FORM_BUNDLES))('the Permission Set, Position and view form help texts of the %s metadataForms bundle', (locale) => {
201+
const strings = formHelpLeaves(FORM_BUNDLES[locale as keyof typeof FORM_BUNDLES], locale);
202+
expect(strings).toHaveLength(FORM_HELP_LEAVES.length);
203+
expect(offenders(strings)).toEqual([]);
204+
});
205+
206+
it('the form help-text assertion fires on the prose it replaced', () => {
207+
// Dark leg: the same walk over a bundle carrying the replaced wording must
208+
// name every leaf, so a walk that reaches nothing cannot pass above.
209+
const replaced = {
210+
permission: { fields: {
211+
isDefault: { helpText: 'App baseline for the everyone position (ADR-0090 D5): an app-level set is auto-bound at boot.' },
212+
managedBy: { helpText: 'Record provenance (ADR-0086 D3): who owns this set across upgrades.' },
213+
packageId: { helpText: 'Owning package id for a package-shipped set (ADR-0086 D3).' },
214+
adminScope: { helpText: 'Delegated administration (ADR-0090 D12): lets holders of this set administer one business-unit subtree.' },
215+
} },
216+
position: { fields: {
217+
delegatable: { helpText: 'Holders may delegate this position themselves, time-boxed and with a reason (ADR-0091 D3).' },
218+
} },
219+
view: { sections: {
220+
end_user_controls: { description: 'What end users can do on this view (ADR-0047, Airtable Interface parity).' },
221+
} },
222+
};
223+
expect(offenders(formHelpLeaves(replaced, 'replaced'))).toHaveLength(FORM_HELP_LEAVES.length);
224+
});
225+
175226
it('the Setup app, its nav contributions, and every locale\'s apps.setup translations', () => {
176227
const strings: Array<[string, string]> = [];
177228
copyStrings(SETUP_APP, 'SETUP_APP', strings);

‎packages/platform-objects/src/apps/translations/en.metadata-forms.generated.ts‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,7 +1012,7 @@ export const enMetadataForms: NonNullable<TranslationData['metadataForms']> = {
10121012
},
10131013
end_user_controls: {
10141014
label: "End-user controls",
1015-
description: "What end users can do on this view — quick filters, filter tabs, visualization switching (ADR-0047, Airtable Interface parity)."
1015+
description: "What end users can do on this view — quick filters, filter tabs, visualization switching."
10161016
},
10171017
navigation_sharing: {
10181018
label: "Navigation & sharing",
@@ -2323,23 +2323,23 @@ export const enMetadataForms: NonNullable<TranslationData['metadataForms']> = {
23232323
},
23242324
isDefault: {
23252325
label: "Is Default",
2326-
helpText: "App baseline for the everyone position (ADR-0090 D5): an app-level set is auto-bound at boot; a package-level set becomes an install-time suggestion an admin confirms. Default false."
2326+
helpText: "Gives this set to everyone who signs in, through the built-in everyone position. A set the app itself declares is granted at startup; a set from an installed package becomes a suggestion an admin confirms in Setup. A set with high-privilege permissions is never granted this way. Default false."
23272327
},
23282328
managedBy: {
23292329
label: "Managed By",
2330-
helpText: "Record provenance (ADR-0086 D3): who owns this set across upgrades."
2330+
helpText: "Who owns this set: Package means it ships with a package and package upgrades update it; Platform and User mean it was created in this environment and upgrades leave it alone."
23312331
},
23322332
packageId: {
23332333
label: "Package Id",
2334-
helpText: "Owning package id for a package-shipped set (ADR-0086 D3). Leave empty for an environment-authored set."
2334+
helpText: "The package that ships this set; a value naming any other package is refused. Leave empty for a set created in this environment."
23352335
},
23362336
systemPermissions: {
23372337
label: "System Permissions",
23382338
helpText: "List of system capability keys"
23392339
},
23402340
adminScope: {
23412341
label: "Admin Scope",
2342-
helpText: "Delegated administration (ADR-0090 D12): lets holders of this set administer one business-unit subtree. businessUnit is the subtree root (sys_business_unit.name) and is required, non-blank; includeSubtree defaults to true; manageAssignments defaults to false and lets the holder assign people to positions, and grant sets directly, inside that subtree; a delegate may hand out only the sets named in assignablePermissionSets. Leave empty for a set that delegates nothing."
2342+
helpText: "Delegated administration: lets holders of this set administer one business-unit subtree. businessUnit is the subtree root (sys_business_unit.name) and is required, non-blank; includeSubtree defaults to true; manageAssignments defaults to false and lets the holder assign people to positions, and grant sets directly, inside that subtree; a delegate may hand out only the sets named in assignablePermissionSets. Leave empty for a set that delegates nothing."
23432343
},
23442344
objects: {
23452345
label: "Objects",
@@ -2384,7 +2384,7 @@ export const enMetadataForms: NonNullable<TranslationData['metadataForms']> = {
23842384
},
23852385
delegatable: {
23862386
label: "Delegatable",
2387-
helpText: "Holders may delegate this position themselves, time-boxed and with a reason (ADR-0091 D3). Default false — delegation is admin-only."
2387+
helpText: "Holders may delegate this position themselves, time-boxed and with a reason. Default false — delegation is admin-only."
23882388
}
23892389
}
23902390
},

0 commit comments

Comments
 (0)