mirror of
https://github.com/makeplane/plane
synced 2025-08-07 19:59:33 +00:00
[WEB-1632] fix: validating and showing proper alert estimate point has to be taken greater than 0 in create and update (#4850)
* fix: validating and showing proper alert estimate point has to be taken greater than 0 in create and update * fix: updating the number point validation
This commit is contained in:
@@ -82,8 +82,14 @@ export const EstimatePointCreate: FC<TEstimatePointCreate> = observer((props) =>
|
||||
|
||||
if (!isRepeated) {
|
||||
if (currentEstimateType && [(EEstimateSystem.TIME, EEstimateSystem.POINTS)].includes(currentEstimateType)) {
|
||||
if (estimateInputValue && Number(estimateInputValue) && Number(estimateInputValue) >= 0) {
|
||||
isEstimateValid = true;
|
||||
if (estimateInputValue && !isNaN(Number(estimateInputValue))) {
|
||||
if (Number(estimateInputValue) <= 0) {
|
||||
handleEstimatePointError &&
|
||||
handleEstimatePointError(estimateInputValue, "Estimate point should be greater than 0.");
|
||||
return;
|
||||
} else {
|
||||
isEstimateValid = true;
|
||||
}
|
||||
}
|
||||
} else if (currentEstimateType && currentEstimateType === EEstimateSystem.CATEGORIES) {
|
||||
if (estimateInputValue && estimateInputValue.length > 0 && isNaN(Number(estimateInputValue))) {
|
||||
|
||||
@@ -87,8 +87,14 @@ export const EstimatePointUpdate: FC<TEstimatePointUpdate> = observer((props) =>
|
||||
|
||||
if (!isRepeated) {
|
||||
if (currentEstimateType && [(EEstimateSystem.TIME, EEstimateSystem.POINTS)].includes(currentEstimateType)) {
|
||||
if (estimateInputValue && Number(estimateInputValue) && Number(estimateInputValue) >= 0) {
|
||||
isEstimateValid = true;
|
||||
if (estimateInputValue && !isNaN(Number(estimateInputValue))) {
|
||||
if (Number(estimateInputValue) <= 0) {
|
||||
handleEstimatePointError &&
|
||||
handleEstimatePointError(estimateInputValue, "Estimate point should be greater than 0.");
|
||||
return;
|
||||
} else {
|
||||
isEstimateValid = true;
|
||||
}
|
||||
}
|
||||
} else if (currentEstimateType && currentEstimateType === EEstimateSystem.CATEGORIES) {
|
||||
if (estimateInputValue && estimateInputValue.length > 0 && isNaN(Number(estimateInputValue))) {
|
||||
|
||||
Reference in New Issue
Block a user