Repository navigation
Commit 2c0a97b
fix(plugin-audit, platform-objects): label record pointers "Record" and the import job error "Failure Reason" (#28525)
<!-- claude-projects-attribution: {"github_login":"os-project-manager"}
-->
_Requested by **Leehom** · [project
thread](https://claude.ai/code/project/chan_01TenzsRopZj4jMbvjX8uz1X?thread=cmsg_01TenzsRopZj4jMbvjX8uz1X1aerzimQKmxjarmWGsK9XD)_
Fixes #28353
Fixes #28113
Clause-②: no
Metadata-protocol: none
## 维护者速读
- 改了什么:审计日志(sys_audit_log)与活动(sys_activity)的 `record_id` 字段显示名由 “Record
ID” 改为 “Record”(中文 “记录”、日文 “レコード”、西班牙文 “Registro”);导入任务(sys_import_job)的
`error` 字段显示名由 “Fatal Error” 改为 “Failure Reason”(“失败原因”、“失敗理由”、“Motivo
del fallo”)。
- 为什么改:审计日志列表和活动详情里这一列画的是目标记录的图标和名称,表头却写 “Record ID”;导入任务全部行失败时 `error`
里是一句 “每行都失败了,原因见结果” 的说明,标成 “Fatal Error” 会让管理员去找一次崩溃。
- 风险与回滚:只改显示名;字段名、类型、存储、查询、种子数据、指针对都不变;回滚即 revert 本 PR。
-
先看:packages/plugins/plugin-audit/src/objects/sys-audit-log.object.ts(record_id
的
label)、packages/platform-objects/src/audit/sys-import-job.object.ts(error
的
label)、packages/plugins/plugin-audit/src/translations/zh-CN.objects.generated.ts(两处
record_id)。
- 两分钟验证:在 Console 打开 Setup › 审计日志,四个列表视图的表头显示 “Record”(中文界面
“记录”);打开任一导入任务记录,Outcome 分组里显示 “Failure Reason”(中文 “失败原因”)。
- 需要你做的:无,席位落地。
## What changes
- `sys_audit_log.record_id` and `sys_activity.record_id` (plugin-audit):
label `'Record ID'` becomes `'Record'`. Both are the id half of an
ActivityPointer pair (`referenceVia: 'object_name'`), so the console
draws the cell as the target record (its object's icon and name) in the
audit log's `recent`, `writes_only`, `record_views` and `all_events`
list views and on an activity's Details tab. The header now agrees with
the cell. `sys_audit_log.record_id`'s `description` ("ID of the affected
record") is left as it is: it describes the stored value, and the ruling
moves labels only.
- `sys_import_job.error` (platform-objects): label `'Fatal Error'`
becomes `'Failure Reason'`. Since the every-row-failed ruling the column
holds either the fatal error that aborted the job or one sentence
pointing at the job's `results`; the spec describe for
`ImportJobProgressSchema.error` covers both, and the sibling
`protocol.zod.ts` import describe already says "Failure reason, when
failed". No other label in the repo names this thing, so the card's
example "Failure Reason" was kept.
- English bundles regenerated by `node scripts/check-i18n-bundles.mjs
--write` (after rebuilding the two packages): across all ten bundle
packages, the only diff is the three English leaves above.
- Hand translations: zh-CN 记录 ID → 记录, ja-JP レコード ID → レコード, es-ES ID de
registro → Registro (the words `sys_approval_action.record_id` and PR
#28347 use); zh-CN 致命错误 → 失败原因, ja-JP 致命的なエラー → 失敗理由, es-ES Error fatal
→ Motivo del fallo. None of these leaves has a source-hash entry in any
locale, so no provenance table moves.
- `sys_mail_association.record_id` (service-mailbox) keeps "Record ID",
as ruled: its record page shows it only in the highlights strip, which
prints the stored id.
- Changesets: `@objectstack/plugin-audit` patch,
`@objectstack/platform-objects` patch.
## Tests
- `packages/plugins/plugin-audit/src/sys-audit-log-pointer-pair.test.ts`
(where the pair is already pinned): a new block asserts both objects'
`record_id` label is "Record", that the field stays the text id half
resolved through `object_name`, and that the en / zh-CN / ja-JP / es-ES
bundle leaves read Record / 记录 / レコード / Registro.
-
`packages/platform-objects/src/audit/sys-import-job-error-label.test.ts`
(new; no test pinned this object in its package): the `error` label is
"Failure Reason", the field stays an optional textarea in the Outcome
group, and the four bundle leaves read Failure Reason / 失败原因 / 失敗理由 /
Motivo del fallo.
- Red first on `main` (`23d1303d`, test commit `56131cbf` only):
plugin-audit pointer-pair file 10 failed | 12 passed; import-job file 5
failed (each `Expected "Record"` / `"Failure Reason"`, `Received "Record
ID"` / `"Fatal Error"`). Green at the fix: 22/22 and 5/5.
## Acceptance notes
- These pins assert display copy, which the order asks for and which
this package family already does for labels
(`sys-audit-log-action-labels.test.ts`,
`sys-notification-display-labels.test.ts`). Each pin also asserts the
field's unchanged type and pointer, so a label edit cannot ride along
with a storage change.
- No open PR touches the edited object or bundle files at the time this
PR was opened.
## Verification
All readings at head `b0284131` on objectstack-ai/objectstack (merge
base `23d1303d`).
<details><summary>Tests</summary>
- `pnpm --filter @objectstack/plugin-audit test`: Test Files 68/68,
Tests 1109/1109 passed (lock VERDICT command-exit 0).
- `pnpm --filter @objectstack/platform-objects test`: Test Files
105/105, Tests 1479/1479 passed (lock VERDICT command-exit 0).
- `pnpm --filter @objectstack/plugin-audit --filter
@objectstack/platform-objects run typecheck` (tsc, scripts tsconfig,
test-typecheck ledger 0 held): lock VERDICT command-exit 0.
- `eslint packages/plugins/plugin-audit packages/platform-objects
--no-inline-config`: exit 0.
</details>
<details><summary>Gates</summary>
- Build: `turbo run build --filter='./packages/**'` 77/77 tasks, lock
VERDICT command-exit 0; then the two touched packages rebuilt after the
edit.
- `dispatch-gates --commands` at `b0284131`: 61 families, each run with
stdin from `/dev/null`, exit codes recorded before any pipe; all 61
answered exit 0 (`check-plugin-teardown-shape --self-test` after
fetching its pinned control commit `621a4876` into the shallow clone).
`--ran`: 61 derived, 61 run, 0 NOT-MEASURED, 0 UNRUN.
- The full CI farm (`test:repo`, the UI lanes) is CI's.
</details>
---
_Generated by [Claude
Code](https://claude.ai/code/session_01FEkQ5nRf243Z25ndgeQBPH)_
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 890c2a6 commit 2c0a97b
15 files changed
Lines changed: 115 additions & 15 deletions
File tree
- .changeset
- packages
- platform-objects/src
- apps/translations
- audit
- plugins/plugin-audit/src
- objects
- translations
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3061 | 3061 | | |
3062 | 3062 | | |
3063 | 3063 | | |
3064 | | - | |
| 3064 | + | |
3065 | 3065 | | |
3066 | 3066 | | |
3067 | 3067 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3061 | 3061 | | |
3062 | 3062 | | |
3063 | 3063 | | |
3064 | | - | |
| 3064 | + | |
3065 | 3065 | | |
3066 | 3066 | | |
3067 | 3067 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3061 | 3061 | | |
3062 | 3062 | | |
3063 | 3063 | | |
3064 | | - | |
| 3064 | + | |
3065 | 3065 | | |
3066 | 3066 | | |
3067 | 3067 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3061 | 3061 | | |
3062 | 3062 | | |
3063 | 3063 | | |
3064 | | - | |
| 3064 | + | |
3065 | 3065 | | |
3066 | 3066 | | |
3067 | 3067 | | |
| |||
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | | - | |
| 70 | + | |
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
199 | | - | |
| 199 | + | |
200 | 200 | | |
201 | 201 | | |
202 | 202 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
354 | 354 | | |
355 | 355 | | |
356 | 356 | | |
357 | | - | |
| 357 | + | |
358 | 358 | | |
359 | 359 | | |
360 | 360 | | |
| |||
0 commit comments