diff --git a/packages/types/src/view-props.d.ts b/packages/types/src/view-props.d.ts index 7f1d49632fb..61cc7081b29 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.tsx index b5a666774af..72a67883ef1 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}`}{" "} + {`${activity.project_detail.identifier}-${activity.issue_detail.sequence_id}`}{" "} {activity.issue_detail?.name} ) : ( @@ -267,7 +267,7 @@ const activityDetails: { {activity.new_value} {showIssue && ( - + {" "} to diff --git a/web/components/dashboard/widgets/overview-stats.tsx b/web/components/dashboard/widgets/overview-stats.tsx index a4b9c678d7a..3af080dc374 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 = observer((props) => { )} >
{stat.count}
-

{stat.title}

+

{stat.title}

); diff --git a/web/components/dnd/StrictModeDroppable.tsx b/web/components/dnd/StrictModeDroppable.tsx deleted file mode 100644 index 9feba79b215..00000000000 --- 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 {children}; -}; - -export default StrictModeDroppable; diff --git a/web/components/gantt-chart/blocks/blocks-display.tsx b/web/components/gantt-chart/blocks/blocks-display.tsx index 0c368090d11..02d2eb86573 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"; // hooks import { useChart } from "../hooks"; // helpers -import { ChartDraggable } from "../helpers/draggable"; +import { ChartAddBlock, ChartDraggable } from "components/gantt-chart"; import { renderFormattedPayloadDate } from "helpers/date-time.helper"; // types import { IBlockUpdateData, IGanttBlock } from "../types"; @@ -15,6 +15,7 @@ export type GanttChartBlocksProps = { enableBlockLeftResize: boolean; enableBlockRightResize: boolean; enableBlockMove: boolean; + showAllBlocks: boolean; }; export const GanttChartBlocks: FC = (props) => { @@ -26,6 +27,7 @@ export const GanttChartBlocks: FC = (props) => { enableBlockLeftResize, enableBlockRightResize, enableBlockMove, + showAllBlocks, } = props; const { activeBlock, dispatch } = useChart(); @@ -45,6 +47,8 @@ export const GanttChartBlocks: FC = (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 = (props) => { > {blocks && blocks.length > 0 && - blocks.map( - (block) => - block.start_date && - block.target_date && ( -
updateActiveBlock(block)} - onMouseLeave={() => updateActiveBlock(null)} - > - handleChartBlockPosition(block, ...args)} - enableBlockLeftResize={enableBlockLeftResize} - enableBlockRightResize={enableBlockRightResize} - enableBlockMove={enableBlockMove} - /> -
- ) - )} + 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 ( +
updateActiveBlock(block)} + onMouseLeave={() => updateActiveBlock(null)} + > + {!isBlockVisibleOnChart && } + handleChartBlockPosition(block, ...args)} + enableBlockLeftResize={enableBlockLeftResize} + enableBlockRightResize={enableBlockRightResize} + enableBlockMove={enableBlockMove} + /> +
+ ); + })} ); }; diff --git a/web/components/gantt-chart/chart/index.tsx b/web/components/gantt-chart/chart/index.tsx index 734d85efb29..4592bfb5b1b 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 = ({ - border, - title, - blocks = null, - loaderTitle, - blockUpdateHandler, - sidebarToRender, - blockToRender, - enableBlockLeftResize, - enableBlockRightResize, - enableBlockMove, - enableReorder, - bottomSpacing, -}) => { +export const ChartViewRoot: FC = (props) => { + const { + border, + title, + blocks = null, + loaderTitle, + blockUpdateHandler, + sidebarToRender, + blockToRender, + enableBlockLeftResize, + enableBlockRightResize, + enableBlockMove, + enableReorder, + bottomSpacing, + showAllBlocks, + } = props; // states const [itemsContainerWidth, setItemsContainerWidth] = useState(0); const [fullScreenMode, setFullScreenMode] = useState(false); @@ -311,6 +314,7 @@ export const ChartViewRoot: FC = ({ enableBlockLeftResize={enableBlockLeftResize} enableBlockRightResize={enableBlockRightResize} enableBlockMove={enableBlockMove} + showAllBlocks={showAllBlocks} /> )} diff --git a/web/components/gantt-chart/chart/month.tsx b/web/components/gantt-chart/chart/month.tsx index 0bc6b7460fa..0b7a4c452dc 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"; - // hooks import { useChart } from "../hooks"; // types diff --git a/web/components/gantt-chart/helpers/add-block.tsx b/web/components/gantt-chart/helpers/add-block.tsx new file mode 100644 index 00000000000..bfeddffa243 --- /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) => { + const { block, blockUpdateHandler } = props; + // states + const [isButtonVisible, setIsButtonVisible] = useState(false); + const [buttonXPosition, setButtonXPosition] = useState(0); + const [buttonStartDate, setButtonStartDate] = useState(null); + // refs + const containerRef = useRef(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 ( +
setIsButtonVisible(true)} + onMouseLeave={() => setIsButtonVisible(false)} + > +
+ {isButtonVisible && ( + + + + )} +
+ ); +}; diff --git a/web/components/gantt-chart/helpers/block-structure.tsx b/web/components/gantt-chart/helpers/block-structure.tsx index bc59624a5dc..a7071ba282f 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.tsx index 8f4f23566dd..d2c4448bbcc 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"; - -// icons import { ArrowLeft, ArrowRight } from "lucide-react"; // hooks import { useChart } from "../hooks"; @@ -16,23 +14,17 @@ type Props = { enableBlockMove: boolean; }; -export const ChartDraggable: React.FC = ({ - block, - blockToRender, - handleBlock, - enableBlockLeftResize, - enableBlockRightResize, - enableBlockMove, -}) => { +export const ChartDraggable: React.FC = (props) => { + const { block, blockToRender, handleBlock, enableBlockLeftResize, enableBlockRightResize, enableBlockMove } = props; + // states const [isLeftResizing, setIsLeftResizing] = useState(false); const [isRightResizing, setIsRightResizing] = useState(false); const [isMoving, setIsMoving] = useState(false); const [posFromLeft, setPosFromLeft] = useState(null); - + // refs const resizableRef = useRef(null); - + // chart hook const { currentViewData, scrollLeft } = useChart(); - // check if cursor reaches either end while resizing/dragging const checkScrollEnd = (e: MouseEvent): number => { const SCROLL_THRESHOLD = 70; @@ -68,7 +60,6 @@ export const ChartDraggable: React.FC = ({ return delWidth; }; - // handle block resize from the left end const handleBlockLeftResize = (e: React.MouseEvent) => { if (!currentViewData || !resizableRef.current || !block.position) return; @@ -120,7 +111,6 @@ export const ChartDraggable: React.FC = ({ document.addEventListener("mousemove", handleMouseMove); document.addEventListener("mouseup", handleMouseUp); }; - // handle block resize from the right end const handleBlockRightResize = (e: React.MouseEvent) => { if (!currentViewData || !resizableRef.current || !block.position) return; @@ -163,7 +153,6 @@ export const ChartDraggable: React.FC = ({ document.addEventListener("mousemove", handleMouseMove); document.addEventListener("mouseup", handleMouseUp); }; - // handle block x-axis move const handleBlockMove = (e: React.MouseEvent) => { if (!enableBlockMove || !currentViewData || !resizableRef.current || !block.position) return; @@ -210,7 +199,6 @@ export const ChartDraggable: React.FC = ({ document.addEventListener("mousemove", handleMouseMove); document.addEventListener("mouseup", handleMouseUp); }; - // scroll to a hidden block const handleScrollToBlock = () => { const scrollContainer = document.querySelector("#scroll-container") as HTMLElement; @@ -220,7 +208,6 @@ export const ChartDraggable: React.FC = ({ // update container's scroll position to the block's position scrollContainer.scrollLeft = block.position.marginLeft - 4; }; - // update block position from viewport's left end on scroll useEffect(() => { const block = resizableRef.current; @@ -229,7 +216,6 @@ export const ChartDraggable: React.FC = ({ setPosFromLeft(block.getBoundingClientRect().left); }, [scrollLeft]); - // check if block is hidden on either side const isBlockHiddenOnLeft = block.position?.marginLeft && diff --git a/web/components/gantt-chart/helpers/index.ts b/web/components/gantt-chart/helpers/index.ts index c4c919ec0fe..1b51dc37473 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.tsx index 10c00a36322..7673da88e78 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 = ({ - border = true, - title, - blocks, - loaderTitle = "blocks", - blockUpdateHandler, - sidebarToRender, - blockToRender, - enableBlockLeftResize = true, - enableBlockRightResize = true, - enableBlockMove = true, - enableReorder = true, - bottomSpacing = false, -}) => ( - - - -); +export const GanttChartRoot: FC = (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 ( + + + + ); +}; diff --git a/web/components/gantt-chart/sidebar/cycle-sidebar.tsx b/web/components/gantt-chart/sidebar/cycle-sidebar.tsx index b7cb4183751..1af1529c27c 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"; // hooks import { useChart } from "components/gantt-chart/hooks"; @@ -83,7 +82,7 @@ export const CycleGanttSidebar: React.FC = (props) => { return ( - + {(droppableProvided) => (
= (props) => {
)} -
+
); }; diff --git a/web/components/gantt-chart/sidebar/module-sidebar.tsx b/web/components/gantt-chart/sidebar/module-sidebar.tsx index 8dc437269a7..30f146dc55a 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"; // hooks import { useChart } from "components/gantt-chart/hooks"; @@ -83,7 +82,7 @@ export const ModuleGanttSidebar: React.FC = (props) => { return ( - + {(droppableProvided) => (
= (props) => {
)} -
+
); }; diff --git a/web/components/gantt-chart/sidebar/project-view-sidebar.tsx b/web/components/gantt-chart/sidebar/project-view-sidebar.tsx index b591f3b733f..da7382859f7 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"; // hooks import { useChart } from "components/gantt-chart/hooks"; @@ -84,7 +83,7 @@ export const ProjectViewGanttSidebar: React.FC = (props) => { return ( - + {(droppableProvided) => (
= (props) => {
)} -
+
); }; diff --git a/web/components/gantt-chart/sidebar/sidebar.tsx b/web/components/gantt-chart/sidebar/sidebar.tsx index 88a138a1be4..062b764514d 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"; // hooks import { useChart } from "components/gantt-chart/hooks"; @@ -27,10 +26,10 @@ type Props = { ) => Promise; viewId?: string; disableIssueCreation?: boolean; + showAllBlocks?: boolean; }; export const IssueGanttSidebar: React.FC = (props) => { - // eslint-disable-next-line @typescript-eslint/no-unused-vars const { blockUpdateHandler, blocks, @@ -39,6 +38,7 @@ export const IssueGanttSidebar: React.FC = (props) => { quickAddCallback, viewId, disableIssueCreation, + showAllBlocks = false, } = props; const router = useRouter(); @@ -100,7 +100,7 @@ export const IssueGanttSidebar: React.FC = (props) => { return ( - + {(droppableProvided) => (
= (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 ( = (props) => {
- {duration} day{duration > 1 ? "s" : ""} + {duration && ( + + {duration} day{duration > 1 ? "s" : ""} + + )}
@@ -173,7 +185,7 @@ export const IssueGanttSidebar: React.FC = (props) => { )} )} - + ); }; diff --git a/web/components/gantt-chart/types/index.ts b/web/components/gantt-chart/types/index.ts index 9cab40f5cc2..1360f9f45a6 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.ts index fc145d69c3b..13d054da1ab 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.tsx index 73802886ea9..601205b5c8a 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"; // types import { 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 = observer((props: IBaseGan viewId={viewId} enableQuickIssueCreate disableIssueCreation={!enableIssueCreation || !isAllowed} + showAllBlocks /> )} enableBlockLeftResize={isAllowed} enableBlockRightResize={isAllowed} enableBlockMove={isAllowed} enableReorder={appliedDisplayFilters?.order_by === "sort_order" && isAllowed} + showAllBlocks /> diff --git a/web/constants/fetch-keys.ts b/web/constants/fetch-keys.ts index ec88c8c8779..86386e9683c 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.ts index cdaa85883f2..b0121320e2b 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.ts index 9a9c91a3780..d92453a3072 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 IArc filteredParams ); - 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.ts index 27347536bb7..dd81cfc0e6a 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 ICycleI filteredParams ); - 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.ts index 7096040d559..8295c263dc8 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 IDraftI filteredParams ); - 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.ts index ac89c5018e0..6516b28fd3b 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 filters type: displayFilters?.type || undefined, sub_issue: displayFilters?.sub_issue ?? true, - start_target_date: displayFilters?.start_target_date ?? true, }; const issueFiltersParams: Partial> = {}; @@ -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.ts index 3c309cecda0..e92027235f4 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 IModul filteredParams ); - 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.ts index a0f8028f844..563af5b0142 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 IProf filteredParams ); - 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.ts index e0dae761ce8..b3df3903b2c 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 I filteredParams ); - 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.ts index 392b7203f55..69393a32016 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 IProj filteredParams ); - 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.ts index 82fb75ce256..92cc33a64fa 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 IWo filteredParams ); - if (userFilters?.displayFilters?.layout === "gantt_chart") filteredRouteParams.start_target_date = true; if (userFilters?.displayFilters?.layout === "spreadsheet") filteredRouteParams.sub_issue = false; return filteredRouteParams;