Commit 7ef672d
[9.1] [Index Management] Fix data retention modal validation (elastic#240062) (elastic#240828)
# Backport
This will backport the following commits from `main` to `9.1`:
- [[Index Management] Fix data retention modal validation
(elastic#240062)](elastic#240062)
<!--- Backport version: 9.6.6 -->
### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)
<!--BACKPORT [{"author":{"name":"Sonia Sanz
Vivas","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-10-27T14:03:02Z","message":"[Index
Management] Fix data retention modal validation (elastic#240062)\n\nFixes
https://github.com/elastic/kibana/issues/239656\n## Summary\n\nWe had a
bug in the validation for data retention modal in data streams.\nThe
data retention period field couldn't left blank even if the enable\ndata
retention toggle was disabled or the keep data indefinitely\nenabled. To
fix this, we need to re-validate the form whenever a form\nfield
changes.\n\n### how to test\n\n- Open the edit data retention modal for
some data stream\n- Toggle on `Enable data retention`, leave data
retention period blank,\nlet `Keep data indefinitely` disabled.\n-
Verify that you see the validation warning and you are not allowed
to\nsave (this is ok!)\n<img width=\"739\" height=\"431\"
alt=\"Screenshot 2025-10-22 at 13 13
07\"\nsrc=\"https://github.com/user-attachments/assets/c59cfb5e-d405-4176-9efd-46bf76a9332d\"\n/>\n\n-
Now enable `Keep data indefinitely`. \n- The validation error should
disappear and you should be allowed to\nsave (great!).\n \n<img
width=\"748\" height=\"417\" alt=\"Screenshot 2025-10-22 at 13 13
13\"\nsrc=\"https://github.com/user-attachments/assets/aef71367-663d-4643-bf2e-de9072e7e854\"\n/>\n\n-
Disable `Keep data indefinitely`, leave data retention period blank\nand
toggle off `Enable data retention`\n- The validation error should
disappear and you should be allowed to\nsave (great!).\n<img
width=\"717\" height=\"394\" alt=\"Screenshot 2025-10-22 at 13 12
38\"\nsrc=\"https://github.com/user-attachments/assets/7ace405c-9877-4a36-ad52-d36a29eba437\"\n/>\n\nNote:
the Save button won't be enabled unless the form is dirty.\n\n**Bonus
track**: Fixed some accessibility warnings in the file by
adding\naria-labels to the
buttons.","sha":"57ff405bf4958951568fb90ff8e72c591d119b6a","branchLabelMapping":{"^v9.3.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Index
Management","Team:Kibana
Management","release_note:skip","backport:all-open","v9.3.0"],"title":"[Index
Management] Fix data retention modal
validation","number":240062,"url":"https://github.com/elastic/kibana/pull/240062","mergeCommit":{"message":"[Index
Management] Fix data retention modal validation (elastic#240062)\n\nFixes
https://github.com/elastic/kibana/issues/239656\n## Summary\n\nWe had a
bug in the validation for data retention modal in data streams.\nThe
data retention period field couldn't left blank even if the enable\ndata
retention toggle was disabled or the keep data indefinitely\nenabled. To
fix this, we need to re-validate the form whenever a form\nfield
changes.\n\n### how to test\n\n- Open the edit data retention modal for
some data stream\n- Toggle on `Enable data retention`, leave data
retention period blank,\nlet `Keep data indefinitely` disabled.\n-
Verify that you see the validation warning and you are not allowed
to\nsave (this is ok!)\n<img width=\"739\" height=\"431\"
alt=\"Screenshot 2025-10-22 at 13 13
07\"\nsrc=\"https://github.com/user-attachments/assets/c59cfb5e-d405-4176-9efd-46bf76a9332d\"\n/>\n\n-
Now enable `Keep data indefinitely`. \n- The validation error should
disappear and you should be allowed to\nsave (great!).\n \n<img
width=\"748\" height=\"417\" alt=\"Screenshot 2025-10-22 at 13 13
13\"\nsrc=\"https://github.com/user-attachments/assets/aef71367-663d-4643-bf2e-de9072e7e854\"\n/>\n\n-
Disable `Keep data indefinitely`, leave data retention period blank\nand
toggle off `Enable data retention`\n- The validation error should
disappear and you should be allowed to\nsave (great!).\n<img
width=\"717\" height=\"394\" alt=\"Screenshot 2025-10-22 at 13 12
38\"\nsrc=\"https://github.com/user-attachments/assets/7ace405c-9877-4a36-ad52-d36a29eba437\"\n/>\n\nNote:
the Save button won't be enabled unless the form is dirty.\n\n**Bonus
track**: Fixed some accessibility warnings in the file by
adding\naria-labels to the
buttons.","sha":"57ff405bf4958951568fb90ff8e72c591d119b6a"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.3.0","branchLabelMappingKey":"^v9.3.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/240062","number":240062,"mergeCommit":{"message":"[Index
Management] Fix data retention modal validation (elastic#240062)\n\nFixes
https://github.com/elastic/kibana/issues/239656\n## Summary\n\nWe had a
bug in the validation for data retention modal in data streams.\nThe
data retention period field couldn't left blank even if the enable\ndata
retention toggle was disabled or the keep data indefinitely\nenabled. To
fix this, we need to re-validate the form whenever a form\nfield
changes.\n\n### how to test\n\n- Open the edit data retention modal for
some data stream\n- Toggle on `Enable data retention`, leave data
retention period blank,\nlet `Keep data indefinitely` disabled.\n-
Verify that you see the validation warning and you are not allowed
to\nsave (this is ok!)\n<img width=\"739\" height=\"431\"
alt=\"Screenshot 2025-10-22 at 13 13
07\"\nsrc=\"https://github.com/user-attachments/assets/c59cfb5e-d405-4176-9efd-46bf76a9332d\"\n/>\n\n-
Now enable `Keep data indefinitely`. \n- The validation error should
disappear and you should be allowed to\nsave (great!).\n \n<img
width=\"748\" height=\"417\" alt=\"Screenshot 2025-10-22 at 13 13
13\"\nsrc=\"https://github.com/user-attachments/assets/aef71367-663d-4643-bf2e-de9072e7e854\"\n/>\n\n-
Disable `Keep data indefinitely`, leave data retention period blank\nand
toggle off `Enable data retention`\n- The validation error should
disappear and you should be allowed to\nsave (great!).\n<img
width=\"717\" height=\"394\" alt=\"Screenshot 2025-10-22 at 13 12
38\"\nsrc=\"https://github.com/user-attachments/assets/7ace405c-9877-4a36-ad52-d36a29eba437\"\n/>\n\nNote:
the Save button won't be enabled unless the form is dirty.\n\n**Bonus
track**: Fixed some accessibility warnings in the file by
adding\naria-labels to the
buttons.","sha":"57ff405bf4958951568fb90ff8e72c591d119b6a"}}]}]
BACKPORT-->
---------
Co-authored-by: Sonia Sanz Vivas <[email protected]>1 parent 841910d commit 7ef672d
File tree
1 file changed
+19
-6
lines changed1 file changed
+19
-6
lines changedLines changed: 19 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | | - | |
| 99 | + | |
100 | 100 | | |
101 | 101 | | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
| 102 | + | |
| 103 | + | |
106 | 104 | | |
107 | 105 | | |
108 | 106 | | |
| |||
202 | 200 | | |
203 | 201 | | |
204 | 202 | | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
205 | 209 | | |
206 | 210 | | |
207 | 211 | | |
| |||
395 | 399 | | |
396 | 400 | | |
397 | 401 | | |
398 | | - | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
399 | 412 | | |
400 | 413 | | |
401 | 414 | | |
| |||
0 commit comments