π₯π₯π₯ 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
[WEB-522] fix: handling the issue and estimate point dropdown in the active cycle to render only when the estimate type is points (#4930)
guru_sainathc5cd823aaafb
diff --git a/web/core/components/cycles/active-cycle/productivity.tsx b/web/core/components/cycles/active-cycle/productivity.tsxindex 1164c9323c..cc10fb808a 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";// constantsimport { 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<ActiveCycleProductivityProps> = observeconst { workspaceSlug, projectId, cycle } = props;// hooksconst { getPlotTypeByCycleId, setPlotType, fetchCycleDetails } = useCycle();- const { areEstimateEnabledByProjectId } = useProjectEstimates();+ const { currentActiveEstimateId, areEstimateEnabledByProjectId, estimateById } = useProjectEstimates();// stateconst [loader, setLoader] = useState(false);// derived values@@ -44,6 +46,11 @@ export const ActiveCycleProductivity: FC<ActiveCycleProductivityProps> = 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<ActiveCycleProductivityProps> = observe<Link href={`/${workspaceSlug}/projects/${projectId}/cycles/${cycle?.id}`}><h3 className="text-base text-custom-text-300 font-semibold">Issue burndown</h3></Link>- {areEstimateEnabledByProjectId(projectId) && (+ {isCurrentEstimateTypeIsPoints && (<div className="relative flex items-center gap-2"><CustomSelectvalue={plotType}