Skip to content

Commit

Permalink
Fix: Allow 'Force' without IP address
Browse files Browse the repository at this point in the history
Adding host should allow use of 'force'
checkbox without IP address added, as the
idea is to allow adding host objects that
don't have DNS entries associated with them.

Fixes: #624
Signed-off-by: Carla Martinez <carlmart@redhat.com>
  • Loading branch information
carma12 committed Jan 29, 2025
1 parent 68584ac commit 3612c40
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions src/components/modals/HostModals/AddHost.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,6 @@ const AddHost = (props: PropsToAddHost) => {
pfError: ValidatedOptions.default,
});

useEffect(() => {
if (hostIpAddress === "") {
setForceCheckbox(false);
}
}, [hostIpAddress]);

const hostNameValidationHandler = (hostname: string) => {
if (hostname === "") {
const hostNameVal = {
Expand Down Expand Up @@ -218,8 +212,6 @@ const AddHost = (props: PropsToAddHost) => {
pfError: ValidatedOptions.error,
};
setHostIpAddressValidation(ipVal);
// Can not force DNS bypass without a valid IP address
setForceCheckbox(false);
}
}, [hostName, dnsZoneSelected, hostIpAddress]);

Expand Down Expand Up @@ -394,11 +386,12 @@ const AddHost = (props: PropsToAddHost) => {
name="forceCheckbox"
value="force"
onChange={handleForceCheckbox}
isDisabled={hostIpAddressValidation.isError || hostIpAddress === ""}
isDisabled={hostIpAddressValidation.isError}
/>
<HelperText>
<HelperTextItem variant="indeterminate">
Requires valid IP address
Allow adding host objects that does not have DNS entries
associated with them
</HelperTextItem>
</HelperText>
</div>
Expand Down

0 comments on commit 3612c40

Please sign in to comment.