diff --git a/apps/app/components/cycles/cycles-list-gantt-chart.tsx b/apps/app/components/cycles/cycles-list-gantt-chart.tsx index 9c8e922d2..056872c33 100644 --- a/apps/app/components/cycles/cycles-list-gantt-chart.tsx +++ b/apps/app/components/cycles/cycles-list-gantt-chart.tsx @@ -4,6 +4,8 @@ import Link from "next/link"; import { useRouter } from "next/router"; // components import { GanttChartRoot } from "components/gantt-chart"; +// ui +import { Tooltip } from "components/ui"; // types import { ICycle } from "types"; @@ -31,9 +33,11 @@ export const CyclesListGanttChartView: FC = ({ cycles }) => {
-
- {data?.name} -
+ +
+ {data?.name} +
+
); diff --git a/apps/app/components/cycles/gantt-chart.tsx b/apps/app/components/cycles/gantt-chart.tsx index 44abc392b..42ecad448 100644 --- a/apps/app/components/cycles/gantt-chart.tsx +++ b/apps/app/components/cycles/gantt-chart.tsx @@ -4,6 +4,8 @@ import Link from "next/link"; import { useRouter } from "next/router"; // components import { GanttChartRoot } from "components/gantt-chart"; +// ui +import { Tooltip } from "components/ui"; // hooks import useGanttChartCycleIssues from "hooks/gantt-chart/cycle-issues-view"; @@ -38,9 +40,23 @@ export const CycleIssuesGanttChartView: FC = ({}) => { className="flex-shrink-0 w-[4px] h-full" style={{ backgroundColor: data?.state_detail?.color || "#858e96" }} /> -
- {data?.name} -
+ +
+ {data?.name} +
+
+ {data.infoToggle && ( + +
+ + info + +
+
+ )} ); @@ -59,10 +75,20 @@ export const CycleIssuesGanttChartView: FC = ({}) => { const blockFormat = (blocks: any) => blocks && blocks.length > 0 ? blocks.map((_block: any) => { - if (_block?.start_date && _block.target_date) console.log("_block", _block); + let startDate = new Date(_block.created_at); + let targetDate = new Date(_block.updated_at); + let infoToggle = true; + + if (_block?.start_date && _block.target_date) { + startDate = _block?.start_date; + targetDate = _block.target_date; + infoToggle = false; + } + return { - start_date: new Date(_block.created_at), - target_date: new Date(_block.updated_at), + start_date: new Date(startDate), + target_date: new Date(targetDate), + infoToggle: infoToggle, data: _block, }; }) diff --git a/apps/app/components/gantt-chart/blocks/index.tsx b/apps/app/components/gantt-chart/blocks/index.tsx index f2d44b294..d5eadf2a0 100644 --- a/apps/app/components/gantt-chart/blocks/index.tsx +++ b/apps/app/components/gantt-chart/blocks/index.tsx @@ -49,7 +49,10 @@ export const GanttChartBlocks: FC<{ width: `${block?.position?.width}px`, }} > - {blockRender({ ...block?.data })} + {blockRender({ + ...block?.data, + infoToggle: block?.infoToggle ? true : false, + })}
diff --git a/apps/app/components/issues/gantt-chart.tsx b/apps/app/components/issues/gantt-chart.tsx index 1330c2438..571583707 100644 --- a/apps/app/components/issues/gantt-chart.tsx +++ b/apps/app/components/issues/gantt-chart.tsx @@ -4,6 +4,8 @@ import Link from "next/link"; import { useRouter } from "next/router"; // components import { GanttChartRoot } from "components/gantt-chart"; +// ui +import { Tooltip } from "components/ui"; // hooks import useGanttChartIssues from "hooks/gantt-chart/issue-view"; @@ -37,9 +39,23 @@ export const IssueGanttChartView: FC = ({}) => { className="flex-shrink-0 w-[4px] h-full" style={{ backgroundColor: data?.state_detail?.color || "#858e96" }} /> -
- {data?.name} -
+ +
+ {data?.name} +
+
+ {data.infoToggle && ( + +
+ + info + +
+
+ )} ); @@ -51,17 +67,25 @@ export const IssueGanttChartView: FC = ({}) => { start_date: data?.start_date, target_date: data?.target_date, }; - - console.log("payload", payload); }; const blockFormat = (blocks: any) => blocks && blocks.length > 0 ? blocks.map((_block: any) => { - if (_block?.start_date && _block.target_date) console.log("_block", _block); + let startDate = new Date(_block.created_at); + let targetDate = new Date(_block.updated_at); + let infoToggle = true; + + if (_block?.start_date && _block.target_date) { + startDate = _block?.start_date; + targetDate = _block.target_date; + infoToggle = false; + } + return { - start_date: new Date(_block.created_at), - target_date: new Date(_block.updated_at), + start_date: new Date(startDate), + target_date: new Date(targetDate), + infoToggle: infoToggle, data: _block, }; }) diff --git a/apps/app/components/modules/gantt-chart.tsx b/apps/app/components/modules/gantt-chart.tsx index fa92964c1..e24e1dd9a 100644 --- a/apps/app/components/modules/gantt-chart.tsx +++ b/apps/app/components/modules/gantt-chart.tsx @@ -4,6 +4,8 @@ import Link from "next/link"; import { useRouter } from "next/router"; // components import { GanttChartRoot } from "components/gantt-chart"; +// ui +import { Tooltip } from "components/ui"; // hooks import useGanttChartModuleIssues from "hooks/gantt-chart/module-issues-view"; @@ -38,9 +40,23 @@ export const ModuleIssuesGanttChartView: FC = ({}) => { className="flex-shrink-0 w-[4px] h-full" style={{ backgroundColor: data?.state_detail?.color || "#858e96" }} /> -
- {data?.name} -
+ +
+ {data?.name} +
+
+ {data.infoToggle && ( + +
+ + info + +
+
+ )} ); @@ -59,10 +75,20 @@ export const ModuleIssuesGanttChartView: FC = ({}) => { const blockFormat = (blocks: any) => blocks && blocks.length > 0 ? blocks.map((_block: any) => { - if (_block?.start_date && _block.target_date) console.log("_block", _block); + let startDate = new Date(_block.created_at); + let targetDate = new Date(_block.updated_at); + let infoToggle = true; + + if (_block?.start_date && _block.target_date) { + startDate = _block?.start_date; + targetDate = _block.target_date; + infoToggle = false; + } + return { - start_date: new Date(_block.created_at), - target_date: new Date(_block.updated_at), + start_date: new Date(startDate), + target_date: new Date(targetDate), + infoToggle: infoToggle, data: _block, }; }) diff --git a/apps/app/components/modules/modules-list-gantt-chart.tsx b/apps/app/components/modules/modules-list-gantt-chart.tsx index cb1c7bc07..0f109ba6a 100644 --- a/apps/app/components/modules/modules-list-gantt-chart.tsx +++ b/apps/app/components/modules/modules-list-gantt-chart.tsx @@ -4,6 +4,8 @@ import Link from "next/link"; import { useRouter } from "next/router"; // components import { GanttChartRoot } from "components/gantt-chart"; +// ui +import { Tooltip } from "components/ui"; // types import { IModule } from "types"; // constants @@ -38,9 +40,11 @@ export const ModulesListGanttChartView: FC = ({ modules }) => { className="flex-shrink-0 w-[4px] h-full" style={{ backgroundColor: MODULE_STATUS.find((s) => s.value === data.status)?.color }} /> -
- {data?.name} -
+ +
+ {data?.name} +
+
); diff --git a/apps/app/components/views/gantt-chart.tsx b/apps/app/components/views/gantt-chart.tsx index dc81f70fa..a445331b2 100644 --- a/apps/app/components/views/gantt-chart.tsx +++ b/apps/app/components/views/gantt-chart.tsx @@ -4,6 +4,8 @@ import Link from "next/link"; import { useRouter } from "next/router"; // components import { GanttChartRoot } from "components/gantt-chart"; +// ui +import { Tooltip } from "components/ui"; // hooks import useGanttChartViewIssues from "hooks/gantt-chart/view-issues-view"; @@ -38,9 +40,23 @@ export const ViewIssuesGanttChartView: FC = ({}) => { className="flex-shrink-0 w-[4px] h-full" style={{ backgroundColor: data?.state_detail?.color || "#858e96" }} /> -
- {data?.name} -
+ +
+ {data?.name} +
+
+ {data.infoToggle && ( + +
+ + info + +
+
+ )} ); @@ -59,10 +75,20 @@ export const ViewIssuesGanttChartView: FC = ({}) => { const blockFormat = (blocks: any) => blocks && blocks.length > 0 ? blocks.map((_block: any) => { - if (_block?.start_date && _block.target_date) console.log("_block", _block); + let startDate = new Date(_block.created_at); + let targetDate = new Date(_block.updated_at); + let infoToggle = true; + + if (_block?.start_date && _block.target_date) { + startDate = _block?.start_date; + targetDate = _block.target_date; + infoToggle = false; + } + return { - start_date: new Date(_block.created_at), - target_date: new Date(_block.updated_at), + start_date: new Date(startDate), + target_date: new Date(targetDate), + infoToggle: infoToggle, data: _block, }; })