feat(approvals): enrich inbox rows with payload_labels (snapshot field labels)#3501
Open
baozhoutao wants to merge 1 commit into
Open
feat(approvals): enrich inbox rows with payload_labels (snapshot field labels)#3501baozhoutao wants to merge 1 commit into
baozhoutao wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
📓 Docs Drift CheckThis PR changes 2 package(s): 104 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:
|
…d labels)
The approvals inbox summary title-cased raw snapshot machine keys
("assessment_status" → "Assessment Status") because the API sent no field
labels. Add `payload_labels` (snapshot field key → the target object's field
label) to the inbox enrichment, symmetric with the existing `payload_display`
(which resolves the values). For a single-locale project the schema label is
already the localized string, so the client can render "考核状态" instead of a
prettified English key; the client falls back to the prettified key when a
label is absent.
- ApprovalRequestRow contract: add `payload_labels?`.
- ApprovalService.enrichRows: resolve per-object field labels and attach the
ones whose keys are present in the snapshot.
- Add a service test.
Action/param i18n (the `_actions` translation bundles) is intentionally NOT
included here — framework main already ships complete action translations for
sys_approval_request across en/zh-CN/ja-JP/es-ES.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #3500
背景
审批收件箱摘要只拿得到快照的机器名字段 key,只能
prettifyKey生造英文标签(assessment_status→ "Assessment Status"),读不到目标对象真正的字段 label。中文项目里本该显示"考核状态"。后端富化已下发object_label/payload_display,唯独没有字段 label。改动
ApprovalRequestRowcontract 新增payload_labels?: Record<string,string>。ApprovalService.enrichRows按对象解析字段 label,只附带快照里实际存在的 key;与既有payload_display对称。单语言项目里schema.label本身即本地化串。验证
pnpm --filter @objectstack/plugin-approvals test→ 165 passed(含新增 payload_labels 用例)。app-showcase(seed-approval-demo)起后端,审批 API/api/v1/approvals/requests/{id}返回payload_labels,含name→"Invoice Number"、total→"Subtotal"(≠ prettifyKey 的 "Name"/"Total"),经 objectui console dev 渲染在摘要卡片。客户端消费 PR:objectstack-ai/objectui#2818。
🤖 Generated with Claude Code