From 98a223e5e149f698918ab4cd4aca69ca174f48fc Mon Sep 17 00:00:00 2001 From: anmolsinghbhatia Date: Sat, 20 May 2023 22:24:05 +0530 Subject: [PATCH] fix: cycle view board view fix , feat: on gantt view set all cycle as default tab --- .../app/components/cycles/completed-cycles.tsx | 8 -------- apps/app/components/cycles/cycles-view.tsx | 18 ++++++++++++------ 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/apps/app/components/cycles/completed-cycles.tsx b/apps/app/components/cycles/completed-cycles.tsx index 738b6c5fbf..36ef691f5e 100644 --- a/apps/app/components/cycles/completed-cycles.tsx +++ b/apps/app/components/cycles/completed-cycles.tsx @@ -104,14 +104,6 @@ export const CompletedCycles: React.FC = ({ ))} )} - {cycleView === "gantt" && ( - - )} ) : ( = ({ @@ -100,7 +100,10 @@ export const CyclesView: React.FC = ({ className={`grid h-7 w-7 place-items-center rounded outline-none duration-300 hover:bg-brand-surface-2 ${ cyclesView === "gantt_chart" ? "bg-brand-surface-2" : "" }`} - onClick={() => setCyclesView("gantt_chart")} + onClick={() => { + setCyclesView("gantt_chart"); + setCycleTab("All"); + }} > waterfall_chart @@ -111,6 +114,7 @@ export const CyclesView: React.FC = ({ { switch (i) { case 0: @@ -123,7 +127,6 @@ export const CyclesView: React.FC = ({ return setCycleTab("Completed"); case 4: return setCycleTab("Drafts"); - default: return setCycleTab("All"); } @@ -132,7 +135,10 @@ export const CyclesView: React.FC = ({
{["All", "Active", "Upcoming", "Completed", "Drafts"].map((tab, index) => { - if (cyclesView === "gantt_chart" && (tab === "Active" || tab === "Drafts")) + if ( + cyclesView === "gantt_chart" && + (tab === "Active" || tab === "Drafts" || tab === "Completed") + ) return null; return ( @@ -162,7 +168,7 @@ export const CyclesView: React.FC = ({ type="current" /> )} - {cyclesView === "grid" && ( + {cyclesView === "board" && (