Repository navigation
fix(platform-objects, plugin-sharing, spec): Setup forms show option labels instead of machine values - #25370
Conversation
…ptions and the autoMigrate field instead of showing machine values
Business unit kind, sharing rule recipient type and access level declared
bare-string options, so each label equalled its stored value. They now
declare { value, label } with the same values. The SQL drivers' autoMigrate
config key gains a JSON-Schema title, which the datasource form uses as
its field label.
Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QUKVainSF9Fx4YDaSPyE64
Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QUKVainSF9Fx4YDaSPyE64
…ons alike The recipient vocabulary guard holds one rendering per option key across both sharing objects, so the record share labels its options the same way. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QUKVainSF9Fx4YDaSPyE64
… record share options Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QUKVainSF9Fx4YDaSPyE64
📓 Docs Drift CheckThis PR changes 3 package(s): 14 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 10 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 144 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin f10aacb63ce880f89ff694d3edc2b2578b0bbb23 && git checkout f10aacb63ce880f89ff694d3edc2b2578b0bbb23
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin fb63d396b15c91f3f16041817e9934e2dea93759 ce8bac225cbd15a8bc54bf827f9ded34e8a7ed12 && git checkout -B drift-repro fb63d396b15c91f3f16041817e9934e2dea93759 && git merge --no-ff ce8bac225cbd15a8bc54bf827f9ded34e8a7ed12
node scripts/docs-audit/affected-docs.mjs --json fb63d396b15c91f3f16041817e9934e2dea93759
|
|
Seat note · The failing check is Test Core (6/6), run 39900440393, job 120240673884, and the only failed task is
The seat re-runs the failed jobs once through the relay. A second failure is real and goes back to the dev with the FAIL lines. Generated by Claude Code |
席位核对ACCEPT ·
Generated by Claude Code |
Requested by Tesla · project thread
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.
cost_center…)packages/platform-objects/src/identity/sys-business-unit.object.ts{ value, label }business_unit,unit_and_subordinates…), Access Level (read,edit)packages/plugins/plugin-sharing/src/objects/sys-sharing-rule.object.tssys_record_sharepackages/plugins/plugin-sharing/src/objects/sys-record-share.object.tsautoMigratepackages/spec/src/data/driver/{sqlite,postgres,mysql}.zod.ts.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").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.autoMigratelabel on a datasource object. Measured, it is the driver-config JSON Schema inpackages/spec: the console's datasource form labels each config row with the property'stitleand falls back to the raw key, andautoMigratewas the one SQL-driver key without a title. So the fix is at the spec producer, never a renderer fallback.sys_record_share:recipient-vocabulary-consistency.test.tsholds 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: theautoMigrateJSON-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, beforesys_record_sharewas labelled, failedrecipient-vocabulary-consistency.test.tsas described above.typecheckfor 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-testneeds an unshallowed clone;check:dual-build-cjs-loadsneeds every package'sdist/. CI runs both.Acceptance notes
name" is objectui'spackages/app-shell/src/views/metadata-admin/SchemaForm.tsx. It renders the field key in acodechip beside the label whenever the label is not the prettified key. The Packages form takes its labels from objectui'spackage-schema.ts, so no declaration here produces it. The seat files the objectui card.datasource/DatasourceResourcePage.tsx) renders enum options by raw value, soautoMigrate's options still readoff/safe. JSON Schema has no option-label channel for it to read.initialData/strictMode/persistence, mongodboptions, tursoencryptionKey/sync/timeout. They are not on the four forms the card names.Generated by Claude Code
🤖 Generated with Claude Code
https://claude.ai/code/session_01QUKVainSF9Fx4YDaSPyE64