diff --git a/web/ce/constants/estimates.ts b/web/ce/constants/estimates.ts index 4d55bd1bc..3cced74f7 100644 --- a/web/ce/constants/estimates.ts +++ b/web/ce/constants/estimates.ts @@ -13,8 +13,10 @@ export enum EEstimateUpdateStages { SWITCH = "switch", } -export const minEstimatesCount = 2; -export const maxEstimatesCount = 6; +export const estimateCount = { + min: 2, + max: 6, +}; export const ESTIMATE_SYSTEMS: TEstimateSystems = { points: { diff --git a/web/core/components/estimates/points/create-root.tsx b/web/core/components/estimates/points/create-root.tsx index 79b18c188..53842fdb6 100644 --- a/web/core/components/estimates/points/create-root.tsx +++ b/web/core/components/estimates/points/create-root.tsx @@ -8,7 +8,7 @@ import { Button, Sortable } from "@plane/ui"; // components import { EstimatePointCreate, EstimatePointItemPreview } from "@/components/estimates/points"; // plane web constants -import { maxEstimatesCount } from "@/plane-web/constants/estimates"; +import { estimateCount } from "@/plane-web/constants/estimates"; type TEstimatePointCreateRoot = { workspaceSlug: string; @@ -89,7 +89,7 @@ export const EstimatePointCreateRoot: FC = observer((p }; const handleCreate = () => { - if (estimatePoints && estimatePoints.length + (estimatePointCreate?.length || 0) <= maxEstimatesCount - 1) { + if (estimatePoints && estimatePoints.length + (estimatePointCreate?.length || 0) <= estimateCount.max - 1) { handleEstimatePointCreate("add", { id: undefined, key: estimatePoints.length + (estimatePointCreate?.length || 0) + 1, @@ -143,7 +143,7 @@ export const EstimatePointCreateRoot: FC = observer((p isError={estimatePointCreateError.includes(estimatePoint.key) ? true : false} /> ))} - {estimatePoints && estimatePoints.length + (estimatePointCreate?.length || 0) <= maxEstimatesCount - 1 && ( + {estimatePoints && estimatePoints.length + (estimatePointCreate?.length || 0) <= estimateCount.max - 1 && ( diff --git a/web/core/components/estimates/points/preview.tsx b/web/core/components/estimates/points/preview.tsx index a0b86cbed..e8f27e00d 100644 --- a/web/core/components/estimates/points/preview.tsx +++ b/web/core/components/estimates/points/preview.tsx @@ -5,7 +5,7 @@ import { TEstimatePointsObject, TEstimateSystemKeys } from "@plane/types"; // components import { EstimatePointUpdate, EstimatePointDelete } from "@/components/estimates/points"; // plane web constants -import { minEstimatesCount } from "@/plane-web/constants/estimates"; +import { estimateCount } from "@/plane-web/constants/estimates"; type TEstimatePointItemPreview = { workspaceSlug: string; @@ -62,7 +62,7 @@ export const EstimatePointItemPreview: FC = observer( > - {estimatePoints.length > minEstimatesCount && ( + {estimatePoints.length > estimateCount.min && (
diff --git a/web/core/constants/estimates.ts b/web/core/constants/estimates.ts index 4d55bd1bc..d50c55093 100644 --- a/web/core/constants/estimates.ts +++ b/web/core/constants/estimates.ts @@ -13,8 +13,8 @@ export enum EEstimateUpdateStages { SWITCH = "switch", } -export const minEstimatesCount = 2; -export const maxEstimatesCount = 6; +export const estimateCount.min = 2; +export const estimateCount.max = 6; export const ESTIMATE_SYSTEMS: TEstimateSystems = { points: { diff --git a/web/ee/constants/estimates.ts b/web/ee/constants/estimates.ts new file mode 100644 index 000000000..654243fa1 --- /dev/null +++ b/web/ee/constants/estimates.ts @@ -0,0 +1,3 @@ +import * as ceConstants from "@/plane-web/constants/estimates"; + +export { ceConstants };