Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8.15] [UII] Fix client-side validation for agent policy timeout fields (#191674) #191752

Merged
merged 1 commit into from
Aug 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,20 @@ export const agentPolicyFormValidation = (
errors.namespace = [namespaceValidation.error];
}

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

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