Skip to content

Commit 752e18f

Browse files
baozhoutaoclaude
andauthored
fix(console,app-shell): readable reassign hand-off + "System" label for svc:* audit actors (objectstack#4365, objectstack#4366) (#3121)
- ApprovalsInboxPage: a reassign timeline entry renders "from A to B" from the structured reassign_from/reassign_to fields (server-resolved *_name companions, objectstack#4365) instead of the old default comment that baked two raw user ids into user-facing text. Legacy rows without the structured fields keep the comment fallback. New i18n key approvalsInbox.reassignFromTo across all ten locales. - RecordDetailView: an audit row attributed to a service principal (svc:* on the actor column, e.g. a runAs:'system' flow's svc:flow:<name> label from objectstack#4366) renders the localized "System" label instead of the raw principal string; the raw value stays on the entry. Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
1 parent 57a33a6 commit 752e18f

13 files changed

Lines changed: 58 additions & 2 deletions

File tree

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
"@object-ui/console": patch
3+
"@object-ui/app-shell": patch
4+
"@object-ui/i18n": patch
5+
---
6+
7+
fix(console,app-shell): readable reassign hand-off + "System" label for svc:* audit actors — objectstack#4365 / objectstack#4366
8+
9+
- **Approvals inbox** (`ApprovalsInboxPage`): a reassign timeline entry now
10+
renders "from A to B" from the structured
11+
`reassign_from`/`reassign_to` fields (and their server-resolved
12+
`*_name` companions) that objectstack#4365 added to
13+
`sys_approval_action`, instead of relying on the old default comment that
14+
baked two raw user ids into user-facing text. Legacy rows without the
15+
structured fields keep the comment fallback. New i18n key
16+
`approvalsInbox.reassignFromTo` across all ten locales.
17+
- **Record history** (`RecordDetailView`): an audit row attributed to a
18+
service principal (`svc:*` on the `actor` column — e.g. a
19+
`runAs:'system'` flow's `svc:flow:<name>` label from objectstack#4366) now
20+
renders the localized "System" label instead of the raw principal string;
21+
the raw value stays on the entry for tooling.

apps/console/src/pages/system/ApprovalsInboxPage.tsx

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1904,6 +1904,25 @@ export function ApprovalsInboxPage() {
19041904
{formatRelative(a.created_at)}
19051905
</span>
19061906
</div>
1907+
{/* Structured reassign hand-off (framework#4365): render
1908+
"from A to B" from the resolved parties. Legacy rows
1909+
predate the fields and only carry the old default
1910+
comment — those keep the comment fallback below. */}
1911+
{(() => {
1912+
const ax = a as typeof a & {
1913+
reassign_from?: string; reassign_to?: string;
1914+
reassign_from_name?: string; reassign_to_name?: string;
1915+
};
1916+
if (a.action !== 'reassign' || (!ax.reassign_from && !ax.reassign_to)) return null;
1917+
return (
1918+
<div className="text-muted-foreground mt-0.5">
1919+
{tr('reassignFromTo', 'from {{from}} to {{to}}', {
1920+
from: ax.reassign_from_name ?? formatIdentity(ax.reassign_from),
1921+
to: ax.reassign_to_name ?? formatIdentity(ax.reassign_to),
1922+
})}
1923+
</div>
1924+
);
1925+
})()}
19071926
{a.comment && (
19081927
<div className="text-muted-foreground italic mt-0.5">"{a.comment}"</div>
19091928
)}

packages/app-shell/src/views/RecordDetailView.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1225,12 +1225,18 @@ export function RecordDetailView({ dataSource, objects, onEdit, objectNameOverri
12251225
const enriched = items.map((it, idx) => {
12261226
const u = it?.user_id ? userMap.get(it.user_id) : undefined;
12271227
// Attribution fallback chain: resolved user name → service/automation
1228-
// principal from the `actor` column (e.g. "svc:scheduler") → null
1228+
// principal from the `actor` column (e.g. "svc:flow:<name>") → null
12291229
// (the timeline then shows its localized unknown-user text).
1230-
const actorLabel =
1230+
// A `svc:*` principal is a machine, not a person — render the
1231+
// localized "System" label rather than the raw principal string
1232+
// (framework#4366); the raw value stays available on the entry.
1233+
const rawActor =
12311234
typeof it?.actor === 'string' && it.actor.trim() && it.actor !== it?.user_id
12321235
? it.actor.trim()
12331236
: null;
1237+
const actorLabel = rawActor?.startsWith('svc:')
1238+
? t('detail.systemActor', { defaultValue: 'System' })
1239+
: rawActor;
12341240
const changes = rawChangesPerItem[idx].map((c) => ({
12351241
field: c.field,
12361242
label: fieldLabels[c.field] || c.field,

packages/i18n/src/locales/ar.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2757,6 +2757,7 @@ const ar = {
27572757
slaRemaining: 'SLA المتبقي {{dur}}',
27582758
slaOverdue: 'SLA متأخر {{dur}}',
27592759
actReassign: 'إعادة إسناد',
2760+
reassignFromTo: 'من {{from}} إلى {{to}}',
27602761
actRemind: 'تذكير',
27612762
actRequestInfo: 'طلب معلومات',
27622763
actComment: 'تعليق',

packages/i18n/src/locales/de.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2757,6 +2757,7 @@ const de = {
27572757
slaRemaining: 'SLA noch {{dur}}',
27582758
slaOverdue: 'SLA überfällig {{dur}}',
27592759
actReassign: 'Übergeben',
2760+
reassignFromTo: 'von {{from}} an {{to}}',
27602761
actRemind: 'Erinnert',
27612762
actRequestInfo: 'Rückfrage gestellt',
27622763
actComment: 'Kommentiert',

packages/i18n/src/locales/en.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2861,6 +2861,7 @@ const en = {
28612861
slaRemaining: 'SLA {{dur}} left',
28622862
slaOverdue: 'SLA overdue {{dur}}',
28632863
actReassign: 'Reassigned',
2864+
reassignFromTo: 'from {{from}} to {{to}}',
28642865
actRemind: 'Reminder sent',
28652866
actRequestInfo: 'Requested more info',
28662867
actComment: 'Commented',

packages/i18n/src/locales/es.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2757,6 +2757,7 @@ const es = {
27572757
slaRemaining: 'SLA: quedan {{dur}}',
27582758
slaOverdue: 'SLA vencido {{dur}}',
27592759
actReassign: 'Reasignada',
2760+
reassignFromTo: 'de {{from}} a {{to}}',
27602761
actRemind: 'Recordatorio',
27612762
actRequestInfo: 'Pidió más información',
27622763
actComment: 'Comentó',

packages/i18n/src/locales/fr.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2757,6 +2757,7 @@ const fr = {
27572757
slaRemaining: 'SLA : {{dur}} restants',
27582758
slaOverdue: 'SLA dépassé de {{dur}}',
27592759
actReassign: 'Réattribuée',
2760+
reassignFromTo: 'de {{from}} à {{to}}',
27602761
actRemind: 'Relance',
27612762
actRequestInfo: 'Infos demandées',
27622763
actComment: 'Commentaire',

packages/i18n/src/locales/ja.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2757,6 +2757,7 @@ const ja = {
27572757
slaRemaining: 'SLA 残り {{dur}}',
27582758
slaOverdue: 'SLA 超過 {{dur}}',
27592759
actReassign: '引き継ぎ',
2760+
reassignFromTo: '{{from}} から {{to}} へ',
27602761
actRemind: 'リマインド',
27612762
actRequestInfo: '追加情報を要求',
27622763
actComment: 'コメント',

packages/i18n/src/locales/ko.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2757,6 +2757,7 @@ const ko = {
27572757
slaRemaining: 'SLA {{dur}} 남음',
27582758
slaOverdue: 'SLA {{dur}} 초과',
27592759
actReassign: '재할당',
2760+
reassignFromTo: '{{from}} 님에서 {{to}} 님으로',
27602761
actRemind: '독촉',
27612762
actRequestInfo: '보완 요청',
27622763
actComment: '댓글',

0 commit comments

Comments
 (0)