diff --git a/web/core/components/cycles/active-cycle/productivity.tsx b/web/core/components/cycles/active-cycle/productivity.tsx index b3d5a6c047..2cdecca7f7 100644 --- a/web/core/components/cycles/active-cycle/productivity.tsx +++ b/web/core/components/cycles/active-cycle/productivity.tsx @@ -1,5 +1,6 @@ import { FC, Fragment, useState } from "react"; import Link from "next/link"; +import { observer } from "mobx-react"; import { ICycle, TCyclePlotType } from "@plane/types"; import { CustomSelect, Spinner } from "@plane/ui"; // components @@ -7,7 +8,7 @@ import ProgressChart from "@/components/core/sidebar/progress-chart"; import { EmptyState } from "@/components/empty-state"; // constants import { EmptyStateType } from "@/constants/empty-state"; -import { useCycle } from "@/hooks/store"; +import { useCycle, useProjectEstimates } from "@/hooks/store"; export type ActiveCycleProductivityProps = { workspaceSlug: string; @@ -20,10 +21,11 @@ const cycleBurnDownChartOptions = [ { value: "points", label: "Points" }, ]; -export const ActiveCycleProductivity: FC = (props) => { +export const ActiveCycleProductivity: FC = observer((props) => { const { workspaceSlug, projectId, cycle } = props; // hooks const { getPlotTypeByCycleId, setPlotType, fetchCycleDetails } = useCycle(); + const { areEstimateEnabledByProjectId } = useProjectEstimates(); // state const [loader, setLoader] = useState(false); // derived values @@ -46,27 +48,31 @@ export const ActiveCycleProductivity: FC = (props) const completionChartDistributionData = chartDistributionData?.completion_chart || undefined; return ( -
-
+
+

Issue burndown

-
- {cycleBurnDownChartOptions.find((v) => v.value === plotType)?.label ?? "None"}} - onChange={onChange} - maxHeight="lg" - > - {cycleBurnDownChartOptions.map((item) => ( - - {item.label} - - ))} - - {loader && } -
+ {areEstimateEnabledByProjectId(projectId) && ( + <> + {cycleBurnDownChartOptions.find((v) => v.value === plotType)?.label ?? "None"}} + onChange={onChange} + maxHeight="lg" + className="m-0 p-0" + > + {cycleBurnDownChartOptions.map((item) => ( + + {item.label} + + ))} + + {loader && } + + )}
+ {cycle.total_issues > 0 ? ( <> @@ -124,4 +130,4 @@ export const ActiveCycleProductivity: FC = (props)
); -}; +});