Repository navigation
Commit 8cb8c7f
fix(platform-objects): name each Setup settings entry as the hub does; label notification and audit options (#28062)
<!-- claude-projects-attribution: {"github_login":"os-elon-musk"} -->
_Requested by **Elon** · [project
thread](https://claude.ai/code/project/chan_01WedDzV26nniwxv7jC88B9D?thread=cmsg_01WedDzV26nniwxv7jC88B9DFGYFLQXxGe8p4z4ZkYBq7Y)_
domain:server#4 · os-elon-musk · session_016WV4cxh364AJYtdpWoPiHV
Fixes #27854
Refs #27855
Clause-②: no
Metadata-protocol: none
## 维护者速读
- 改了什么:Setup 侧栏的设置入口改用设置总览页(All Settings)的卡片标题,四种语言一致(英文 "Email" 改为
"Mail Delivery",中文「邮件」改为「邮件投递」「公司信息」改为「公司」等),并补上 SMS Delivery 和 Data
Lifecycle 两个入口;通知事件的严重程度显示 Info / Warning / Critical,来源对象显示对象名称而非
`sys_approval_request`;审计日志的动作(含 System Overview 的 "Audit Events by
Action")在英文下显示 "Config Change" 而非 `config_change`。
- 为什么改:管理员在侧栏和总览页看到同一页面两个名字,两个设置页从侧栏到不了,几个页面直接显示内部代码(#27521 第 3、4 行)。
- 风险与回滚:只改显示文字、选项标签和导航入口,存储值与可接受的输入都不变;新增的两个入口要求
`manage_platform_settings`,与对应设置页的读权限一致。回滚即 revert 本 PR。
-
先看:`packages/platform-objects/src/apps/setup-nav.contributions.ts`、`packages/services/service-settings/src/setup-nav-hub-parity.test.ts`(侧栏对总览页的防漂移测试)、`packages/plugins/plugin-audit/src/objects/sys-audit-log.object.ts`。
- 两分钟验证:`pnpm --filter @objectstack/service-settings exec vitest run
src/setup-nav-hub-parity.test.ts`,预期 9 passed(在 main 上 6 个红)。
- 需要你做的:无,席位落地。通知主题(topic)可读化未做:主题是开放词表,平台没有主题名称来源,#27855 保持打开。
## What changes
**Setup sidebar ↔ settings hub (#27854).** One name per settings page,
one set of pages.
- `setup-nav.contributions.ts`: `nav_settings_mail` is labelled "Mail
Delivery" (was "Email"). New entries `nav_settings_sms` ("SMS Delivery",
after mail) and `nav_settings_lifecycle` ("Data Lifecycle", after
Knowledge), both `requiredPermissions: ['manage_platform_settings']`,
the read permission of their namespaces.
- Translations (`apps/translations/{en,zh-CN,ja-JP,es-ES}.ts`): each
settings entry takes the hub card's title in that locale. zh-CN / ja-JP:
company 公司信息 / 会社情報 → 公司 / 会社, mail 邮件 / メール → 邮件投递 / メール配信. es-ES: mail
Correo → Envío de correo, storage and feature flags take the hub's
wording. The two new entries are translated; the lifecycle wording
reuses the object form's existing "Data Lifecycle" term in each locale.
The mail entry's recorded source hashes are refreshed with its
re-translation (the en source changed), and the two new entries record
theirs.
- Drift pin,
`packages/services/service-settings/src/setup-nav-hub-parity.test.ts`
(it lives there because service-settings depends on platform-objects, so
the reverse import would be a cycle). It boots `SettingsServicePlugin`
with the bundled manifests, registers `lifecycleSettingsManifest` the
way `ObjectQLPlugin` does, folds the Setup tree through the real
registry (so the Branding entry this package contributes counts), and
asserts: every hub namespace has exactly one sidebar entry and no entry
opens an unlisted page; the en label equals the hub title; each
translated locale's label equals the hub's translated title wherever the
hub has one; and the namespaces with no translated hub title are exactly
`['lifecycle']`.
**Notification Events and the audit action (#27855, partly).**
- `audit/sys-notification.object.ts`: `severity` options are labelled
Info / Warning / Critical over the same `info` / `warning` / `critical`
values. `source_object` declares `widget: 'object-ref'` (the
sharing-rule pattern), so the console draws the object's label; the
field stays text and nothing but `NotificationService` writes it
(`apiMethods: ['get', 'list']`).
- `plugin-audit/src/objects/sys-audit-log.object.ts`: every `action`
option carries a label ("Config Change", "Login Failed", …), stored
values unchanged. The "Audit Events by Action" chart reads these:
`resolveDimensionLabels` (`@objectstack/service-analytics`) resolves a
dimension through the field's options whatever the dimension's `type`,
so `system.datasets.ts` needs no change. The bare-array `Field.select`
shorthand had made each label the code; zh-CN / ja-JP / es-ES already
carried words, only en showed codes.
- Regenerated:
`platform-objects/src/apps/translations/en.objects.generated.ts`
(severity), `plugin-audit/src/translations/en.objects.generated.ts`
(action), by `node scripts/check-i18n-bundles.mjs --write`; no
translated-locale value moved.
**Not in this PR.**
- Readable notification topic: `topic` is an open vocabulary (a flow's
notify step names any topic; about 30 distinct topics are emitted) and
no topic catalog with labels exists. A `select` would refuse unknown
topics, a narrowing. Left out by the seat's ruling; #27855 stays open
for it.
- `identity/sys-user.object.ts` (`env_native` identity-source label, the
third bullet of #27855): belongs with the `sys_user` rows (#27858) and
is not touched.
## Why
Every administrator in Setup saw one page under two names, could not
reach SMS Delivery or Data Lifecycle from the sidebar, and read raw
codes on System Overview and Notification Events.
## Verification
Measured on `main` `5aee2065` (sidebar vs hub, all four locales): en
mail "Email" vs "Mail Delivery"; `sms` and `lifecycle` had no sidebar
entry; zh-CN and ja-JP company and mail, and es-ES mail, storage and
feature flags, differed from the hub. `severity` options were `{ label:
'info', value: 'info' }`…; `sys_audit_log.action` labels equalled their
values.
Pins, red first on `main` and green on this head:
- `service-settings/src/setup-nav-hub-parity.test.ts`: 6 of 9 red on
`main` (non-vacuity, set equality `missing: [sms, lifecycle]`, en,
zh-CN, ja-JP, es-ES label drift), 9/9 green.
- `platform-objects/src/audit/sys-notification-display-labels.test.ts`:
object file restored from `main` → 2 red; restored → green.
- `plugin-audit/src/objects/sys-audit-log-action-labels.test.ts`: object
file restored from `main` → the label case red, the stored-values case
green (the values never moved); restored → green.
Suites: `@objectstack/platform-objects` 101 files / 1434 tests,
`@objectstack/plugin-audit` 66 files / 1053 tests,
`@objectstack/service-settings` 63 files / 1025 tests pass; typecheck of
all three passes; `pnpm check:i18n`, `check:i18n-coverage`,
`check:i18n-stale-fill` pass. `dispatch-gates --commands` derived 61
families at `f3487c44`: 60 exit 0, `check:dual-build-cjs-loads` NOT
MEASURED (exit 3, needs every package's dist); `pnpm lint` exit 0.
Skills-docs: none — the docs name these pages as "Setup → Settings → SMS
Delivery", which still holds.
## Human Minimum
- [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic.
- [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.
- [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: 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_016WV4cxh364AJYtdpWoPiHV
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent c4390f7 commit 8cb8c7f
17 files changed
Lines changed: 319 additions & 44 deletions
File tree
- .changeset
- packages
- cli/test
- platform-objects/src
- apps
- translations
- audit
- plugins/plugin-audit/src
- objects
- translations
- services/service-settings/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
254 | 254 | | |
255 | 255 | | |
256 | 256 | | |
257 | | - | |
| 257 | + | |
258 | 258 | | |
259 | 259 | | |
260 | 260 | | |
261 | 261 | | |
262 | 262 | | |
263 | 263 | | |
264 | | - | |
| 264 | + | |
265 | 265 | | |
266 | 266 | | |
267 | 267 | | |
| |||
284 | 284 | | |
285 | 285 | | |
286 | 286 | | |
287 | | - | |
288 | | - | |
| 287 | + | |
| 288 | + | |
289 | 289 | | |
290 | 290 | | |
291 | 291 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
140 | | - | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
141 | 147 | | |
142 | 148 | | |
143 | 149 | | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
144 | 153 | | |
145 | 154 | | |
146 | 155 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2531 | 2531 | | |
2532 | 2532 | | |
2533 | 2533 | | |
2534 | | - | |
2535 | | - | |
2536 | | - | |
| 2534 | + | |
| 2535 | + | |
| 2536 | + | |
2537 | 2537 | | |
2538 | 2538 | | |
2539 | 2539 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
129 | | - | |
| 129 | + | |
| 130 | + | |
130 | 131 | | |
131 | 132 | | |
132 | 133 | | |
133 | 134 | | |
134 | 135 | | |
| 136 | + | |
135 | 137 | | |
136 | 138 | | |
137 | 139 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
109 | | - | |
| 109 | + | |
| 110 | + | |
110 | 111 | | |
111 | 112 | | |
112 | 113 | | |
113 | 114 | | |
114 | 115 | | |
| 116 | + | |
115 | 117 | | |
116 | 118 | | |
117 | 119 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | | - | |
| 88 | + | |
| 89 | + | |
89 | 90 | | |
90 | 91 | | |
91 | | - | |
| 92 | + | |
92 | 93 | | |
93 | 94 | | |
94 | | - | |
| 95 | + | |
| 96 | + | |
95 | 97 | | |
96 | 98 | | |
97 | 99 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
109 | | - | |
| 109 | + | |
| 110 | + | |
110 | 111 | | |
111 | 112 | | |
112 | 113 | | |
113 | 114 | | |
114 | 115 | | |
| 116 | + | |
115 | 117 | | |
116 | 118 | | |
117 | 119 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
87 | | - | |
88 | | - | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
89 | 90 | | |
90 | 91 | | |
91 | 92 | | |
92 | 93 | | |
93 | 94 | | |
| 95 | + | |
94 | 96 | | |
95 | 97 | | |
96 | 98 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
109 | | - | |
| 109 | + | |
| 110 | + | |
110 | 111 | | |
111 | 112 | | |
112 | 113 | | |
113 | 114 | | |
114 | 115 | | |
| 116 | + | |
115 | 117 | | |
116 | 118 | | |
117 | 119 | | |
| |||
0 commit comments