From 83a0c8163f107334cffb4364b078dba73355cf06 Mon Sep 17 00:00:00 2001 From: guru_sainath Date: Sun, 21 May 2023 18:37:26 +0530 Subject: [PATCH] dev: redirection implementation on gantt blocks (#1104) --- .../cycles/cycles-list-gantt-chart.tsx | 21 ++++++++++----- apps/app/components/cycles/gantt-chart.tsx | 24 +++++++++-------- .../components/gantt-chart/blocks/index.tsx | 4 +-- apps/app/components/issues/gantt-chart.tsx | 23 ++++++++-------- apps/app/components/modules/gantt-chart.tsx | 24 +++++++++-------- .../modules/modules-list-gantt-chart.tsx | 27 ++++++++++++------- apps/app/components/views/gantt-chart.tsx | 24 +++++++++-------- 7 files changed, 84 insertions(+), 63 deletions(-) diff --git a/apps/app/components/cycles/cycles-list-gantt-chart.tsx b/apps/app/components/cycles/cycles-list-gantt-chart.tsx index ad298e79d7..9c8e922d29 100644 --- a/apps/app/components/cycles/cycles-list-gantt-chart.tsx +++ b/apps/app/components/cycles/cycles-list-gantt-chart.tsx @@ -1,5 +1,7 @@ import { FC } from "react"; - +// next imports +import Link from "next/link"; +import { useRouter } from "next/router"; // components import { GanttChartRoot } from "components/gantt-chart"; // types @@ -10,6 +12,9 @@ type Props = { }; export const CyclesListGanttChartView: FC = ({ cycles }) => { + const router = useRouter(); + const { workspaceSlug, projectId } = router.query; + // rendering issues on gantt sidebar const GanttSidebarBlockView = ({ data }: any) => (
@@ -23,12 +28,14 @@ export const CyclesListGanttChartView: FC = ({ cycles }) => { // rendering issues on gantt card const GanttBlockView = ({ data }: { data: ICycle }) => ( -
-
-
- {data?.name} -
-
+ + +
+
+ {data?.name} +
+
+ ); // handle gantt issue start date and target date diff --git a/apps/app/components/cycles/gantt-chart.tsx b/apps/app/components/cycles/gantt-chart.tsx index 04de7afb7f..44abc392bf 100644 --- a/apps/app/components/cycles/gantt-chart.tsx +++ b/apps/app/components/cycles/gantt-chart.tsx @@ -1,7 +1,7 @@ import { FC } from "react"; - +// next imports +import Link from "next/link"; import { useRouter } from "next/router"; - // components import { GanttChartRoot } from "components/gantt-chart"; // hooks @@ -32,15 +32,17 @@ export const CycleIssuesGanttChartView: FC = ({}) => { // rendering issues on gantt card const GanttBlockView = ({ data }: any) => ( -
-
-
- {data?.name} -
-
+ + +
+
+ {data?.name} +
+
+ ); // handle gantt issue start date and target date diff --git a/apps/app/components/gantt-chart/blocks/index.tsx b/apps/app/components/gantt-chart/blocks/index.tsx index 113ca8964a..98284cce8e 100644 --- a/apps/app/components/gantt-chart/blocks/index.tsx +++ b/apps/app/components/gantt-chart/blocks/index.tsx @@ -39,7 +39,7 @@ export const GanttChartBlocks: FC<{ >
- {block?.start_date ? datePreview(block?.start_date, true) : "-"} + {block?.start_date ? datePreview(block?.start_date) : "-"}
@@ -54,7 +54,7 @@ export const GanttChartBlocks: FC<{
- {block?.target_date ? datePreview(block?.target_date, true) : "-"} + {block?.target_date ? datePreview(block?.target_date) : "-"}
diff --git a/apps/app/components/issues/gantt-chart.tsx b/apps/app/components/issues/gantt-chart.tsx index b35d4a7499..8fce3e96f7 100644 --- a/apps/app/components/issues/gantt-chart.tsx +++ b/apps/app/components/issues/gantt-chart.tsx @@ -1,8 +1,7 @@ import { FC } from "react"; - +// next imports import Link from "next/link"; import { useRouter } from "next/router"; - // components import { GanttChartRoot } from "components/gantt-chart"; // hooks @@ -32,15 +31,17 @@ export const IssueGanttChartView: FC = ({}) => { // rendering issues on gantt card const GanttBlockView = ({ data }: any) => ( -
-
-
- {data?.name} -
-
+ + +
+
+ {data?.name} +
+
+ ); // handle gantt issue start date and target date diff --git a/apps/app/components/modules/gantt-chart.tsx b/apps/app/components/modules/gantt-chart.tsx index 0d11da2c06..fa92964c1a 100644 --- a/apps/app/components/modules/gantt-chart.tsx +++ b/apps/app/components/modules/gantt-chart.tsx @@ -1,7 +1,7 @@ import { FC } from "react"; - +// next imports +import Link from "next/link"; import { useRouter } from "next/router"; - // components import { GanttChartRoot } from "components/gantt-chart"; // hooks @@ -32,15 +32,17 @@ export const ModuleIssuesGanttChartView: FC = ({}) => { // rendering issues on gantt card const GanttBlockView = ({ data }: any) => ( -
-
-
- {data?.name} -
-
+ + +
+
+ {data?.name} +
+
+ ); // handle gantt issue start date and target date diff --git a/apps/app/components/modules/modules-list-gantt-chart.tsx b/apps/app/components/modules/modules-list-gantt-chart.tsx index edff17a952..cb1c7bc075 100644 --- a/apps/app/components/modules/modules-list-gantt-chart.tsx +++ b/apps/app/components/modules/modules-list-gantt-chart.tsx @@ -1,5 +1,7 @@ import { FC } from "react"; - +// next imports +import Link from "next/link"; +import { useRouter } from "next/router"; // components import { GanttChartRoot } from "components/gantt-chart"; // types @@ -12,6 +14,9 @@ type Props = { }; export const ModulesListGanttChartView: FC = ({ modules }) => { + const router = useRouter(); + const { workspaceSlug, projectId } = router.query; + // rendering issues on gantt sidebar const GanttSidebarBlockView = ({ data }: any) => (
@@ -27,15 +32,17 @@ export const ModulesListGanttChartView: FC = ({ modules }) => { // rendering issues on gantt card const GanttBlockView = ({ data }: { data: IModule }) => ( -
-
s.value === data.status)?.color }} - /> -
- {data?.name} -
-
+ + +
s.value === data.status)?.color }} + /> +
+ {data?.name} +
+
+ ); // handle gantt issue start date and target date diff --git a/apps/app/components/views/gantt-chart.tsx b/apps/app/components/views/gantt-chart.tsx index 461f468357..dc81f70fa7 100644 --- a/apps/app/components/views/gantt-chart.tsx +++ b/apps/app/components/views/gantt-chart.tsx @@ -1,7 +1,7 @@ import { FC } from "react"; - +// next imports +import Link from "next/link"; import { useRouter } from "next/router"; - // components import { GanttChartRoot } from "components/gantt-chart"; // hooks @@ -32,15 +32,17 @@ export const ViewIssuesGanttChartView: FC = ({}) => { // rendering issues on gantt card const GanttBlockView = ({ data }: any) => ( -
-
-
- {data?.name} -
-
+ + +
+
+ {data?.name} +
+
+ ); // handle gantt issue start date and target date