Compare commits
2 Commits
fcaa310502
...
4ecb6f8167
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4ecb6f8167 | ||
|
|
7b7b15738b |
@@ -24,12 +24,18 @@ const Alert = (props) => {
|
|||||||
</div>
|
</div>
|
||||||
<div className={styles.alertBody}>
|
<div className={styles.alertBody}>
|
||||||
<p>
|
<p>
|
||||||
You are about to add a new record. Please review the details before
|
{props?.body ||
|
||||||
continuing. Do you want to proceed?
|
" You are about to add a new record. Please review the details before continuing. Do you want to proceed?"}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div className={styles.actionButtons}>
|
<div className={styles.actionButtons}>
|
||||||
<PrimaryButton text="Confirm" onClick={handleHide} />
|
<PrimaryButton
|
||||||
|
text="Confirm"
|
||||||
|
onClick={() => {
|
||||||
|
props?.setEditState(false);
|
||||||
|
handleHide();
|
||||||
|
}}
|
||||||
|
/>
|
||||||
<SecondaryButton text="Cancel" onClick={handleHide} />
|
<SecondaryButton text="Cancel" onClick={handleHide} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -37,8 +37,9 @@ const TopHeader = (props) => {
|
|||||||
{triggerAlert && (
|
{triggerAlert && (
|
||||||
<Alert
|
<Alert
|
||||||
setTriggerAlert={setTriggerAlert}
|
setTriggerAlert={setTriggerAlert}
|
||||||
onClick={() => setEditState(true)}
|
setEditState={setEditState}
|
||||||
title={props.topbarTitle}
|
title={!editState ? props.topbarTitle : "Save Changes"}
|
||||||
|
body="You are about to save the changes. Do you want to continue?"
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
<div className={styles.container}>
|
<div className={styles.container}>
|
||||||
@@ -91,7 +92,9 @@ const TopHeader = (props) => {
|
|||||||
text="Save"
|
text="Save"
|
||||||
form="form"
|
form="form"
|
||||||
type="submit"
|
type="submit"
|
||||||
/* onClick={() => setTriggerAlert(!triggerAlert)} */
|
onClick={() =>
|
||||||
|
editState ? setTriggerAlert(!triggerAlert) : ""
|
||||||
|
}
|
||||||
icon={<CheckIcon width={20} height={20} />}
|
icon={<CheckIcon width={20} height={20} />}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|||||||
@@ -219,7 +219,8 @@ const AddServices = () => {
|
|||||||
placeHolder="1"
|
placeHolder="1"
|
||||||
disabled={disableScaling}
|
disabled={disableScaling}
|
||||||
{...register("minPods", {
|
{...register("minPods", {
|
||||||
required: maxPods.trim() === "" ? false : true,
|
required:
|
||||||
|
maxPods.trim() !== "" && !disableScaling,
|
||||||
})}
|
})}
|
||||||
hasError={!!errors.minPods}
|
hasError={!!errors.minPods}
|
||||||
/>
|
/>
|
||||||
@@ -230,7 +231,8 @@ const AddServices = () => {
|
|||||||
placeHolder="1"
|
placeHolder="1"
|
||||||
disabled={disableScaling}
|
disabled={disableScaling}
|
||||||
{...register("maxPods", {
|
{...register("maxPods", {
|
||||||
required: minPods.trim() === "" ? false : true,
|
required:
|
||||||
|
minPods.trim() !== "" && !disableScaling,
|
||||||
})}
|
})}
|
||||||
hasError={!!errors.maxPods}
|
hasError={!!errors.maxPods}
|
||||||
/>
|
/>
|
||||||
@@ -264,7 +266,8 @@ const AddServices = () => {
|
|||||||
disabled={disableReadiness}
|
disabled={disableReadiness}
|
||||||
{...register("readinessPath", {
|
{...register("readinessPath", {
|
||||||
required:
|
required:
|
||||||
readinessPort.trim() === "" ? false : true,
|
readinessPort.trim() !== "" &&
|
||||||
|
!disableReadiness,
|
||||||
})}
|
})}
|
||||||
hasError={!!errors.readinessPath}
|
hasError={!!errors.readinessPath}
|
||||||
/>
|
/>
|
||||||
@@ -276,7 +279,8 @@ const AddServices = () => {
|
|||||||
disabled={disableReadiness}
|
disabled={disableReadiness}
|
||||||
{...register("readinessPort", {
|
{...register("readinessPort", {
|
||||||
required:
|
required:
|
||||||
readinessPath.trim() === "" ? false : true,
|
readinessPath.trim() !== "" &&
|
||||||
|
!disableReadiness,
|
||||||
})}
|
})}
|
||||||
hasError={!!errors.readinessPort}
|
hasError={!!errors.readinessPort}
|
||||||
/>
|
/>
|
||||||
@@ -309,7 +313,9 @@ const AddServices = () => {
|
|||||||
disabled={disableLiveness}
|
disabled={disableLiveness}
|
||||||
{...register("livenessPath", {
|
{...register("livenessPath", {
|
||||||
required:
|
required:
|
||||||
livenessPort.trim() === "" ? false : true,
|
livenessPort.trim() !== "" && !disableLiveness
|
||||||
|
? false
|
||||||
|
: true,
|
||||||
})}
|
})}
|
||||||
hasError={!!errors.livenessPath}
|
hasError={!!errors.livenessPath}
|
||||||
/>
|
/>
|
||||||
|
|||||||
Reference in New Issue
Block a user