From 1c8e7098709d2ca415eefaad9e1771044304b73e Mon Sep 17 00:00:00 2001 From: guru_sainath Date: Mon, 24 Jun 2024 13:27:59 +0530 Subject: [PATCH] [WEB-522] chore: handled maximum no of char that user can enter in estimate point create and update (#4913) * chore: handled maximum no of char that user can enter in estimate point create and update * chore: typo --- web/ce/constants/estimates.ts | 2 ++ web/core/components/estimates/points/create.tsx | 4 ++-- web/core/components/estimates/points/update.tsx | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/web/ce/constants/estimates.ts b/web/ce/constants/estimates.ts index 5b068e400c..7ffe761a8b 100644 --- a/web/ce/constants/estimates.ts +++ b/web/ce/constants/estimates.ts @@ -1,6 +1,8 @@ // types import { TEstimateSystems } from "@plane/types"; +export const MAX_ESTIMATE_POINT_INPUT_LENGTH = 20; + export enum EEstimateSystem { POINTS = "points", CATEGORIES = "categories", diff --git a/web/core/components/estimates/points/create.tsx b/web/core/components/estimates/points/create.tsx index 274b19d901..89a4dbaf35 100644 --- a/web/core/components/estimates/points/create.tsx +++ b/web/core/components/estimates/points/create.tsx @@ -11,7 +11,7 @@ import { isEstimatePointValuesRepeated } from "@/helpers/estimates"; // hooks import { useEstimate } from "@/hooks/store"; // plane web constants -import { EEstimateSystem } from "@/plane-web/constants/estimates"; +import { EEstimateSystem, MAX_ESTIMATE_POINT_INPUT_LENGTH } from "@/plane-web/constants/estimates"; type TEstimatePointCreate = { workspaceSlug: string; @@ -155,7 +155,7 @@ export const EstimatePointCreate: FC = observer((props) => const inputProps = { type: inputFieldType, pattern: inputFieldType === "number" ? "[0-9]*" : undefined, - maxlength: inputFieldType === "number" ? undefined : 24, + maxlength: MAX_ESTIMATE_POINT_INPUT_LENGTH, }; return ( diff --git a/web/core/components/estimates/points/update.tsx b/web/core/components/estimates/points/update.tsx index c0f1df6a45..747d2b64d6 100644 --- a/web/core/components/estimates/points/update.tsx +++ b/web/core/components/estimates/points/update.tsx @@ -11,7 +11,7 @@ import { isEstimatePointValuesRepeated } from "@/helpers/estimates"; // hooks import { useEstimatePoint } from "@/hooks/store"; // plane web constants -import { EEstimateSystem } from "@/plane-web/constants/estimates"; +import { EEstimateSystem, MAX_ESTIMATE_POINT_INPUT_LENGTH } from "@/plane-web/constants/estimates"; type TEstimatePointUpdate = { workspaceSlug: string; @@ -163,7 +163,7 @@ export const EstimatePointUpdate: FC = observer((props) => const inputProps = { type: inputFieldType, pattern: inputFieldType === "number" ? "[0-9]*" : undefined, - maxlength: inputFieldType === "number" ? undefined : 24, + maxlength: MAX_ESTIMATE_POINT_INPUT_LENGTH, }; return (