-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Index Management] Fix globalMaxRetention display error in data retention modal #198113
Conversation
@elasticmachine merge upstream |
@@ -7,6 +7,7 @@ | |||
|
|||
import { i18n } from '@kbn/i18n'; | |||
import { splitSizeAndUnits } from '../../../../../../common'; | |||
import { deserializeGlobalMaxRetention } from '../../../../lib/data_streams'; | |||
|
|||
const convertToMinutes = (value: string) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this @viajes7! Apart from displaying the correct unit in the modal, we should make sure that the validation also works correctly. However, currently, the validation only supports days, hours, minutes, and seconds, but we should support all of the units that are accepted by Elasticsearch:
return switch (timeUnit) {
case NANOSECONDS -> duration + "nanos";
case MICROSECONDS -> duration + "micros";
case MILLISECONDS -> duration + "ms";
case SECONDS -> duration + "s";
case MINUTES -> duration + "m";
case HOURS -> duration + "h";
case DAYS -> duration + "d";
};
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the review @ElenaStoeva ! I added handling of extraTimeUnits and corresponding changes have been made to the validation.
Pinging @elastic/kibana-management (Team:Kibana Management) |
@elasticmachine merge upstream |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing the validations and adding unit tests! Tested locally and it works well. Changes lgtm.
/ci |
💛 Build succeeded, but was flaky
Failed CI StepsMetrics [docs]Async chunks
|
@elasticmachine run docs-build |
Starting backport for target branches: 8.x |
…tion modal (elastic#198113) ## Summary Fixes elastic#197314 **After fixup:** ![image](https://github.com/user-attachments/assets/9fa66906-fa06-4e12-81d8-7bcdaaff3ff3) ![image](https://github.com/user-attachments/assets/a7b9ee72-4ce3-4d2b-8c14-483ea2028597) --------- Co-authored-by: Elastic Machine <[email protected]> (cherry picked from commit 1e7bb1e)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
… retention modal (#198113) (#198534) # Backport This will backport the following commits from `main` to `8.x`: - [[Index Management] Fix globalMaxRetention display error in data retention modal (#198113)](#198113) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Jusheng Huang","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-31T13:52:48Z","message":"[Index Management] Fix globalMaxRetention display error in data retention modal (#198113)\n\n## Summary\r\n\r\nFixes #197314 \r\n\r\n**After fixup:**\r\n\r\n\r\n![image](https://github.com/user-attachments/assets/9fa66906-fa06-4e12-81d8-7bcdaaff3ff3)\r\n\r\n\r\n![image](https://github.com/user-attachments/assets/a7b9ee72-4ce3-4d2b-8c14-483ea2028597)\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine <[email protected]>","sha":"1e7bb1ea37e7aa8b1ebb77f22fa34e2f1e3302a0","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","💝community","v9.0.0","backport:prev-minor"],"title":"[Index Management] Fix globalMaxRetention display error in data retention modal","number":198113,"url":"https://github.com/elastic/kibana/pull/198113","mergeCommit":{"message":"[Index Management] Fix globalMaxRetention display error in data retention modal (#198113)\n\n## Summary\r\n\r\nFixes #197314 \r\n\r\n**After fixup:**\r\n\r\n\r\n![image](https://github.com/user-attachments/assets/9fa66906-fa06-4e12-81d8-7bcdaaff3ff3)\r\n\r\n\r\n![image](https://github.com/user-attachments/assets/a7b9ee72-4ce3-4d2b-8c14-483ea2028597)\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine <[email protected]>","sha":"1e7bb1ea37e7aa8b1ebb77f22fa34e2f1e3302a0"}},"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/198113","number":198113,"mergeCommit":{"message":"[Index Management] Fix globalMaxRetention display error in data retention modal (#198113)\n\n## Summary\r\n\r\nFixes #197314 \r\n\r\n**After fixup:**\r\n\r\n\r\n![image](https://github.com/user-attachments/assets/9fa66906-fa06-4e12-81d8-7bcdaaff3ff3)\r\n\r\n\r\n![image](https://github.com/user-attachments/assets/a7b9ee72-4ce3-4d2b-8c14-483ea2028597)\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine <[email protected]>","sha":"1e7bb1ea37e7aa8b1ebb77f22fa34e2f1e3302a0"}}]}] BACKPORT--> Co-authored-by: Jusheng Huang <[email protected]>
Summary
Fixes #197314
After fixup: