mirror of
https://github.com/dataelement/bisheng.git
synced 2026-08-29 01:22:31 +08:00
fix(approval): restore DetailHeader's instanceStatus prop
Opening any approval detail threw "instanceStatus is not defined": the identifier was read inside DetailHeader while neither its parameter list nor its call sites supplied it, so it resolved to a free variable and React blew up on render. Both panels share that header, so my-tasks and my-requests detail were equally unopenable. F047 removed the whole instanceStatus path; merging feat/2.7-common back restored StatusBadge's parameter and the list row's argument but not DetailHeader's parameter or the task panel's argument, leaving the one use with nothing behind it. This puts those two back, matching the wiring shipped in v2.6.0-cofco-0813-fix2 exactly. The prop is what downgrades an approved task's badge to "exception" when the instance's execution failed, so this also restores that state. The instance panel still passes nothing: its own status is already the instance status. Claude-Session: https://claude.ai/code/session_01GFB4nTgvifwbGSnaAVeRTB
This commit is contained in:
@@ -665,8 +665,8 @@ export function ApprovalCenterDialog({ open, onOpenChange, target }: ApprovalCen
|
||||
);
|
||||
}
|
||||
|
||||
function DetailHeader({ title, status, scope, serialNo, scenarioName, createTime, localize, onBack }: {
|
||||
title?: string; status?: string; scope: "task" | "instance"; serialNo: string; scenarioName?: string; createTime?: string | null; localize: ReturnType<typeof useLocalize>; onBack?: () => void;
|
||||
function DetailHeader({ title, status, instanceStatus, scope, serialNo, scenarioName, createTime, localize, onBack }: {
|
||||
title?: string; status?: string; instanceStatus?: string; scope: "task" | "instance"; serialNo: string; scenarioName?: string; createTime?: string | null; localize: ReturnType<typeof useLocalize>; onBack?: () => void;
|
||||
}) {
|
||||
return (
|
||||
// Pinned to the top of the scrolling detail pane so the title/status/serial stay visible while the body scrolls.
|
||||
@@ -720,7 +720,7 @@ function TaskDetailPanel({ detail, localize, onBack }: { detail: ApprovalTaskDet
|
||||
|
||||
return (
|
||||
<div className="space-y-5">
|
||||
<DetailHeader title={formatTitle(detail.scenario_code, detail.business_name, localize)} status={detail.status} scope="task"
|
||||
<DetailHeader title={formatTitle(detail.scenario_code, detail.business_name, localize)} status={detail.status} instanceStatus={detail.instance_status} scope="task"
|
||||
serialNo={serialNo} scenarioName={detail.scenario_name || detail.scenario_code} createTime={detail.create_time} localize={localize} onBack={onBack} />
|
||||
|
||||
<div>
|
||||
|
||||
Reference in New Issue
Block a user