From 39a397d2628ea1da928a241af261d085ff2526af Mon Sep 17 00:00:00 2001 From: Joao Correia Date: Mon, 20 Jan 2025 11:44:29 +0000 Subject: [PATCH] Add progress vertical bars to pipeline steps --- .../ApprovalWorkflows/WorkflowStep.tsx | 90 ++++++++++--------- .../ApprovalWorkflows/WorkflowStepNumber.tsx | 2 +- .../ApprovalWorkflows/WorkflowStepSelects.tsx | 4 +- src/pages/approval-workflows/[id].tsx | 2 +- 4 files changed, 51 insertions(+), 47 deletions(-) diff --git a/src/components/ApprovalWorkflows/WorkflowStep.tsx b/src/components/ApprovalWorkflows/WorkflowStep.tsx index f17a8574..7d6adf9f 100644 --- a/src/components/ApprovalWorkflows/WorkflowStep.tsx +++ b/src/components/ApprovalWorkflows/WorkflowStep.tsx @@ -57,61 +57,65 @@ export default function WorkflowStep({ } return ( -
-
-
- - {stepNumber !== 1 && !finalStep && - - } -
- {/* Only show selects if editView === true and stepType === 'approval-by' */} - {showSelects && ( -
- -
+
+
+ + + {/* Vertical Bar connecting steps */} + {!finalStep && ( +
)} +
- {stepNumber === 1 && ( -
-
-
- - Form Intake -
-
- Prof. X -
+ {stepNumber !== 1 && !finalStep + ? + :
+ } + + {/* Only show selects if editView === true and stepType === 'approval-by' */} + {showSelects && ( +
+ +
+ )} + + {stepNumber === 1 && ( +
+
+ {/* h-[40px] probably is not the best way to match the height with the select component, but for now should be ok */} +
+ + Form Intake +
+
+ Prof. X
- )} +
+ )} - {editView && stepNumber !== 1 && !finalStep && ( + {editView && stepNumber !== 1 && !finalStep && ( +
- )} -
+
+ )}
+ ); }; \ No newline at end of file diff --git a/src/components/ApprovalWorkflows/WorkflowStepNumber.tsx b/src/components/ApprovalWorkflows/WorkflowStepNumber.tsx index 93e75ca8..393f19b9 100644 --- a/src/components/ApprovalWorkflows/WorkflowStepNumber.tsx +++ b/src/components/ApprovalWorkflows/WorkflowStepNumber.tsx @@ -12,7 +12,7 @@ export default function WorkflowStepNumber({ number, isSelected = false }: Props return (
{/* Right Select */} @@ -45,7 +45,7 @@ export default function WorkflowStepSelects({ onChange={onRightChange} placeholder={rightPlaceholder} flat - className="px-2 py-1 rounded-none rounded-r-2xl" + className="px-2 rounded-none rounded-r-2xl" />
diff --git a/src/pages/approval-workflows/[id].tsx b/src/pages/approval-workflows/[id].tsx index f9f0d42f..d35af5ce 100644 --- a/src/pages/approval-workflows/[id].tsx +++ b/src/pages/approval-workflows/[id].tsx @@ -180,7 +180,7 @@ export default function Home({ approvalWorkflow }: { approvalWorkflow: ApprovalW axis="y" values={steps} onReorder={handleReorder} - className="flex flex-col gap-4" + className="flex flex-col gap-0" >