[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
This commit is contained in:
guru_sainath 2024-06-24 13:27:59 +05:30 committed by GitHub
parent 716a35779c
commit 1c8e709870
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 6 additions and 4 deletions

View file

@ -1,6 +1,8 @@
// types // types
import { TEstimateSystems } from "@plane/types"; import { TEstimateSystems } from "@plane/types";
export const MAX_ESTIMATE_POINT_INPUT_LENGTH = 20;
export enum EEstimateSystem { export enum EEstimateSystem {
POINTS = "points", POINTS = "points",
CATEGORIES = "categories", CATEGORIES = "categories",

View file

@ -11,7 +11,7 @@ import { isEstimatePointValuesRepeated } from "@/helpers/estimates";
// hooks // hooks
import { useEstimate } from "@/hooks/store"; import { useEstimate } from "@/hooks/store";
// plane web constants // plane web constants
import { EEstimateSystem } from "@/plane-web/constants/estimates"; import { EEstimateSystem, MAX_ESTIMATE_POINT_INPUT_LENGTH } from "@/plane-web/constants/estimates";
type TEstimatePointCreate = { type TEstimatePointCreate = {
workspaceSlug: string; workspaceSlug: string;
@ -155,7 +155,7 @@ export const EstimatePointCreate: FC<TEstimatePointCreate> = observer((props) =>
const inputProps = { const inputProps = {
type: inputFieldType, type: inputFieldType,
pattern: inputFieldType === "number" ? "[0-9]*" : undefined, pattern: inputFieldType === "number" ? "[0-9]*" : undefined,
maxlength: inputFieldType === "number" ? undefined : 24, maxlength: MAX_ESTIMATE_POINT_INPUT_LENGTH,
}; };
return ( return (

View file

@ -11,7 +11,7 @@ import { isEstimatePointValuesRepeated } from "@/helpers/estimates";
// hooks // hooks
import { useEstimatePoint } from "@/hooks/store"; import { useEstimatePoint } from "@/hooks/store";
// plane web constants // plane web constants
import { EEstimateSystem } from "@/plane-web/constants/estimates"; import { EEstimateSystem, MAX_ESTIMATE_POINT_INPUT_LENGTH } from "@/plane-web/constants/estimates";
type TEstimatePointUpdate = { type TEstimatePointUpdate = {
workspaceSlug: string; workspaceSlug: string;
@ -163,7 +163,7 @@ export const EstimatePointUpdate: FC<TEstimatePointUpdate> = observer((props) =>
const inputProps = { const inputProps = {
type: inputFieldType, type: inputFieldType,
pattern: inputFieldType === "number" ? "[0-9]*" : undefined, pattern: inputFieldType === "number" ? "[0-9]*" : undefined,
maxlength: inputFieldType === "number" ? undefined : 24, maxlength: MAX_ESTIMATE_POINT_INPUT_LENGTH,
}; };
return ( return (