forked from github/plane
Merge pull request #2101 from makeplane/fix/gantt_issues
fix: don't render invalid dated blocks on the gantt chart
This commit is contained in:
commit
b46a7481ae
@ -63,7 +63,9 @@ export const CyclesListGanttChartView: FC<Props> = ({ cycles, mutateCycles }) =>
|
|||||||
const blockFormat = (blocks: ICycle[]) =>
|
const blockFormat = (blocks: ICycle[]) =>
|
||||||
blocks && blocks.length > 0
|
blocks && blocks.length > 0
|
||||||
? blocks
|
? blocks
|
||||||
.filter((b) => b.start_date && b.end_date)
|
.filter(
|
||||||
|
(b) => b.start_date && b.end_date && new Date(b.start_date) <= new Date(b.end_date)
|
||||||
|
)
|
||||||
.map((block) => ({
|
.map((block) => ({
|
||||||
data: block,
|
data: block,
|
||||||
id: block.id,
|
id: block.id,
|
||||||
|
@ -4,7 +4,9 @@ import { IGanttBlock } from "components/gantt-chart";
|
|||||||
|
|
||||||
export const renderIssueBlocksStructure = (blocks: IIssue[]): IGanttBlock[] =>
|
export const renderIssueBlocksStructure = (blocks: IIssue[]): IGanttBlock[] =>
|
||||||
blocks && blocks.length > 0
|
blocks && blocks.length > 0
|
||||||
? blocks.map((block) => ({
|
? blocks
|
||||||
|
.filter((b) => new Date(b?.start_date ?? "") <= new Date(b?.target_date ?? ""))
|
||||||
|
.map((block) => ({
|
||||||
data: block,
|
data: block,
|
||||||
id: block.id,
|
id: block.id,
|
||||||
sort_order: block.sort_order,
|
sort_order: block.sort_order,
|
||||||
|
@ -69,7 +69,10 @@ export const ModulesListGanttChartView: FC<Props> = ({ modules, mutateModules })
|
|||||||
const blockFormat = (blocks: IModule[]) =>
|
const blockFormat = (blocks: IModule[]) =>
|
||||||
blocks && blocks.length > 0
|
blocks && blocks.length > 0
|
||||||
? blocks
|
? blocks
|
||||||
.filter((b) => b.start_date && b.target_date)
|
.filter(
|
||||||
|
(b) =>
|
||||||
|
b.start_date && b.target_date && new Date(b.start_date) <= new Date(b.target_date)
|
||||||
|
)
|
||||||
.map((block) => ({
|
.map((block) => ({
|
||||||
data: block,
|
data: block,
|
||||||
id: block.id,
|
id: block.id,
|
||||||
|
Loading…
Reference in New Issue
Block a user