Skip to content

Commit

Permalink
Revert "[UII] Fix client-side validation for agent policy timeout fie…
Browse files Browse the repository at this point in the history
…lds (elastic#191674)" (elastic#194338)

## Summary

Resolves elastic#194221.

This PR reverts commit f29bf1c. Timeout
fields should be clearable with undefined value or zero.
  • Loading branch information
jen-huang authored Sep 30, 2024
1 parent d89cac2 commit 6792cb4
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,20 +38,20 @@ export const agentPolicyFormValidation = (
errors.namespace = [namespaceValidation.error];
}

if (agentPolicy.unenroll_timeout !== undefined && agentPolicy.unenroll_timeout <= 0) {
if (agentPolicy.unenroll_timeout && agentPolicy.unenroll_timeout < 0) {
errors.unenroll_timeout = [
<FormattedMessage
id="xpack.fleet.agentPolicyForm.unenrollTimeoutMinValueErrorMessage"
defaultMessage="Unenroll timeout must be an integer greater than zero"
defaultMessage="Unenroll timeout must be greater than zero."
/>,
];
}

if (agentPolicy.inactivity_timeout !== undefined && agentPolicy.inactivity_timeout <= 0) {
if (agentPolicy.inactivity_timeout && agentPolicy.inactivity_timeout < 0) {
errors.inactivity_timeout = [
<FormattedMessage
id="xpack.fleet.agentPolicyForm.inactivityTimeoutMinValueErrorMessage"
defaultMessage="Inactivity timeout must be an integer greater than zero"
defaultMessage="Inactivity timeout must be greater than zero."
/>,
];
}
Expand Down

0 comments on commit 6792cb4

Please sign in to comment.