From c5cd823aaafb2c1ff08b7344f69961c20153db46 Mon Sep 17 00:00:00 2001 From: guru_sainath Date: Tue, 25 Jun 2024 14:11:28 +0530 Subject: [PATCH] [WEB-522] fix: handling the issue and estimate point dropdown in the active cycle to render only when the estimate type is points (#4930) * fix: handling the issue and estimate point dropdown in active cycle to render only when estimate type is points * fix: reverted the theme store --- .../components/cycles/active-cycle/productivity.tsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/web/core/components/cycles/active-cycle/productivity.tsx b/web/core/components/cycles/active-cycle/productivity.tsx index 1164c9323..cc10fb808 100644 --- a/web/core/components/cycles/active-cycle/productivity.tsx +++ b/web/core/components/cycles/active-cycle/productivity.tsx @@ -9,6 +9,8 @@ import { EmptyState } from "@/components/empty-state"; // constants import { EmptyStateType } from "@/constants/empty-state"; import { useCycle, useProjectEstimates } from "@/hooks/store"; +// plane web constants +import { EEstimateSystem } from "@/plane-web/constants/estimates"; export type ActiveCycleProductivityProps = { workspaceSlug: string; @@ -25,7 +27,7 @@ export const ActiveCycleProductivity: FC = observe const { workspaceSlug, projectId, cycle } = props; // hooks const { getPlotTypeByCycleId, setPlotType, fetchCycleDetails } = useCycle(); - const { areEstimateEnabledByProjectId } = useProjectEstimates(); + const { currentActiveEstimateId, areEstimateEnabledByProjectId, estimateById } = useProjectEstimates(); // state const [loader, setLoader] = useState(false); // derived values @@ -44,6 +46,11 @@ export const ActiveCycleProductivity: FC = observe } }; + const isCurrentProjectEstimateEnabled = projectId && areEstimateEnabledByProjectId(projectId) ? true : false; + const estimateDetails = + isCurrentProjectEstimateEnabled && currentActiveEstimateId && estimateById(currentActiveEstimateId); + const isCurrentEstimateTypeIsPoints = estimateDetails && estimateDetails?.type === EEstimateSystem.POINTS; + const chartDistributionData = plotType === "points" ? cycle?.estimate_distribution : cycle?.distribution || undefined; const completionChartDistributionData = chartDistributionData?.completion_chart || undefined; @@ -53,7 +60,7 @@ export const ActiveCycleProductivity: FC = observe

Issue burndown

- {areEstimateEnabledByProjectId(projectId) && ( + {isCurrentEstimateTypeIsPoints && (