Repository navigation
Commit bdf762c
fix(platform-objects, plugin-sharing, spec): Setup forms show option labels instead of machine values (#25370)
<!-- claude-projects-attribution: {"github_login":"os-tesla"} -->
_Requested by **Tesla** · [project
thread](https://claude.ai/code/project/chan_01AXsQkLFKRdQCqQ3RTr6Jao?thread=cmsg_01AXsQkLFKRdQCqQ3RTr6Jao9syRPnMJSuZZ5jYxme4Xun)_
Fixes #25332
Clause-②: no
Metadata-protocol: none
## What changed
Setup forms showed machine values where an administrator expects labels.
This PR fixes the declarations that produce them. The stored values do
not change.
| Form | Field | Producer | Fix |
|---|---|---|---|
| Business Units | Kind (`cost_center` …) |
`packages/platform-objects/src/identity/sys-business-unit.object.ts` |
bare-string options become `{ value, label }` |
| Sharing Rules | Recipient Type (`business_unit`,
`unit_and_subordinates` …), Access Level (`read`, `edit`) |
`packages/plugins/plugin-sharing/src/objects/sys-sharing-rule.object.ts`
| same |
| (same vocabulary) | Recipient Type, Access Level on `sys_record_share`
|
`packages/plugins/plugin-sharing/src/objects/sys-record-share.object.ts`
| same, see below |
| Datasources | field label `autoMigrate` |
`packages/spec/src/data/driver/{sqlite,postgres,mysql}.zod.ts` | the key
gains `.meta({ title: 'Auto-migrate schema' })` |
- `Field.select([...strings])` makes each label equal to its string, so
a snake_case value is shown as-is. The options now carry English labels.
The Recipient Type labels are the ones its help text already used
("Business unit and subordinates", "Field").
- The en translation bundles are regenerated (`node
scripts/check-i18n-bundles.mjs --write`). The existing zh-CN, ja-JP and
es-ES option translations were already present and are kept unchanged.
- **Where the producer sits, and why:** the dispatch expected the
`autoMigrate` label on a datasource object. Measured, it is the
driver-config JSON Schema in `packages/spec`: the console's datasource
form labels each config row with the property's `title` and falls back
to the raw key, and `autoMigrate` was the one SQL-driver key without a
title. So the fix is at the spec producer, never a renderer fallback.
- **In-place fix of `sys_record_share`:**
`recipient-vocabulary-consistency.test.ts` holds one rendering per
option key across both sharing objects, so labelling the rule's options
alone turns it red. The record share gets the same labels. This is the
same defect class with a mechanical fix and the same gate family; the
claim's file surface did not name this file, and the seat is told.
## Pins (one per declaration)
-
`packages/platform-objects/src/identity/business-unit-kind-option-labels.test.ts`:
values unchanged, no label equals its value.
-
`packages/plugins/plugin-sharing/src/sharing-rule-option-labels.test.ts`:
the same for both fields on both sharing objects, plus the help text
naming labels the select shows.
- `packages/spec/src/data/driver/config-registry.test.ts`: the
`autoMigrate` JSON-Schema title on sqlite, postgres and mysql.
## Verification (head `ce8bac22`)
- `pnpm --filter @objectstack/spec exec vitest run
src/data/driver/config-registry.test.ts`: 39/39.
- `pnpm --filter @objectstack/platform-objects test`: 89 files, 1320
tests passed.
- `pnpm --filter @objectstack/plugin-sharing test`: 54 files, 1209 tests
passed. The first run, before `sys_record_share` was labelled, failed
`recipient-vocabulary-consistency.test.ts` as described above.
- `typecheck` for spec, platform-objects, plugin-sharing: exit 0.
- `pnpm --filter @objectstack/spec check:generated`: all 14 artifacts up
to date.
- `dispatch-gates --commands`: 91 derived, 89 exit 0, 2 NOT MEASURED
(exit 3, prerequisites): `check-plugin-teardown-shape.mjs --self-test`
needs an unshallowed clone; `check:dual-build-cjs-loads` needs every
package's `dist/`. CI runs both.
## Acceptance notes
- **Not in this PR, objectui:** "Display name\* `name`" is objectui's
`packages/app-shell/src/views/metadata-admin/SchemaForm.tsx`. It renders
the field key in a `code` chip beside the label whenever the label is
not the prettified key. The Packages form takes its labels from
objectui's `package-schema.ts`, so no declaration here produces it. The
seat files the objectui card.
- **Not in this PR, objectui:** the datasource form (objectui
`datasource/DatasourceResourcePage.tsx`) renders enum options by raw
value, so `autoMigrate`'s options still read `off` / `safe`. JSON Schema
has no option-label channel for it to read.
- The datasource config titles are English only: the form reads them
straight from the JSON Schema, and no translation path covers
driver-config titles.
- Other driver-config keys with no title, which render their raw key
wherever the form shows them: memory `initialData` / `strictMode` /
`persistence`, mongodb `options`, turso `encryptionKey` / `sync` /
`timeout`. They are not on the four forms the card names.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01QUKVainSF9Fx4YDaSPyE64)_
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01QUKVainSF9Fx4YDaSPyE64
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent be318db commit bdf762c
12 files changed
Lines changed: 182 additions & 36 deletions
File tree
- .changeset
- packages
- platform-objects/src
- apps/translations
- identity
- plugins/plugin-sharing/src
- objects
- translations
- spec/src/data/driver
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
921 | 921 | | |
922 | 922 | | |
923 | 923 | | |
924 | | - | |
925 | | - | |
926 | | - | |
927 | | - | |
928 | | - | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
929 | 929 | | |
930 | 930 | | |
931 | 931 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
129 | 135 | | |
130 | 136 | | |
131 | 137 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
199 | 199 | | |
200 | 200 | | |
201 | 201 | | |
202 | | - | |
| 202 | + | |
203 | 203 | | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
204 | 210 | | |
205 | 211 | | |
206 | 212 | | |
| |||
241 | 247 | | |
242 | 248 | | |
243 | 249 | | |
244 | | - | |
245 | 250 | | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
246 | 255 | | |
247 | 256 | | |
248 | 257 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
176 | 176 | | |
177 | 177 | | |
178 | 178 | | |
179 | | - | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
180 | 182 | | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
181 | 191 | | |
182 | 192 | | |
183 | 193 | | |
| |||
226 | 236 | | |
227 | 237 | | |
228 | 238 | | |
229 | | - | |
230 | 239 | | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
231 | 244 | | |
232 | 245 | | |
233 | 246 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
53 | | - | |
| 52 | + | |
| 53 | + | |
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| |||
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
| |||
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
156 | | - | |
157 | | - | |
| 156 | + | |
| 157 | + | |
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
508 | 508 | | |
509 | 509 | | |
510 | 510 | | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
124 | | - | |
| 124 | + | |
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
| |||
0 commit comments