Repository navigation
Commit b74793c
fix(setup): position holder picker shows email beside the name (#27427)
<!-- claude-projects-attribution: {"github_login":"os-warren"} -->
_Requested by **Warren** · [project
thread](https://claude.ai/code/project/chan_01U5RdnAAmkSQmZbqh6FtqZ8?thread=cmsg_01U5RdnAAmkSQmZbqh6FtqZ8MmawCuxSaq1JmBYvdfaADn)_
Fixes #27410
Clause-②: no
Metadata-protocol: none
## 维护者速读
- 改了什么:Setup › 岗位 › 添加持有人 的用户选择框,在姓名列旁边多画一列邮箱。
- 为什么改:原来只列姓名,两个同名的人分不清,授予岗位前也无法确认是哪个账号;同页的持有人列表本来就在姓名下显示邮箱。
- 风险与回滚:只给选择框传了列和对象 schema;看不到 `sys_user.email`
的人仍只看到姓名列(选择框自身的字段读权限规则);回滚即还原本 PR。
-
先看:`ui/packages/app-shell/src/views/metadata-admin/PositionHoldersSection.tsx`(`RecordPickerDialog`
的 `columns` 与 `objectSchema`)、同目录新测试
`PositionHoldersSection.pickerColumns-27410.test.tsx`。
- 两分钟验证:`pnpm --dir ui exec vitest run
packages/app-shell/src/views/metadata-admin/PositionHoldersSection`,预期 4
个文件 17 个用例全绿。
- 需要你做的:无,席位落地。
## What changes
`PositionHoldersSection` now opens its `RecordPickerDialog` on
`sys_user` with:
- `columns`: a Name column (`name`, the field `sys_user` declares as its
`nameField`) and an Email column (`email`, its login identity), with
headers from the section's own en/zh copy.
- `objectSchema`: `sys_user` as the registry serves it, read from the
`useMetadata()` objects the section already holds (no new fetch). The
name column resolves each person's title through it, as a lookup's
dropdown does.
Nothing else moves. Per the card's ruling, the picker's own read rule
(`readableColumns`) decides what it draws: the section adds no
permission check of its own and reads the email no other way.
## Why
The picker drew only its default display column, so two people of one
name could not be told apart, while the holder rows on the same section
already show each holder's email under the name. Row 2 of #27356.
## Tests
New file `PositionHoldersSection.pickerColumns-27410.test.tsx`, against
the real `RecordPickerDialog` (the existing suites stub it):
- the picker draws a name column and an email column (cells read by
`data-lookup-cell`);
- CONTROL: choosing a person still creates the `sys_user_position` row
by name;
- CONTROL: under a real `PermissionProvider` policy that denies
`sys_user.email` to the viewer, the picker draws the name column only
and no email text.
Ablation (one-shot, `node scripts/ablation-replace.mjs --delete` on the
`columns` prop, under the lock): the email-column test goes red (1
failed, 2 passed), and the restore leg reports blob `7283c48e2e90` equal
to HEAD with `git diff HEAD` empty.
## Acceptance notes
- `AssignedUsersSection` (a permission set's holders) opens the same
`RecordPickerDialog` on `sys_user` with no `columns`, so its picker
lists names only too. Read from the source, not filed here; reported to
the seat.
## Verification
All readings on head `d2e47a1a` (origin/main merged).
<details><summary>Local runs</summary>
- `pnpm --dir ui exec vitest run --maxWorkers=2
packages/app-shell/src/views/metadata-admin/PositionHoldersSection`
(lock): Test Files 4 passed (4), Tests 17 passed (17).
- `pnpm --filter @object-ui/app-shell type-check` (lock): VERDICT
command-exit 0.
- `pnpm --dir ui run type-check:scripts`: exit 0.
- `pnpm --dir ui run check:new-line-citations`: 0 new citations, exit 0.
- `node scripts/check-sdui-manifest.mjs`: exit 0.
- `node scripts/pm/dispatch-gates.mjs --commands`: 34 derived families,
each run, all exit 0; `--ran` reconciliation: 34 derived, 34 run, 0
NOT-MEASURED, 0 UNRUN.
</details>
Changeset: `.changeset/27410-position-holder-picker-email.md`,
`@object-ui/app-shell` and `@object-ui/console` patch (app-shell is
private and versioned; console ships it).
## 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. (CI runs it)
- [x] 4. One issue, one branch off an up-to-date `main`, one pull
request.
- [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 by [Claude
Code](https://claude.ai/code/session_01JQwxbZN5JqZpSuejtNPz6p)_
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent bbb49c9 commit b74793c
3 files changed
Lines changed: 151 additions & 0 deletions
File tree
- .changeset
- ui/packages/app-shell/src/views/metadata-admin
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 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 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
89 | 100 | | |
90 | 101 | | |
91 | 102 | | |
| |||
107 | 118 | | |
108 | 119 | | |
109 | 120 | | |
| 121 | + | |
| 122 | + | |
110 | 123 | | |
111 | 124 | | |
112 | 125 | | |
| |||
124 | 137 | | |
125 | 138 | | |
126 | 139 | | |
| 140 | + | |
| 141 | + | |
127 | 142 | | |
128 | 143 | | |
129 | 144 | | |
| |||
197 | 212 | | |
198 | 213 | | |
199 | 214 | | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
200 | 221 | | |
201 | 222 | | |
202 | 223 | | |
| |||
392 | 413 | | |
393 | 414 | | |
394 | 415 | | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
395 | 421 | | |
396 | 422 | | |
397 | 423 | | |
| |||
0 commit comments