[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:
guru_sainath 2024-06-18 13:31:23 +05:30 committed by GitHub
parent 6828d33c3f
commit d3d723cadd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 16 additions and 4 deletions

View file

@ -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))) {

View file

@ -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))) {