From 230213cd2ec50739fdd4a45f3f279a734adc8b3a Mon Sep 17 00:00:00 2001
From: Ichsan Kurniawan <43689091+ichsankurnia@users.noreply.github.com>
Date: Tue, 10 Nov 2026 19:01:16 +0700
Subject: [PATCH] Handle unstarted assignment phases
Represent pending assignments with no active phase, show Development as the next milestone, and align the grid and list steppers' rails with their stage dots.
---
.../project-assignment/AssignmentGrid.tsx | 51 +++++++++++--------
.../project-assignment/AssignmentList.tsx | 51 +++++++++++--------
.../task/utils/assignment-overview-helpers.ts | 19 ++++---
3 files changed, 73 insertions(+), 48 deletions(-)
diff --git a/app/(dashboard)/task/component/project-assignment/AssignmentGrid.tsx b/app/(dashboard)/task/component/project-assignment/AssignmentGrid.tsx
index 347361a..cdb5b3c 100644
--- a/app/(dashboard)/task/component/project-assignment/AssignmentGrid.tsx
+++ b/app/(dashboard)/task/component/project-assignment/AssignmentGrid.tsx
@@ -26,37 +26,48 @@ import { END_USER_FALLBACK_IMAGE } from '../../types';
const STEPPER_STAGES = ['Dev', 'SIT', 'UAT', 'PTR', 'Live'] as const;
function CompactPhaseStepper({ phaseIndex, progressColor }: { phaseIndex: number; progressColor: ProgressColorConfig }) {
+ const activeLineWidth = phaseIndex <= 0 ? 0 : Math.min(80, Math.max(0, (phaseIndex / 4) * 80));
+
return (
- {/* Background Rail Line */}
-
+ {/* Horizontal Rail Lines Container (Vertically centered with h-4 dot slot) */}
+
+ {/* Background Rail Line (Runs strictly from Dev center 10% to Live center 90%) */}
+
- {/* Active Colored Fill Line */}
-
+ {/* Active Colored Fill Line */}
+
+
{/* 5 Milestone Stage Nodes */}
-
+
{STEPPER_STAGES.map((stage, i) => {
- const isCompleted = i < phaseIndex;
- const isActive = i === phaseIndex;
+ const isCompleted = phaseIndex >= 0 && i < phaseIndex;
+ const isActive = phaseIndex >= 0 && i === phaseIndex;
return (
- {isActive ? (
-
- ) : isCompleted ? (
-
- ) : (
-
- )}
+ {/* Dot container with fixed h-4 w-4 ensuring vertical center matches the rail line */}
+
+ {isActive ? (
+
+ ) : isCompleted ? (
+
+ ) : (
+
+ )}
+
- {/* Background Rail Line */}
-
+ {/* Horizontal Rail Lines Container (Vertically centered with h-4 dot slot) */}
+
+ {/* Background Rail Line (Runs strictly from Dev center 10% to Live center 90%) */}
+
- {/* Active Colored Fill Line */}
-
+ {/* Active Colored Fill Line */}
+
+
{/* 5 Milestone Stage Nodes */}
-
+
{STEPPER_STAGES.map((stage, i) => {
- const isCompleted = i < phaseIndex;
- const isActive = i === phaseIndex;
+ const isCompleted = phaseIndex >= 0 && i < phaseIndex;
+ const isActive = phaseIndex >= 0 && i === phaseIndex;
return (
- {isActive ? (
-
- ) : isCompleted ? (
-
- ) : (
-
- )}
+ {/* Dot container with fixed h-4 w-4 ensuring vertical center matches the rail line */}
+
+ {isActive ? (
+
+ ) : isCompleted ? (
+
+ ) : (
+
+ )}
+
0 ? `${remDays} days remaining` : 'Schedule pending';
- if (phaseIndex === 0) nextMilestoneText = 'Next: SIT Testing';
+ if (phaseIndex === -1) nextMilestoneText = 'Next: Development';
+ else if (phaseIndex === 0) nextMilestoneText = 'Next: SIT Testing';
else if (phaseIndex === 1) nextMilestoneText = 'Next: UAT Testing';
else if (phaseIndex === 2) nextMilestoneText = 'Next: Production Trial Run';
else if (phaseIndex === 3) nextMilestoneText = 'Next: Go-Live';