Skip to content

armgit / plane

Public Imported from GitHub
0

πŸ”₯πŸ”₯πŸ”₯ Open-source Jira, Linear, Monday, and ClickUp alternative. Plane is a modern project management platform to manage tasks, sprints, docs, and triage.

[WEB-1632] fix: validating and showing proper alert estimate point has to be taken greater than 0 in create and update (#4850)

guru_sainathd3d723cadd15
diff --git a/web/core/components/estimates/points/create.tsx b/web/core/components/estimates/points/create.tsx
index 4a0967aa00..981714b5f9 100644
--- a/web/core/components/estimates/points/create.tsx
+++ b/web/core/components/estimates/points/create.tsx
@@ -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))) {
diff --git a/web/core/components/estimates/points/update.tsx b/web/core/components/estimates/points/update.tsx
index 4194f4b2df..c6d28ba10c 100644
--- a/web/core/components/estimates/points/update.tsx
+++ b/web/core/components/estimates/points/update.tsx
@@ -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))) {