[WEB-4130] fix: cycle charts minor optimizations (#7123)

This commit is contained in:
Akshita Goyal 2025-05-28 00:54:21 +05:30 committed by GitHub
parent 04c7c53e09
commit b4bc49971c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 15 additions and 5 deletions

View file

@ -32,7 +32,7 @@ type Options = {
export const cycleEstimateOptions: Options[] = [
{ value: "issues", label: "Work items" },
{ value: "points", label: "Points" },
{ value: "points", label: "Estimates" },
];
export const cycleChartOptions: Options[] = [
{ value: "burndown", label: "Burn-down" },

View file

@ -1,5 +1,7 @@
import React from "react";
import { observer } from "mobx-react-lite";
import { TCycleEstimateType } from "@plane/types";
import { EEstimateSystem } from "@plane/types/src/enums";
import { CustomSelect } from "@plane/ui";
import { useCycle, useProjectEstimates } from "@/hooks/store";
import { cycleEstimateOptions } from "../analytics-sidebar";
@ -12,12 +14,13 @@ type TProps = {
cycleId: string;
};
export const EstimateTypeDropdown = (props: TProps) => {
export const EstimateTypeDropdown = observer((props: TProps) => {
const { value, onChange, projectId, cycleId, showDefault = false } = props;
const { getIsPointsDataAvailable } = useCycle();
const { areEstimateEnabledByProjectId } = useProjectEstimates();
const { areEstimateEnabledByProjectId, currentProjectEstimateType } = useProjectEstimates();
const isCurrentProjectEstimateEnabled = projectId && areEstimateEnabledByProjectId(projectId) ? true : false;
return getIsPointsDataAvailable(cycleId) || isCurrentProjectEstimateEnabled ? (
return (getIsPointsDataAvailable(cycleId) || isCurrentProjectEstimateEnabled) &&
currentProjectEstimateType !== EEstimateSystem.CATEGORIES ? (
<div className="relative flex items-center gap-2">
<CustomSelect
value={value}
@ -36,4 +39,4 @@ export const EstimateTypeDropdown = (props: TProps) => {
) : showDefault ? (
<span className="capitalize">{value}</span>
) : null;
};
});