Repository navigation
fix(console): the approvals inbox names the flow, the step and the object in the reader's language - #27040
Merged
Conversation
…anguage Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxbYXpuN8KEvNpYF9hQG
…ngeset Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxbYXpuN8KEvNpYF9hQG
Contributor
Author
席位核对ACCEPT · seat 席位意见:审批收件箱改走控制台的认证 fetch(与申请详情页同一通道),带上用户选择的语言,服务端审批接口本来就按语言给出流程、步骤、对象的译名;对象筛选也显示译名。Setup › 审批申请列表读的是通用数据接口,属服务端,另立卡 #27041。
|
8 tasks done
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.
Requested by Warren · project thread
Fixes #26883
Clause-②: no
Metadata-protocol: none
维护者速读
approvalsApi.ts的call。ui/apps/console/src/services/approvalsApi.ts的call;ApprovalsInboxPage.tsx的objectOptions;新测试ApprovalsInboxPage.readerLocaleLabels-26883.test.tsx。pnpm --dir ui exec vitest run apps/console/src/pages/system/ApprovalsInboxPage.readerLocaleLabels-26883.test.tsx,预期 6 个全过。What changes
approvalsApi.call(every inbox read and decision) now goes throughcreateAuthenticatedFetch()from@object-ui/auth, the transportapprovalRequestsDataSource.ts(the request page) already uses. It stamps the Bearer (as before),X-Tenant-ID, and the active UI language asAccept-Language. The hand-built Bearer header is gone because the wrapper sets it.process_label,step_labelandobject_labelin the request'sAccept-Languagefrom the app's pack (flows.FLOW.label,flows.FLOW.approvals.NODE.label,objects.OBJECT.label;reader-locale-labels.tsin@objectstack/plugin-approvals, shipped in 18.1.0), keeping the stored label when the pack has no entry. So the row, the process filter and the object column now show the pack's text with no client-side resolver.opportunity); it now lists each object by the label the row serves, and the search haystack includesobject_label.@object-ui/consolepatch.Why
The card's mechanism assumption (the inbox shows the stored English with no lookup, fix by a client lookup) is disproved on
origin/main5e99bd93: the server translates per reader, and the inbox simply never told it the reader's language. A barefetchsends only the browser's language, so a zh-CN user on an en-US browser got English. Same root cause and same fix shape as the/forms/:nameselect-option fix (.changeset/26452-form-options-locale.md). No second resolver, nothing stored changes, no server change.Tests
New
ui/apps/console/src/pages/system/ApprovalsInboxPage.readerLocaleLabels-26883.test.tsx: the realI18nProviderwrites the html element'slangattribute, the realcreateAuthenticatedFetchreads it, and a globalfetchstand-in for the door answers in the language it is asked for.Accept-Language: zhunder a zh UI;Acceptance notes
sys_approval_requestobject list (nav_approval_requestsinapprovals-plugin.ts), read over the generic data door, which serves the storedprocess_label/current_step_label(thereader-locale-labels.tsheader says so). The fix lands server-side in@objectstack/plugin-approvals, not inplugin-list/plugin-grid, filed as Setup › Approval Requests list shows the stored flow and step labels under zh-CN: the data-door read of sys_approval_request skips the reader-locale labels the approvals door applies #27041.Verification
Ablation
Commit
120f45fd.node scripts/ablation-replace.mjsreplacedconst res = await createAuthenticatedFetch()(withconst res = await fetch(inapprovalsApi.ts(anchor 1 to 0, blob5ada17474e93to473dc3b025d1), ran the new file: 5 failed, 1 passed (the untranslated-flow fallback, which is expected to hold either way). Restored: blob equals HEAD,git diff HEADempty.Local gates
Head
2c07fcd0(after mergingorigin/main7eb613c3).node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackderived 33 families; all 33 ran, every one exit 0;--ranreconciliation: 33 derived, 33 run, 0 NOT-MEASURED.Package checks on the same head:
pnpm --dir ui exec vitest run apps/console/src/pages/system/ApprovalsInbox apps/console/src/services/approval apps/console/src/__tests__/approvalsInboxComponentRef.test.tsx: Test Files 29 passed, Tests 204 passed.pnpm --filter @object-ui/console type-check: exit 0.Human Minimum
packages/specholds no runtime logic.pnpm lintpasses (CI-owned).main, one pull request.packages/specnot touched.content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.🤖 Generated with Claude Code
Generated by Claude Code