Compare commits
2 Commits
fcaa310502
...
4ecb6f8167
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4ecb6f8167 | ||
|
|
7b7b15738b |
@@ -24,12 +24,18 @@ const Alert = (props) => {
|
||||
</div>
|
||||
<div className={styles.alertBody}>
|
||||
<p>
|
||||
You are about to add a new record. Please review the details before
|
||||
continuing. Do you want to proceed?
|
||||
{props?.body ||
|
||||
" You are about to add a new record. Please review the details before continuing. Do you want to proceed?"}
|
||||
</p>
|
||||
</div>
|
||||
<div className={styles.actionButtons}>
|
||||
<PrimaryButton text="Confirm" onClick={handleHide} />
|
||||
<PrimaryButton
|
||||
text="Confirm"
|
||||
onClick={() => {
|
||||
props?.setEditState(false);
|
||||
handleHide();
|
||||
}}
|
||||
/>
|
||||
<SecondaryButton text="Cancel" onClick={handleHide} />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -37,8 +37,9 @@ const TopHeader = (props) => {
|
||||
{triggerAlert && (
|
||||
<Alert
|
||||
setTriggerAlert={setTriggerAlert}
|
||||
onClick={() => 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?"
|
||||
/>
|
||||
)}
|
||||
<div className={styles.container}>
|
||||
@@ -91,7 +92,9 @@ const TopHeader = (props) => {
|
||||
text="Save"
|
||||
form="form"
|
||||
type="submit"
|
||||
/* onClick={() => setTriggerAlert(!triggerAlert)} */
|
||||
onClick={() =>
|
||||
editState ? setTriggerAlert(!triggerAlert) : ""
|
||||
}
|
||||
icon={<CheckIcon width={20} height={20} />}
|
||||
/>
|
||||
|
||||
|
||||
@@ -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}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user