From 32f83be9c03686abd7baef0c164662a41709b367 Mon Sep 17 00:00:00 2001 From: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Date: Tue, 1 Oct 2024 09:12:51 +1000 Subject: [PATCH] [8.x] Revert "[UII] Fix client-side validation for agent policy timeout fields (#191674)" (#194338) (#194491) # Backport This will backport the following commits from `main` to `8.x`: - [Revert "[UII] Fix client-side validation for agent policy timeout fields (#191674)" (#194338)](https://github.com/elastic/kibana/pull/194338) ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) Co-authored-by: Jen Huang --- .../agent_policy/components/agent_policy_validation.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/agent_policy_validation.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/agent_policy_validation.tsx index 109e62b0e0de4..1e81e9fc6bbc3 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/agent_policy_validation.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/agent_policy_validation.tsx @@ -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 = [ , ]; } - if (agentPolicy.inactivity_timeout !== undefined && agentPolicy.inactivity_timeout <= 0) { + if (agentPolicy.inactivity_timeout && agentPolicy.inactivity_timeout < 0) { errors.inactivity_timeout = [ , ]; }