diff --git a/frontend/src/app/components/alerts/Alert.jsx b/frontend/src/app/components/alerts/Alert.jsx
index e124d58..19f160e 100644
--- a/frontend/src/app/components/alerts/Alert.jsx
+++ b/frontend/src/app/components/alerts/Alert.jsx
@@ -24,12 +24,18 @@ const Alert = (props) => {
setEditState(true)}
- title={props.topbarTitle}
+ setEditState={setEditState}
+ title={!editState ? props.topbarTitle : "Save Changes"}
+ body="You are about to save the changes. Do you want to continue?"
/>
)}
@@ -91,7 +92,9 @@ const TopHeader = (props) => {
text="Save"
form="form"
type="submit"
- /* onClick={() => setTriggerAlert(!triggerAlert)} */
+ onClick={() =>
+ editState ? setTriggerAlert(!triggerAlert) : ""
+ }
icon={}
/>
diff --git a/frontend/src/app/projects/view/add-from-scratch/page.jsx b/frontend/src/app/projects/view/add-from-scratch/page.jsx
index eb69fd6..4944113 100644
--- a/frontend/src/app/projects/view/add-from-scratch/page.jsx
+++ b/frontend/src/app/projects/view/add-from-scratch/page.jsx
@@ -219,7 +219,8 @@ const AddServices = () => {
placeHolder="1"
disabled={disableScaling}
{...register("minPods", {
- required: maxPods.trim() === "" ? false : true,
+ required:
+ maxPods.trim() !== "" && !disableScaling,
})}
hasError={!!errors.minPods}
/>
@@ -230,7 +231,8 @@ const AddServices = () => {
placeHolder="1"
disabled={disableScaling}
{...register("maxPods", {
- required: minPods.trim() === "" ? false : true,
+ required:
+ minPods.trim() !== "" && !disableScaling,
})}
hasError={!!errors.maxPods}
/>
@@ -264,7 +266,8 @@ const AddServices = () => {
disabled={disableReadiness}
{...register("readinessPath", {
required:
- readinessPort.trim() === "" ? false : true,
+ readinessPort.trim() !== "" &&
+ !disableReadiness,
})}
hasError={!!errors.readinessPath}
/>
@@ -276,7 +279,8 @@ const AddServices = () => {
disabled={disableReadiness}
{...register("readinessPort", {
required:
- readinessPath.trim() === "" ? false : true,
+ readinessPath.trim() !== "" &&
+ !disableReadiness,
})}
hasError={!!errors.readinessPort}
/>
@@ -309,7 +313,9 @@ const AddServices = () => {
disabled={disableLiveness}
{...register("livenessPath", {
required:
- livenessPort.trim() === "" ? false : true,
+ livenessPort.trim() !== "" && !disableLiveness
+ ? false
+ : true,
})}
hasError={!!errors.livenessPath}
/>