From 94d7388b53fa5d4b71b90be8144da2d155c21d1b Mon Sep 17 00:00:00 2001
From: Nishit Suwal <81785002+NSUWAL123@users.noreply.github.com>
Date: Wed, 6 Dec 2023 21:46:37 +0545
Subject: [PATCH] fix: prevent generate building task without int (#1030)
* fix (button): padding fix for disabled button
* fix (createNewProject): splitTasks - generateTask button disabled until avg building per task is entered
---
src/frontend/src/components/common/Button.tsx | 2 +-
src/frontend/src/components/createnewproject/SplitTasks.tsx | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/frontend/src/components/common/Button.tsx b/src/frontend/src/components/common/Button.tsx
index 38fe7010e2..49168f80e7 100644
--- a/src/frontend/src/components/common/Button.tsx
+++ b/src/frontend/src/components/common/Button.tsx
@@ -24,7 +24,7 @@ const btnStyle = (btnType, className) => {
case 'other':
return `fmtm-py-1 fmtm-px-5 fmtm-bg-red-500 fmtm-text-white fmtm-rounded-lg hover:fmtm-bg-red-600`;
case 'disabled':
- return `fmtm-py-1 fmtm-px-5 fmtm-text-white fmtm-rounded-lg fmtm-bg-gray-400 fmtm-cursor-not-allowed`;
+ return `fmtm-py-1 fmtm-px-4 fmtm-text-white fmtm-rounded-lg fmtm-bg-gray-400 fmtm-cursor-not-allowed`;
default:
return 'fmtm-primary';
diff --git a/src/frontend/src/components/createnewproject/SplitTasks.tsx b/src/frontend/src/components/createnewproject/SplitTasks.tsx
index 1e5b01539b..ed62130c55 100644
--- a/src/frontend/src/components/createnewproject/SplitTasks.tsx
+++ b/src/frontend/src/components/createnewproject/SplitTasks.tsx
@@ -374,6 +374,7 @@ const SplitTasks = ({ flag, geojsonFile, setGeojsonFile, customLineUpload, custo
onClick={generateTaskBasedOnSelection}
className=""
icon={}
+ disabled={formValues?.average_buildings_per_task ? false : true}
/>
{/*