[8.x] [Index Management] Fix unhandled error in ds data retention modal (#196524) #197481
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Backport
This will backport the following commits from
main
to8.x
:Questions ?
Please refer to the Backport tool documentation
\r\nClick \"Manage\" --> Click \"Edit data retention\"\r\n4. Disable the toggle \"Keep data up to maximum retention period\"\r\n5. Verify that the field is enabled correctly, there is not endless\r\nspinner, and no console error.\r\n\r\n\r\n\r\nhttps://github.com/user-attachments/assets/957e0869-ee23-46d9-8f20-134937f6f8cf\r\n\r\n---------\r\n\r\nCo-authored-by: Matthew Kime ","sha":"d8fa996c5052d10da2f438b93723437f5631bbde","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Index Management","Team:Kibana Management","release_note:skip","v9.0.0","backport:prev-minor","v8.17.0"],"title":"[Index Management] Fix unhandled error in ds data retention modal","number":196524,"url":"https://github.com//pull/196524","mergeCommit":{"message":"[Index Management] Fix unhandled error in ds data retention modal (#196524)\n\nFixes https://github.com//issues/196331\r\n\r\n## Summary\r\n\r\nThis PR fixes the bug in the Edit ds data retention modal where we were\r\ncomparing the max retention period with an undefined `value` (now the\r\ncomparison happens only if `value` is defined). Also, the PR makes the\r\ndata retention field get re-validated only when the time unit changes\r\n(otherwise, when we switch off the toggle to enable to data retention\r\nfield, the field would get validated and would immediately show an error\r\n\"A data retention value is required.\" which is not great UX).\r\n\r\n### How to test:\r\n1. Start serverless ES with `yarn es serverless --projectType=security\r\n-E data_streams.lifecycle.retention.max=200d` and kibana with `yarn\r\nserverless-security`\r\n2. Navigate to Kibana, create a data stream using Dev Tools:\r\n```\r\nPUT _index_template/ds\r\n{\r\n \"index_patterns\": [\"ds\"],\r\n \"data_stream\": {}\r\n}\r\n\r\nPOST ds/_doc\r\n{\r\n \"@timestamp\": \"2020-01-27\"\r\n}\r\n```\r\n3. Navigate to Index Management. Find the data stream and select it -->\r\nClick \"Manage\" --> Click \"Edit data retention\"\r\n4. Disable the toggle \"Keep data up to maximum retention period\"\r\n5. Verify that the field is enabled correctly, there is not endless\r\nspinner, and no console error.\r\n\r\n\r\n\r\nhttps://github.com/user-attachments/assets/957e0869-ee23-46d9-8f20-134937f6f8cf\r\n\r\n---------\r\n\r\nCo-authored-by: Matthew Kime ","sha":"d8fa996c5052d10da2f438b93723437f5631bbde"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com//pull/196524","number":196524,"mergeCommit":{"message":"[Index Management] Fix unhandled error in ds data retention modal (#196524)\n\nFixes https://github.com//issues/196331\r\n\r\n## Summary\r\n\r\nThis PR fixes the bug in the Edit ds data retention modal where we were\r\ncomparing the max retention period with an undefined `value` (now the\r\ncomparison happens only if `value` is defined). Also, the PR makes the\r\ndata retention field get re-validated only when the time unit changes\r\n(otherwise, when we switch off the toggle to enable to data retention\r\nfield, the field would get validated and would immediately show an error\r\n\"A data retention value is required.\" which is not great UX).\r\n\r\n### How to test:\r\n1. Start serverless ES with `yarn es serverless --projectType=security\r\n-E data_streams.lifecycle.retention.max=200d` and kibana with `yarn\r\nserverless-security`\r\n2. Navigate to Kibana, create a data stream using Dev Tools:\r\n```\r\nPUT _index_template/ds\r\n{\r\n \"index_patterns\": [\"ds\"],\r\n \"data_stream\": {}\r\n}\r\n\r\nPOST ds/_doc\r\n{\r\n \"@timestamp\": \"2020-01-27\"\r\n}\r\n```\r\n3. Navigate to Index Management. Find the data stream and select it -->\r\nClick \"Manage\" --> Click \"Edit data retention\"\r\n4. Disable the toggle \"Keep data up to maximum retention period\"\r\n5. Verify that the field is enabled correctly, there is not endless\r\nspinner, and no console error.\r\n\r\n\r\n\r\nhttps://github.com/user-attachments/assets/957e0869-ee23-46d9-8f20-134937f6f8cf\r\n\r\n---------\r\n\r\nCo-authored-by: Matthew Kime ","sha":"d8fa996c5052d10da2f438b93723437f5631bbde"}},{"branch":"8.x","label":"v8.17.0","branchLabelMappingKey":"^v8.17.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT-->