FN-5831: guard branchContext group chip rendering in TaskCard
Fix TaskCard branch group chip logic to satisfy strict branchContext nullability checks. - Replace optional chaining-only guard with explicit branchContext and groupId presence checks - Hoist group metadata into local constants to avoid repeated nullable property access - Keep shared/group chip title, label, click handling, and displayed value behavior unchanged while type-safe Files changed: packages/dashboard/app/components/TaskCard.tsx | 46 +++++++++++++------------- 1 file changed, 23 insertions(+), 23 deletions(-) Fusion-Task-Id: FN-5831 Fusion-Task-Lineage: 65e2c335-3884-42ba-b87e-5e6a9e0245d8
This commit is contained in:
@@ -1894,30 +1894,30 @@ function TaskCardComponent({
|
||||
<span className="card-branch-value">{branchMetadata.baseBranch}</span>
|
||||
</span>
|
||||
)}
|
||||
{task.branchContext?.groupId && (
|
||||
<span
|
||||
className="card-branch-chip"
|
||||
title={
|
||||
task.branchContext.assignmentMode === "shared" && branchMetadata.branch
|
||||
? `${task.branchContext.groupId} · ${branchMetadata.branch}`
|
||||
: task.branchContext.groupId
|
||||
}
|
||||
onClick={(event) => {
|
||||
if (!onOpenGroupModal) return;
|
||||
event.stopPropagation();
|
||||
onOpenGroupModal(task.branchContext.groupId);
|
||||
}}
|
||||
>
|
||||
<span className="card-branch-label">
|
||||
{task.branchContext.assignmentMode === "shared" ? "Shared" : "Group"}
|
||||
{task.branchContext != null && task.branchContext.groupId != null && (() => {
|
||||
const groupId = task.branchContext.groupId;
|
||||
const isSharedAssignment = task.branchContext.assignmentMode === "shared";
|
||||
return (
|
||||
<span
|
||||
className="card-branch-chip"
|
||||
title={
|
||||
isSharedAssignment && branchMetadata.branch
|
||||
? `${groupId} · ${branchMetadata.branch}`
|
||||
: groupId
|
||||
}
|
||||
onClick={(event) => {
|
||||
if (!onOpenGroupModal) return;
|
||||
event.stopPropagation();
|
||||
onOpenGroupModal(groupId);
|
||||
}}
|
||||
>
|
||||
<span className="card-branch-label">{isSharedAssignment ? "Shared" : "Group"}</span>
|
||||
<span className="card-branch-value">
|
||||
{isSharedAssignment && branchMetadata.branch ? branchMetadata.branch : groupId}
|
||||
</span>
|
||||
</span>
|
||||
<span className="card-branch-value">
|
||||
{task.branchContext.assignmentMode === "shared" && branchMetadata.branch
|
||||
? branchMetadata.branch
|
||||
: task.branchContext.groupId}
|
||||
</span>
|
||||
</span>
|
||||
)}
|
||||
);
|
||||
})()}
|
||||
</div>
|
||||
)}
|
||||
{showProgressSection && (() => {
|
||||
|
||||
Reference in New Issue
Block a user