π₯π₯π₯ Open-source Jira, Linear, Monday, and ClickUp alternative. Plane is a modern project management platform to manage tasks, sprints, docs, and triage.
TypeScript boardsbug-trackerdjangodockerganttissue-trackerjirajira-alternativekanbanlinearpostgresqlproduct-managementproject-managementproject-planningpythonreactredistypesciptvitework-management
dev: show all issues on the gantt chart (#3487)
Aaryan Khandelwal9debd81a503e
diff --git a/packages/types/src/view-props.d.ts b/packages/types/src/view-props.d.tsindex 7f1d49632f..61cc7081b2 100644--- a/packages/types/src/view-props.d.ts+++ b/packages/types/src/view-props.d.ts@@ -64,8 +64,7 @@ export type TIssueParams =| "order_by"| "type"| "sub_issue"- | "show_empty_groups"- | "start_target_date";+ | "show_empty_groups";export type TCalendarLayouts = "month" | "week";@@ -93,7 +92,6 @@ export interface IIssueDisplayFilterOptions {layout?: TIssueLayouts;order_by?: TIssueOrderByOptions;show_empty_groups?: boolean;- start_target_date?: boolean;sub_issue?: boolean;type?: TIssueTypeFilters;}diff --git a/web/components/core/activity.tsx b/web/components/core/activity.tsxindex b5a666774a..72a67883ef 100644--- a/web/components/core/activity.tsx+++ b/web/components/core/activity.tsx@@ -40,9 +40,9 @@ export const IssueLink = ({ activity }: { activity: IIssueActivity }) => {}`}`}target={activity.issue === null ? "_self" : "_blank"}rel={activity.issue === null ? "" : "noopener noreferrer"}- className="inline-flex items-center gap-1 font-medium text-custom-text-100 hover:underline whitespace-nowrap"+ className="inline-flex items-center gap-1 font-medium text-custom-text-100 hover:underline">- {`${activity.project_detail.identifier}-${activity.issue_detail.sequence_id}`}{" "}+ <span className="whitespace-nowrap">{`${activity.project_detail.identifier}-${activity.issue_detail.sequence_id}`}</span>{" "}<span className="font-normal">{activity.issue_detail?.name}</span></a>) : (@@ -267,7 +267,7 @@ const activityDetails: {<span className="flex-shrink truncate font-medium text-custom-text-100">{activity.new_value}</span></span>{showIssue && (- <span>+ <span className="">{" "}to <IssueLink activity={activity} /></span>diff --git a/web/components/dashboard/widgets/overview-stats.tsx b/web/components/dashboard/widgets/overview-stats.tsxindex a4b9c678d7..3af080dc37 100644--- a/web/components/dashboard/widgets/overview-stats.tsx+++ b/web/components/dashboard/widgets/overview-stats.tsx@@ -86,7 +86,7 @@ export const OverviewStatsWidget: React.FC<WidgetProps> = observer((props) => {)}><h5 className="font-semibold text-xl">{stat.count}</h5>- <p className="text-custom-text-300">{stat.title}</p>+ <p className="text-custom-text-300 text-sm xl:text-base">{stat.title}</p></Link></div>);diff --git a/web/components/dnd/StrictModeDroppable.tsx b/web/components/dnd/StrictModeDroppable.tsxdeleted file mode 100644index 9feba79b21..0000000000--- a/web/components/dnd/StrictModeDroppable.tsx+++ /dev/null@@ -1,23 +0,0 @@-import React, { useState, useEffect } from "react";--// react beautiful dnd-import { Droppable, DroppableProps } from "@hello-pangea/dnd";--const StrictModeDroppable = ({ children, ...props }: DroppableProps) => {- const [enabled, setEnabled] = useState(false);-- useEffect(() => {- const animation = requestAnimationFrame(() => setEnabled(true));-- return () => {- cancelAnimationFrame(animation);- setEnabled(false);- };- }, []);-- if (!enabled) return null;-- return <Droppable {...props}>{children}</Droppable>;-};--export default StrictModeDroppable;diff --git a/web/components/gantt-chart/blocks/blocks-display.tsx b/web/components/gantt-chart/blocks/blocks-display.tsxindex 0c368090d1..02d2eb8657 100644--- a/web/components/gantt-chart/blocks/blocks-display.tsx+++ b/web/components/gantt-chart/blocks/blocks-display.tsx@@ -2,7 +2,7 @@ import { FC } from "react";// hooksimport { useChart } from "../hooks";// helpers-import { ChartDraggable } from "../helpers/draggable";+import { ChartAddBlock, ChartDraggable } from "components/gantt-chart";import { renderFormattedPayloadDate } from "helpers/date-time.helper";// typesimport { IBlockUpdateData, IGanttBlock } from "../types";@@ -15,6 +15,7 @@ export type GanttChartBlocksProps = {enableBlockLeftResize: boolean;enableBlockRightResize: boolean;enableBlockMove: boolean;+ showAllBlocks: boolean;};export const GanttChartBlocks: FC<GanttChartBlocksProps> = (props) => {@@ -26,6 +27,7 @@ export const GanttChartBlocks: FC<GanttChartBlocksProps> = (props) => {enableBlockLeftResize,enableBlockRightResize,enableBlockMove,+ showAllBlocks,} = props;const { activeBlock, dispatch } = useChart();@@ -45,6 +47,8 @@ export const GanttChartBlocks: FC<GanttChartBlocksProps> = (props) => {totalBlockShifts: number,dragDirection: "left" | "right" | "move") => {+ if (!block.start_date || !block.target_date) return;+const originalStartDate = new Date(block.start_date);const updatedStartDate = new Date(originalStartDate);@@ -75,27 +79,31 @@ export const GanttChartBlocks: FC<GanttChartBlocksProps> = (props) => {>{blocks &&blocks.length > 0 &&- blocks.map(- (block) =>- block.start_date &&- block.target_date && (- <div- key={`block-${block.id}`}- className={`h-11 ${activeBlock?.id === block.id ? "bg-custom-background-80" : ""}`}- onMouseEnter={() => updateActiveBlock(block)}- onMouseLeave={() => updateActiveBlock(null)}- >- <ChartDraggable- block={block}- blockToRender={blockToRender}- handleBlock={(...args) => handleChartBlockPosition(block, ...args)}- enableBlockLeftResize={enableBlockLeftResize}- enableBlockRightResize={enableBlockRightResize}- enableBlockMove={enableBlockMove}- />- </div>- )- )}+ blocks.map((block) => {+ // hide the block if it doesn't have start and target dates and showAllBlocks is false+ if (!showAllBlocks && !(block.start_date && block.target_date)) return;++ const isBlockVisibleOnChart = block.start_date && block.target_date;++ return (+ <div+ key={`block-${block.id}`}+ className={`h-11 ${activeBlock?.id === block.id ? "bg-custom-background-80" : ""}`}+ onMouseEnter={() => updateActiveBlock(block)}+ onMouseLeave={() => updateActiveBlock(null)}+ >+ {!isBlockVisibleOnChart && <ChartAddBlock block={block} blockUpdateHandler={blockUpdateHandler} />}+ <ChartDraggable+ block={block}+ blockToRender={blockToRender}+ handleBlock={(...args) => handleChartBlockPosition(block, ...args)}+ enableBlockLeftResize={enableBlockLeftResize}+ enableBlockRightResize={enableBlockRightResize}+ enableBlockMove={enableBlockMove}+ />+ </div>+ );+ })}</div>);};diff --git a/web/components/gantt-chart/chart/index.tsx b/web/components/gantt-chart/chart/index.tsxindex 734d85efb2..4592bfb5b1 100644--- a/web/components/gantt-chart/chart/index.tsx+++ b/web/components/gantt-chart/chart/index.tsx@@ -46,22 +46,25 @@ type ChartViewRootProps = {enableBlockMove: boolean;enableReorder: boolean;bottomSpacing: boolean;+ showAllBlocks: boolean;};-export const ChartViewRoot: FC<ChartViewRootProps> = ({- border,- title,- blocks = null,- loaderTitle,- blockUpdateHandler,- sidebarToRender,- blockToRender,- enableBlockLeftResize,- enableBlockRightResize,- enableBlockMove,- enableReorder,- bottomSpacing,-}) => {+export const ChartViewRoot: FC<ChartViewRootProps> = (props) => {+ const {+ border,+ title,+ blocks = null,+ loaderTitle,+ blockUpdateHandler,+ sidebarToRender,+ blockToRender,+ enableBlockLeftResize,+ enableBlockRightResize,+ enableBlockMove,+ enableReorder,+ bottomSpacing,+ showAllBlocks,+ } = props;// statesconst [itemsContainerWidth, setItemsContainerWidth] = useState<number>(0);const [fullScreenMode, setFullScreenMode] = useState<boolean>(false);@@ -311,6 +314,7 @@ export const ChartViewRoot: FC<ChartViewRootProps> = ({enableBlockLeftResize={enableBlockLeftResize}enableBlockRightResize={enableBlockRightResize}enableBlockMove={enableBlockMove}+ showAllBlocks={showAllBlocks}/>)}</div>diff --git a/web/components/gantt-chart/chart/month.tsx b/web/components/gantt-chart/chart/month.tsxindex 0bc6b7460f..0b7a4c452d 100644--- a/web/components/gantt-chart/chart/month.tsx+++ b/web/components/gantt-chart/chart/month.tsx@@ -1,5 +1,4 @@import { FC } from "react";-// hooksimport { useChart } from "../hooks";// typesdiff --git a/web/components/gantt-chart/helpers/add-block.tsx b/web/components/gantt-chart/helpers/add-block.tsxnew file mode 100644index 0000000000..bfeddffa24--- /dev/null+++ b/web/components/gantt-chart/helpers/add-block.tsx@@ -0,0 +1,91 @@+import { useEffect, useRef, useState } from "react";+import { addDays } from "date-fns";+import { Plus } from "lucide-react";+// hooks+import { useChart } from "../hooks";+// ui+import { Tooltip } from "@plane/ui";+// helpers+import { renderFormattedDate, renderFormattedPayloadDate } from "helpers/date-time.helper";+// types+import { IBlockUpdateData, IGanttBlock } from "../types";++type Props = {+ block: IGanttBlock;+ blockUpdateHandler: (block: any, payload: IBlockUpdateData) => void;+};++export const ChartAddBlock: React.FC<Props> = (props) => {+ const { block, blockUpdateHandler } = props;+ // states+ const [isButtonVisible, setIsButtonVisible] = useState(false);+ const [buttonXPosition, setButtonXPosition] = useState(0);+ const [buttonStartDate, setButtonStartDate] = useState<Date | null>(null);+ // refs+ const containerRef = useRef<HTMLDivElement>(null);+ // chart hook+ const { currentViewData } = useChart();++ const handleButtonClick = () => {+ if (!currentViewData) return;++ const { startDate: chartStartDate, width } = currentViewData.data;+ const columnNumber = buttonXPosition / width;++ const startDate = addDays(chartStartDate, columnNumber);+ const endDate = addDays(startDate, 1);++ blockUpdateHandler(block.data, {+ start_date: renderFormattedPayloadDate(startDate) ?? undefined,+ target_date: renderFormattedPayloadDate(endDate) ?? undefined,+ });+ };++ useEffect(() => {+ const container = containerRef.current;++ if (!container) return;++ const handleMouseMove = (e: MouseEvent) => {+ if (!currentViewData) return;++ setButtonXPosition(e.offsetX);++ const { startDate: chartStartDate, width } = currentViewData.data;+ const columnNumber = buttonXPosition / width;++ const startDate = addDays(chartStartDate, columnNumber);+ setButtonStartDate(startDate);+ };++ container.addEventListener("mousemove", handleMouseMove);++ return () => {+ container?.removeEventListener("mousemove", handleMouseMove);+ };+ }, [buttonXPosition, currentViewData]);++ return (+ <div+ className="relative h-full w-full"+ onMouseEnter={() => setIsButtonVisible(true)}+ onMouseLeave={() => setIsButtonVisible(false)}+ >+ <div ref={containerRef} className="h-full w-full" />+ {isButtonVisible && (+ <Tooltip tooltipContent={buttonStartDate && renderFormattedDate(buttonStartDate)}>+ <button+ type="button"+ className="absolute top-1/2 -translate-x-1/2 -translate-y-1/2 h-8 w-8 bg-custom-background-80 p-1.5 rounded border border-custom-border-300 grid place-items-center text-custom-text-200 hover:text-custom-text-100"+ style={{+ marginLeft: `${buttonXPosition}px`,+ }}+ onClick={handleButtonClick}+ >+ <Plus className="h-3.5 w-3.5" />+ </button>+ </Tooltip>+ )}+ </div>+ );+};diff --git a/web/components/gantt-chart/helpers/block-structure.tsx b/web/components/gantt-chart/helpers/block-structure.tsxindex bc59624a5d..a7071ba282 100644--- a/web/components/gantt-chart/helpers/block-structure.tsx+++ b/web/components/gantt-chart/helpers/block-structure.tsx@@ -3,14 +3,11 @@ import { TIssue } from "@plane/types";import { IGanttBlock } from "components/gantt-chart";export const renderIssueBlocksStructure = (blocks: TIssue[]): IGanttBlock[] =>- blocks && blocks.length > 0- ? blocks- .filter((b) => new Date(b?.start_date ?? "") <= new Date(b?.target_date ?? ""))- .map((block) => ({- data: block,- id: block.id,- sort_order: block.sort_order,- start_date: new Date(block.start_date ?? ""),- target_date: new Date(block.target_date ?? ""),- }))- : [];+ blocks &&+ blocks.map((block) => ({+ data: block,+ id: block.id,+ sort_order: block.sort_order,+ start_date: block.start_date ? new Date(block.start_date) : null,+ target_date: block.target_date ? new Date(block.target_date) : null,+ }));diff --git a/web/components/gantt-chart/helpers/draggable.tsx b/web/components/gantt-chart/helpers/draggable.tsxindex 8f4f23566d..d2c4448bbc 100644--- a/web/components/gantt-chart/helpers/draggable.tsx+++ b/web/components/gantt-chart/helpers/draggable.tsx@@ -1,6 +1,4 @@import React, { useEffect, useRef, useState } from "react";--// iconsimport { ArrowLeft, ArrowRight } from "lucide-react";// hooksimport { useChart } from "../hooks";@@ -16,23 +14,17 @@ type Props = {enableBlockMove: boolean;};-export const ChartDraggable: React.FC<Props> = ({- block,- blockToRender,- handleBlock,- enableBlockLeftResize,- enableBlockRightResize,- enableBlockMove,-}) => {+export const ChartDraggable: React.FC<Props> = (props) => {+ const { block, blockToRender, handleBlock, enableBlockLeftResize, enableBlockRightResize, enableBlockMove } = props;+ // statesconst [isLeftResizing, setIsLeftResizing] = useState(false);const [isRightResizing, setIsRightResizing] = useState(false);const [isMoving, setIsMoving] = useState(false);const [posFromLeft, setPosFromLeft] = useState<number | null>(null);-+ // refsconst resizableRef = useRef<HTMLDivElement>(null);-+ // chart hookconst { currentViewData, scrollLeft } = useChart();-// check if cursor reaches either end while resizing/draggingconst checkScrollEnd = (e: MouseEvent): number => {const SCROLL_THRESHOLD = 70;@@ -68,7 +60,6 @@ export const ChartDraggable: React.FC<Props> = ({return delWidth;};-// handle block resize from the left endconst handleBlockLeftResize = (e: React.MouseEvent<HTMLDivElement, MouseEvent>) => {if (!currentViewData || !resizableRef.current || !block.position) return;@@ -120,7 +111,6 @@ export const ChartDraggable: React.FC<Props> = ({document.addEventListener("mousemove", handleMouseMove);document.addEventListener("mouseup", handleMouseUp);};-// handle block resize from the right endconst handleBlockRightResize = (e: React.MouseEvent<HTMLDivElement, MouseEvent>) => {if (!currentViewData || !resizableRef.current || !block.position) return;@@ -163,7 +153,6 @@ export const ChartDraggable: React.FC<Props> = ({document.addEventListener("mousemove", handleMouseMove);document.addEventListener("mouseup", handleMouseUp);};-// handle block x-axis moveconst handleBlockMove = (e: React.MouseEvent<HTMLDivElement, MouseEvent>) => {if (!enableBlockMove || !currentViewData || !resizableRef.current || !block.position) return;@@ -210,7 +199,6 @@ export const ChartDraggable: React.FC<Props> = ({document.addEventListener("mousemove", handleMouseMove);document.addEventListener("mouseup", handleMouseUp);};-// scroll to a hidden blockconst handleScrollToBlock = () => {const scrollContainer = document.querySelector("#scroll-container") as HTMLElement;@@ -220,7 +208,6 @@ export const ChartDraggable: React.FC<Props> = ({// update container's scroll position to the block's positionscrollContainer.scrollLeft = block.position.marginLeft - 4;};-// update block position from viewport's left end on scrolluseEffect(() => {const block = resizableRef.current;@@ -229,7 +216,6 @@ export const ChartDraggable: React.FC<Props> = ({setPosFromLeft(block.getBoundingClientRect().left);}, [scrollLeft]);-// check if block is hidden on either sideconst isBlockHiddenOnLeft =block.position?.marginLeft &&diff --git a/web/components/gantt-chart/helpers/index.ts b/web/components/gantt-chart/helpers/index.tsindex c4c919ec0f..1b51dc3747 100644--- a/web/components/gantt-chart/helpers/index.ts+++ b/web/components/gantt-chart/helpers/index.ts@@ -1 +1,3 @@+export * from "./add-block";export * from "./block-structure";+export * from "./draggable";diff --git a/web/components/gantt-chart/root.tsx b/web/components/gantt-chart/root.tsxindex 10c00a3632..7673da88e7 100644--- a/web/components/gantt-chart/root.tsx+++ b/web/components/gantt-chart/root.tsx@@ -19,36 +19,43 @@ type GanttChartRootProps = {enableBlockMove?: boolean;enableReorder?: boolean;bottomSpacing?: boolean;+ showAllBlocks?: boolean;};-export const GanttChartRoot: FC<GanttChartRootProps> = ({- border = true,- title,- blocks,- loaderTitle = "blocks",- blockUpdateHandler,- sidebarToRender,- blockToRender,- enableBlockLeftResize = true,- enableBlockRightResize = true,- enableBlockMove = true,- enableReorder = true,- bottomSpacing = false,-}) => (- <ChartContextProvider>- <ChartViewRoot- border={border}- title={title}- blocks={blocks}- loaderTitle={loaderTitle}- blockUpdateHandler={blockUpdateHandler}- sidebarToRender={sidebarToRender}- blockToRender={blockToRender}- enableBlockLeftResize={enableBlockLeftResize}- enableBlockRightResize={enableBlockRightResize}- enableBlockMove={enableBlockMove}- enableReorder={enableReorder}- bottomSpacing={bottomSpacing}- />- </ChartContextProvider>-);+export const GanttChartRoot: FC<GanttChartRootProps> = (props) => {+ const {+ border = true,+ title,+ blocks,+ loaderTitle = "blocks",+ blockUpdateHandler,+ sidebarToRender,+ blockToRender,+ enableBlockLeftResize = true,+ enableBlockRightResize = true,+ enableBlockMove = true,+ enableReorder = true,+ bottomSpacing = false,+ showAllBlocks = false,+ } = props;++ return (+ <ChartContextProvider>+ <ChartViewRoot+ border={border}+ title={title}+ blocks={blocks}+ loaderTitle={loaderTitle}+ blockUpdateHandler={blockUpdateHandler}+ sidebarToRender={sidebarToRender}+ blockToRender={blockToRender}+ enableBlockLeftResize={enableBlockLeftResize}+ enableBlockRightResize={enableBlockRightResize}+ enableBlockMove={enableBlockMove}+ enableReorder={enableReorder}+ bottomSpacing={bottomSpacing}+ showAllBlocks={showAllBlocks}+ />+ </ChartContextProvider>+ );+};diff --git a/web/components/gantt-chart/sidebar/cycle-sidebar.tsx b/web/components/gantt-chart/sidebar/cycle-sidebar.tsxindex b7cb418375..1af1529c27 100644--- a/web/components/gantt-chart/sidebar/cycle-sidebar.tsx+++ b/web/components/gantt-chart/sidebar/cycle-sidebar.tsx@@ -1,6 +1,5 @@import { useRouter } from "next/router";-import { DragDropContext, Draggable, DropResult } from "@hello-pangea/dnd";-import StrictModeDroppable from "components/dnd/StrictModeDroppable";+import { DragDropContext, Draggable, DropResult, Droppable } from "@hello-pangea/dnd";import { MoreVertical } from "lucide-react";// hooksimport { useChart } from "components/gantt-chart/hooks";@@ -83,7 +82,7 @@ export const CycleGanttSidebar: React.FC<Props> = (props) => {return (<DragDropContext onDragEnd={handleOrderChange}>- <StrictModeDroppable droppableId="gantt-sidebar">+ <Droppable droppableId="gantt-sidebar">{(droppableProvided) => (<divid={`gantt-sidebar-${cycleId}`}@@ -153,7 +152,7 @@ export const CycleGanttSidebar: React.FC<Props> = (props) => {</></div>)}- </StrictModeDroppable>+ </Droppable></DragDropContext>);};diff --git a/web/components/gantt-chart/sidebar/module-sidebar.tsx b/web/components/gantt-chart/sidebar/module-sidebar.tsxindex 8dc437269a..30f146dc55 100644--- a/web/components/gantt-chart/sidebar/module-sidebar.tsx+++ b/web/components/gantt-chart/sidebar/module-sidebar.tsx@@ -1,6 +1,5 @@import { useRouter } from "next/router";-import { DragDropContext, Draggable, DropResult } from "@hello-pangea/dnd";-import StrictModeDroppable from "components/dnd/StrictModeDroppable";+import { DragDropContext, Draggable, Droppable, DropResult } from "@hello-pangea/dnd";import { MoreVertical } from "lucide-react";// hooksimport { useChart } from "components/gantt-chart/hooks";@@ -83,7 +82,7 @@ export const ModuleGanttSidebar: React.FC<Props> = (props) => {return (<DragDropContext onDragEnd={handleOrderChange}>- <StrictModeDroppable droppableId="gantt-sidebar">+ <Droppable droppableId="gantt-sidebar">{(droppableProvided) => (<divid={`gantt-sidebar-${cycleId}`}@@ -153,7 +152,7 @@ export const ModuleGanttSidebar: React.FC<Props> = (props) => {</></div>)}- </StrictModeDroppable>+ </Droppable></DragDropContext>);};diff --git a/web/components/gantt-chart/sidebar/project-view-sidebar.tsx b/web/components/gantt-chart/sidebar/project-view-sidebar.tsxindex b591f3b733..da7382859f 100644--- a/web/components/gantt-chart/sidebar/project-view-sidebar.tsx+++ b/web/components/gantt-chart/sidebar/project-view-sidebar.tsx@@ -1,6 +1,5 @@import { useRouter } from "next/router";-import { DragDropContext, Draggable, DropResult } from "@hello-pangea/dnd";-import StrictModeDroppable from "components/dnd/StrictModeDroppable";+import { DragDropContext, Draggable, Droppable, DropResult } from "@hello-pangea/dnd";import { MoreVertical } from "lucide-react";// hooksimport { useChart } from "components/gantt-chart/hooks";@@ -84,7 +83,7 @@ export const ProjectViewGanttSidebar: React.FC<Props> = (props) => {return (<DragDropContext onDragEnd={handleOrderChange}>- <StrictModeDroppable droppableId="gantt-sidebar">+ <Droppable droppableId="gantt-sidebar">{(droppableProvided) => (<divid={`gantt-sidebar-${cycleId}`}@@ -154,7 +153,7 @@ export const ProjectViewGanttSidebar: React.FC<Props> = (props) => {</></div>)}- </StrictModeDroppable>+ </Droppable></DragDropContext>);};diff --git a/web/components/gantt-chart/sidebar/sidebar.tsx b/web/components/gantt-chart/sidebar/sidebar.tsxindex 88a138a1be..062b764514 100644--- a/web/components/gantt-chart/sidebar/sidebar.tsx+++ b/web/components/gantt-chart/sidebar/sidebar.tsx@@ -1,6 +1,5 @@import { useRouter } from "next/router";-import { DragDropContext, Draggable, DropResult } from "@hello-pangea/dnd";-import StrictModeDroppable from "components/dnd/StrictModeDroppable";+import { DragDropContext, Draggable, Droppable, DropResult } from "@hello-pangea/dnd";import { MoreVertical } from "lucide-react";// hooksimport { useChart } from "components/gantt-chart/hooks";@@ -27,10 +26,10 @@ type Props = {) => Promise<TIssue | undefined>;viewId?: string;disableIssueCreation?: boolean;+ showAllBlocks?: boolean;};export const IssueGanttSidebar: React.FC<Props> = (props) => {- // eslint-disable-next-line @typescript-eslint/no-unused-varsconst {blockUpdateHandler,blocks,@@ -39,6 +38,7 @@ export const IssueGanttSidebar: React.FC<Props> = (props) => {quickAddCallback,viewId,disableIssueCreation,+ showAllBlocks = false,} = props;const router = useRouter();@@ -100,7 +100,7 @@ export const IssueGanttSidebar: React.FC<Props> = (props) => {return (<DragDropContext onDragEnd={handleOrderChange}>- <StrictModeDroppable droppableId="gantt-sidebar">+ <Droppable droppableId="gantt-sidebar">{(droppableProvided) => (<divid={`gantt-sidebar-${cycleId}`}@@ -111,7 +111,15 @@ export const IssueGanttSidebar: React.FC<Props> = (props) => {<>{blocks ? (blocks.map((block, index) => {- const duration = findTotalDaysInRange(block.start_date ?? "", block.target_date ?? "");+ const isBlockVisibleOnSidebar = block.start_date && block.target_date;++ // hide the block if it doesn't have start and target dates and showAllBlocks is false+ if (!showAllBlocks && !isBlockVisibleOnSidebar) return;++ const duration =+ !block.start_date || !block.target_date+ ? null+ : findTotalDaysInRange(block.start_date, block.target_date);return (<Draggable@@ -149,7 +157,11 @@ export const IssueGanttSidebar: React.FC<Props> = (props) => {<IssueGanttSidebarBlock data={block.data} /></div><div className="flex-shrink-0 text-sm text-custom-text-200">- {duration} day{duration > 1 ? "s" : ""}+ {duration && (+ <span>+ {duration} day{duration > 1 ? "s" : ""}+ </span>+ )}</div></div></div>@@ -173,7 +185,7 @@ export const IssueGanttSidebar: React.FC<Props> = (props) => {)}</div>)}- </StrictModeDroppable>+ </Droppable></DragDropContext>);};diff --git a/web/components/gantt-chart/types/index.ts b/web/components/gantt-chart/types/index.tsindex 9cab40f5cc..1360f9f45a 100644--- a/web/components/gantt-chart/types/index.ts+++ b/web/components/gantt-chart/types/index.ts@@ -13,8 +13,8 @@ export interface IGanttBlock {width: number;};sort_order: number;- start_date: Date;- target_date: Date;+ start_date: Date | null;+ target_date: Date | null;}export interface IBlockUpdateData {diff --git a/web/components/gantt-chart/views/month-view.ts b/web/components/gantt-chart/views/month-view.tsindex fc145d69c3..13d054da1a 100644--- a/web/components/gantt-chart/views/month-view.ts+++ b/web/components/gantt-chart/views/month-view.ts@@ -167,6 +167,8 @@ export const getMonthChartItemPositionWidthInMonth = (chartData: ChartDataType,const { startDate } = chartData.data;const { start_date: itemStartDate, target_date: itemTargetDate } = itemData;+ if (!itemStartDate || !itemTargetDate) return null;+startDate.setHours(0, 0, 0, 0);itemStartDate.setHours(0, 0, 0, 0);itemTargetDate.setHours(0, 0, 0, 0);diff --git a/web/components/issues/issue-layouts/gantt/base-gantt-root.tsx b/web/components/issues/issue-layouts/gantt/base-gantt-root.tsxindex 73802886ea..601205b5c8 100644--- a/web/components/issues/issue-layouts/gantt/base-gantt-root.tsx+++ b/web/components/issues/issue-layouts/gantt/base-gantt-root.tsx@@ -13,11 +13,12 @@ import {} from "components/gantt-chart";// typesimport { TIssue, TUnGroupedIssues } from "@plane/types";-import { EUserProjectRoles } from "constants/project";import { ICycleIssues, ICycleIssuesFilter } from "store/issue/cycle";import { IModuleIssues, IModuleIssuesFilter } from "store/issue/module";import { IProjectIssues, IProjectIssuesFilter } from "store/issue/project";import { IProjectViewIssues, IProjectViewIssuesFilter } from "store/issue/project-views";+// constants+import { EUserProjectRoles } from "constants/project";import { EIssueActions } from "../types";interface IBaseGanttRoot {@@ -76,12 +77,14 @@ export const BaseGanttRoot: React.FC<IBaseGanttRoot> = observer((props: IBaseGanviewId={viewId}enableQuickIssueCreatedisableIssueCreation={!enableIssueCreation || !isAllowed}+ showAllBlocks/>)}enableBlockLeftResize={isAllowed}enableBlockRightResize={isAllowed}enableBlockMove={isAllowed}enableReorder={appliedDisplayFilters?.order_by === "sort_order" && isAllowed}+ showAllBlocks/></div></>diff --git a/web/constants/fetch-keys.ts b/web/constants/fetch-keys.tsindex ec88c8c877..86386e9683 100644--- a/web/constants/fetch-keys.ts+++ b/web/constants/fetch-keys.ts@@ -13,7 +13,6 @@ const paramsToKey = (params: any) => {start_date,target_date,sub_issue,- start_target_date,project,layout,subscriber,@@ -28,7 +27,6 @@ const paramsToKey = (params: any) => {let createdByKey = created_by ? created_by.split(",") : [];let labelsKey = labels ? labels.split(",") : [];let subscriberKey = subscriber ? subscriber.split(",") : [];- const startTargetDate = start_target_date ? `${start_target_date}`.toUpperCase() : "FALSE";const startDateKey = start_date ?? "";const targetDateKey = target_date ?? "";const type = params.type ? params.type.toUpperCase() : "NULL";@@ -47,7 +45,7 @@ const paramsToKey = (params: any) => {labelsKey = labelsKey.sort().join("_");subscriberKey = subscriberKey.sort().join("_");- return `${layoutKey}_${projectKey}_${stateGroupKey}_${stateKey}_${priorityKey}_${assigneesKey}_${mentionsKey}_${createdByKey}_${type}_${groupBy}_${orderBy}_${labelsKey}_${startDateKey}_${targetDateKey}_${sub_issue}_${startTargetDate}_${subscriberKey}`;+ return `${layoutKey}_${projectKey}_${stateGroupKey}_${stateKey}_${priorityKey}_${assigneesKey}_${mentionsKey}_${createdByKey}_${type}_${groupBy}_${orderBy}_${labelsKey}_${startDateKey}_${targetDateKey}_${sub_issue}_${subscriberKey}`;};const myIssuesParamsToKey = (params: any) => {diff --git a/web/helpers/issue.helper.ts b/web/helpers/issue.helper.tsindex cdaa85883f..b0121320e2 100644--- a/web/helpers/issue.helper.ts+++ b/web/helpers/issue.helper.ts@@ -105,9 +105,6 @@ export const handleIssueQueryParamsByLayout = (});}- // add start_target_date query param for the gantt_chart layout- if (layout === "gantt_chart") queryParams.push("start_target_date");-return queryParams;};diff --git a/web/store/issue/archived/filter.store.ts b/web/store/issue/archived/filter.store.tsindex 9a9c91a378..d92453a307 100644--- a/web/store/issue/archived/filter.store.ts+++ b/web/store/issue/archived/filter.store.ts@@ -89,7 +89,6 @@ export class ArchivedIssuesFilter extends IssueFilterHelperStore implements IArcfilteredParams);- if (userFilters?.displayFilters?.layout === "gantt_chart") filteredRouteParams.start_target_date = true;if (userFilters?.displayFilters?.layout === "spreadsheet") filteredRouteParams.sub_issue = false;return filteredRouteParams;diff --git a/web/store/issue/cycle/filter.store.ts b/web/store/issue/cycle/filter.store.tsindex 27347536bb..dd81cfc0e6 100644--- a/web/store/issue/cycle/filter.store.ts+++ b/web/store/issue/cycle/filter.store.ts@@ -90,7 +90,6 @@ export class CycleIssuesFilter extends IssueFilterHelperStore implements ICycleIfilteredParams);- if (userFilters?.displayFilters?.layout === "gantt_chart") filteredRouteParams.start_target_date = true;if (userFilters?.displayFilters?.layout === "spreadsheet") filteredRouteParams.sub_issue = false;return filteredRouteParams;diff --git a/web/store/issue/draft/filter.store.ts b/web/store/issue/draft/filter.store.tsindex 7096040d55..8295c263dc 100644--- a/web/store/issue/draft/filter.store.ts+++ b/web/store/issue/draft/filter.store.ts@@ -89,7 +89,6 @@ export class DraftIssuesFilter extends IssueFilterHelperStore implements IDraftIfilteredParams);- if (userFilters?.displayFilters?.layout === "gantt_chart") filteredRouteParams.start_target_date = true;if (userFilters?.displayFilters?.layout === "spreadsheet") filteredRouteParams.sub_issue = false;return filteredRouteParams;diff --git a/web/store/issue/helpers/issue-filter-helper.store.ts b/web/store/issue/helpers/issue-filter-helper.store.tsindex ac89c5018e..6516b28fd3 100644--- a/web/store/issue/helpers/issue-filter-helper.store.ts+++ b/web/store/issue/helpers/issue-filter-helper.store.ts@@ -81,7 +81,6 @@ export class IssueFilterHelperStore implements IIssueFilterHelperStore {// display filterstype: displayFilters?.type || undefined,sub_issue: displayFilters?.sub_issue ?? true,- start_target_date: displayFilters?.start_target_date ?? true,};const issueFiltersParams: Partial<Record<TIssueParams, boolean | string>> = {};@@ -170,7 +169,6 @@ export class IssueFilterHelperStore implements IIssueFilterHelperStore {type: filters?.type || null,sub_issue: filters?.sub_issue || false,show_empty_groups: filters?.show_empty_groups || false,- start_target_date: filters?.start_target_date || false,};};diff --git a/web/store/issue/module/filter.store.ts b/web/store/issue/module/filter.store.tsindex 3c309cecda..e92027235f 100644--- a/web/store/issue/module/filter.store.ts+++ b/web/store/issue/module/filter.store.ts@@ -90,7 +90,6 @@ export class ModuleIssuesFilter extends IssueFilterHelperStore implements IModulfilteredParams);- if (userFilters?.displayFilters?.layout === "gantt_chart") filteredRouteParams.start_target_date = true;if (userFilters?.displayFilters?.layout === "spreadsheet") filteredRouteParams.sub_issue = false;return filteredRouteParams;diff --git a/web/store/issue/profile/filter.store.ts b/web/store/issue/profile/filter.store.tsindex a0f8028f84..563af5b014 100644--- a/web/store/issue/profile/filter.store.ts+++ b/web/store/issue/profile/filter.store.ts@@ -93,7 +93,6 @@ export class ProfileIssuesFilter extends IssueFilterHelperStore implements IProffilteredParams);- if (userFilters?.displayFilters?.layout === "gantt_chart") filteredRouteParams.start_target_date = true;if (userFilters?.displayFilters?.layout === "spreadsheet") filteredRouteParams.sub_issue = false;return filteredRouteParams;diff --git a/web/store/issue/project-views/filter.store.ts b/web/store/issue/project-views/filter.store.tsindex e0dae761ce..b3df3903b2 100644--- a/web/store/issue/project-views/filter.store.ts+++ b/web/store/issue/project-views/filter.store.ts@@ -90,7 +90,6 @@ export class ProjectViewIssuesFilter extends IssueFilterHelperStore implements IfilteredParams);- if (userFilters?.displayFilters?.layout === "gantt_chart") filteredRouteParams.start_target_date = true;if (userFilters?.displayFilters?.layout === "spreadsheet") filteredRouteParams.sub_issue = false;return filteredRouteParams;diff --git a/web/store/issue/project/filter.store.ts b/web/store/issue/project/filter.store.tsindex 392b7203f5..69393a3201 100644--- a/web/store/issue/project/filter.store.ts+++ b/web/store/issue/project/filter.store.ts@@ -89,7 +89,6 @@ export class ProjectIssuesFilter extends IssueFilterHelperStore implements IProjfilteredParams);- if (userFilters?.displayFilters?.layout === "gantt_chart") filteredRouteParams.start_target_date = true;if (userFilters?.displayFilters?.layout === "spreadsheet") filteredRouteParams.sub_issue = false;return filteredRouteParams;diff --git a/web/store/issue/workspace/filter.store.ts b/web/store/issue/workspace/filter.store.tsindex 82fb75ce25..92cc33a64f 100644--- a/web/store/issue/workspace/filter.store.ts+++ b/web/store/issue/workspace/filter.store.ts@@ -99,7 +99,6 @@ export class WorkspaceIssuesFilter extends IssueFilterHelperStore implements IWofilteredParams);- if (userFilters?.displayFilters?.layout === "gantt_chart") filteredRouteParams.start_target_date = true;if (userFilters?.displayFilters?.layout === "spreadsheet") filteredRouteParams.sub_issue = false;return filteredRouteParams;