Skip to content

Commit

Permalink
[8.x] Revert "[UII] Fix client-side validation for agent policy …
Browse files Browse the repository at this point in the history
…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)](#194338)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Jen
Huang","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-09-30T21:22:37Z","message":"Revert
\"[UII] Fix client-side validation for agent policy timeout fields
(#191674)\" (#194338)\n\n## Summary\r\n\r\nResolves #194221.\r\n\r\nThis
PR reverts commit f29bf1c.
Timeout\r\nfields should be clearable with undefined value or
zero.","sha":"6792cb4dca5adecf1a48a4d052dae603db5772e3","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:Fleet","v9.0.0","backport:prev-major"],"title":"Revert
\"[UII] Fix client-side validation for agent policy timeout fields
(#191674)\"","number":194338,"url":"https://github.com/elastic/kibana/pull/194338","mergeCommit":{"message":"Revert
\"[UII] Fix client-side validation for agent policy timeout fields
(#191674)\" (#194338)\n\n## Summary\r\n\r\nResolves #194221.\r\n\r\nThis
PR reverts commit f29bf1c.
Timeout\r\nfields should be clearable with undefined value or
zero.","sha":"6792cb4dca5adecf1a48a4d052dae603db5772e3"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/194338","number":194338,"mergeCommit":{"message":"Revert
\"[UII] Fix client-side validation for agent policy timeout fields
(#191674)\" (#194338)\n\n## Summary\r\n\r\nResolves #194221.\r\n\r\nThis
PR reverts commit f29bf1c.
Timeout\r\nfields should be clearable with undefined value or
zero.","sha":"6792cb4dca5adecf1a48a4d052dae603db5772e3"}}]}] BACKPORT-->

Co-authored-by: Jen Huang <[email protected]>
  • Loading branch information
kibanamachine and jen-huang authored Sep 30, 2024
1 parent f20444a commit 32f83be
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 32f83be

Please sign in to comment.