Repository navigation
Commit 8ec00cf
fix(platform-objects): Setup's user screens show a user's real state, and the copy-password line only when one was generated (#28065)
<!-- claude-projects-attribution: {"github_login":"os-elon-musk"} -->
_Requested by **Elon** · [project
thread](https://claude.ai/code/project/chan_01WedDzV26nniwxv7jC88B9D?thread=cmsg_01WedDzV26nniwxv7jC88B9DB7otGmwMKQJqKhPxGv4D83)_
Fixes #27858
Fixes #27859
Fixes #27863
Part of #27869
Clause-②: no
Metadata-protocol: none
Skills-docs: none — `git grep` of `skills/**` and `content/docs/**` for
the four touched strings ("temporary password was generated", "copy it
now", "Preferred language for this user", `all_users`) has zero hits.
## 维护者速读
- 改了什么:设置 →
用户的四处界面文案与布局:创建用户/设置密码的结果框只在生成了临时密码时才提示「立即复制」;用户详情页显示已保存的语言和封禁状态与原因;用户列表加「已封禁」「平台角色」两列;「语言」字段的说明改为它决定界面语言(四种语言包同改)。
- 为什么改:HotCRM 18.2.0
设置走查发现管理员看到的是错的或缺的状态:手输密码后仍被要求复制不存在的密码、被封禁的用户看起来正常、列表上认不出封禁用户和管理员、语言说明只说通知。
- 风险与回滚:只改 `platform-objects` 的 sys_user
元数据、详情页定义和翻译包,无契约、无存储、无接口变化;回滚即还原本 PR。
-
先看:`packages/platform-objects/src/identity/sys-user.object.ts`(结果框与列表列)、`packages/platform-objects/src/pages/sys-user.page.ts`(Details
分区)、`packages/platform-objects/src/apps/translations/zh-CN.objects.generated.ts`。
- 两分钟验证:`pnpm --filter @objectstack/platform-objects exec vitest run
--maxWorkers=2 src/identity/create-user-result-dialog-copy.test.ts
src/pages/sys-user-details-tab.test.ts
src/identity/sys-user-list-status-role-columns.test.ts
src/identity/sys-user-locale-help.test.ts`,预期 4 个文件全绿。
- 需要你做的:无,席位落地。
## What changes
One commit per card, all on the platform's own `sys_user` metadata in
`@objectstack/platform-objects`:
1. **#27858 — Create User / Set Password result.** Both result dialogs
drop their dialog-level `description` ("If a temporary password was
generated, copy it now — it is shown only once and never stored.").
`ActionSchema.resultDialog` has no per-outcome copy, so that sentence
showed on both outcomes, including a typed password, where nothing was
generated. The instruction is now the label of the `temporaryPassword`
field ("Temporary password: copy it now, it is shown only once and never
stored"). The dialog skips a field whose path is absent from the
response, and the endpoint returns `temporaryPassword` only when it
minted one, so the line shows exactly when there is a password to copy.
The zh-CN, ja-JP and es-ES packs carry the same change (description
leaves dropped by `pnpm i18n:extract`, field labels translated by hand).
2. **#27859 — user record, Details tab.** The details renderer draws
only authored sections, and none named `locale`, while `banned`,
`ban_reason` and `ban_expires` were in `hideFields`. `locale` joins the
Identity section, and a new Account Status section (inline labels in all
four locales) carries `banned`, `ban_reason` and `ban_expires`.
3. **#27863 — Users list.** `all_users` gains `banned` and `role`
columns after `email_verified`.
4. **#27869 (part) — Locale help.** `sys_user.locale`'s help now says it
is the language the user sees the interface in as well as their
notifications (the console applies it to the whole UI through
`useUserLocale`). Source and all four shipped packs.
### What this PR does not carry, and who does
- **#27869 stays open (`Part of`).** Seat ruling in the seat-1 thread:
(a) the English "Invalid password" refusal is a `plugin-auth` refusal,
and it goes with #27857's PR; (b) French `sys_user` labels need French
as a fifth platform locale (platform-objects ships en / zh-CN / ja-JP /
es-ES only, and HotCRM declares the same four), and the silent fallback
is `service-i18n`'s. Both are reported as findings for the seat to file.
- **The role label (#27859 / #27863 "reads through its label").**
`sys_user.role` stays `Field.text`, so the highlight and the new Role
column show the stored value (`user`, `admin`). A label needs
`Field.select`, which changes the column the SQL driver emits (`text`
gives TEXT; `select` falls to the default `varchar(255)`), and
`schema-drift` would read existing deployments as a `narrow_varchar`.
Seat ruling A: this half is carried by its own card, which the seat
files at ACCEPT.
## Tests
- New pins: `sys-user-list-status-role-columns.test.ts` (#27863),
`sys-user-locale-help.test.ts` (#27869). Rewritten:
`create-user-result-dialog-copy.test.ts` (#27858, both actions, all four
packs). Extended: `sys-user-details-tab.test.ts` (#27859).
- `pnpm --filter @objectstack/platform-objects test`: Test Files 102
passed (102), Tests 1445 passed (1445). `typecheck`: exit 0.
- Ablations (one per row, each through `scripts/ablation-replace.mjs`,
restored to the HEAD blob, `git diff HEAD` empty afterwards):
- #27858: `set_user_password` regains a `description` →
`set_user_password: no dialog-level description` red (1 failed / 8
passed).
- #27859: `locale` dropped from the Identity section → 2 failed / 3
passed.
- #27863: `banned`, `role` dropped from `all_users` → `pins the default
list columns` red (1 failed / 1 passed).
- #27869: the old notifications-only source help restored → `the source
description names the interface` red (1 failed / 4 passed).
## Acceptance notes
- The role label half (above) and #27869's (a) and (b) halves are
reported in the card report for the seat to file or carry.
- `role` in the new list column reads the raw stored value until the
role-label card lands.
## Verification
All local readings are on head `24220933`.
<details><summary>Derived gate families: 58 of 59 exit 0, 1 NOT
MEASURED</summary>
- `node scripts/pm/dispatch-gates.mjs --commands` derived 59 families
from the 11 changed paths (merge base `bc496bf7d`). Each ran after the
build closure `turbo run build --filter=@objectstack/cli
--filter=@objectstack/platform-objects` plus the nine other i18n-bundle
packages `check:i18n` names (exit 0).
- 58 families exit 0, including `check:i18n`, `check:i18n-stale-fill`,
`check:page-declaration-shape`, `check:published-files`,
`check:closing-keyword-parity`, `check:nul-bytes` and
`check-plugin-teardown-shape --self-test` (pinned commit fetched).
- NOT MEASURED: `check:dual-build-cjs-loads` exit 3 (PREREQUISITE NOT
MET: it needs every package's dist; CI builds the whole tree).
- `check:dts-closure` and `check:sourcemap-no-sources-content` swept the
62 built packages only; CI sweeps the whole tree.
- `dispatch-gates --ran`: "59 derived famil(ies) accounted for — 58 run,
1 NOT-MEASURED", exit 0.
- `pnpm lint` (`eslint . --no-inline-config`): exit 0.
</details>
CI check-runs on this PR are the authority for every family CI runs.
## Human Minimum
- [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic.
(not touched)
- [x] 2. Every name I added uses the casing for its kind.
- [x] 3. No formatter ran; `pnpm lint` passes.
- [x] 4. One issue, one branch off an up-to-date `main`, one pull
request. (a seat fold: one card per commit)
- [x] 5. A change that publishes carries a changeset, and both
declaration lines are filled in here and in the changeset.
- [x] 6. `packages/spec` touched: its generated artifacts are
regenerated and committed. (not touched)
- [x] 7. No hand edits to `content/docs/references/`,
`packages/*/CHANGELOG.md` or `content/docs/releases/`.
- [x] 8. Title, body and comments are in English.
- [x] The *Before Submitting* list in CONTRIBUTING.md is done.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_016WV4cwXFwjU2YZW2dRuZZt
---
_Generated by [Claude
Code](https://claude.ai/code/session_016WV4cwXFwjU2YZW2dRuZZt)_
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 91a423e commit 8ec00cf
11 files changed
Lines changed: 194 additions & 66 deletions
File tree
- .changeset
- packages/platform-objects/src
- apps/translations
- identity
- pages
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
96 | | - | |
| 96 | + | |
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
| |||
195 | 195 | | |
196 | 196 | | |
197 | 197 | | |
198 | | - | |
199 | 198 | | |
200 | 199 | | |
201 | 200 | | |
202 | 201 | | |
203 | 202 | | |
204 | | - | |
| 203 | + | |
205 | 204 | | |
206 | 205 | | |
207 | 206 | | |
| |||
222 | 221 | | |
223 | 222 | | |
224 | 223 | | |
225 | | - | |
226 | 224 | | |
227 | 225 | | |
228 | | - | |
| 226 | + | |
229 | 227 | | |
230 | 228 | | |
231 | 229 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
96 | | - | |
| 96 | + | |
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
| |||
195 | 195 | | |
196 | 196 | | |
197 | 197 | | |
198 | | - | |
199 | 198 | | |
200 | 199 | | |
201 | 200 | | |
202 | 201 | | |
203 | 202 | | |
204 | | - | |
| 203 | + | |
205 | 204 | | |
206 | 205 | | |
207 | 206 | | |
| |||
222 | 221 | | |
223 | 222 | | |
224 | 223 | | |
225 | | - | |
226 | 224 | | |
227 | 225 | | |
228 | | - | |
| 226 | + | |
229 | 227 | | |
230 | 228 | | |
231 | 229 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
96 | | - | |
| 96 | + | |
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
| |||
195 | 195 | | |
196 | 196 | | |
197 | 197 | | |
198 | | - | |
199 | 198 | | |
200 | 199 | | |
201 | 200 | | |
202 | 201 | | |
203 | 202 | | |
204 | | - | |
| 203 | + | |
205 | 204 | | |
206 | 205 | | |
207 | 206 | | |
| |||
222 | 221 | | |
223 | 222 | | |
224 | 223 | | |
225 | | - | |
226 | 224 | | |
227 | 225 | | |
228 | | - | |
| 226 | + | |
229 | 227 | | |
230 | 228 | | |
231 | 229 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
96 | | - | |
| 96 | + | |
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
| |||
195 | 195 | | |
196 | 196 | | |
197 | 197 | | |
198 | | - | |
199 | 198 | | |
200 | 199 | | |
201 | 200 | | |
202 | 201 | | |
203 | 202 | | |
204 | | - | |
| 203 | + | |
205 | 204 | | |
206 | 205 | | |
207 | 206 | | |
| |||
222 | 221 | | |
223 | 222 | | |
224 | 223 | | |
225 | | - | |
226 | 224 | | |
227 | 225 | | |
228 | | - | |
| 226 | + | |
229 | 227 | | |
230 | 228 | | |
231 | 229 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | | - | |
| 4 | + | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
46 | 57 | | |
47 | 58 | | |
48 | 59 | | |
| |||
60 | 71 | | |
61 | 72 | | |
62 | 73 | | |
63 | | - | |
| 74 | + | |
| 75 | + | |
64 | 76 | | |
65 | 77 | | |
66 | 78 | | |
67 | | - | |
68 | | - | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
69 | 88 | | |
70 | 89 | | |
71 | 90 | | |
| |||
| 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 | + | |
| 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 | + | |
0 commit comments