[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:
parent
6828d33c3f
commit
d3d723cadd
2 changed files with 16 additions and 4 deletions
|
|
@ -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))) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue