Skip to content
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

[Security Solution] Fix incorrect default value for History Window Size #207827

Merged
merged 3 commits into from
Jan 24, 2025

Conversation

nikitaindik
Copy link
Contributor

@nikitaindik nikitaindik commented Jan 22, 2025

Resolves: #207348

Summary

This PR resolves a bug in the editable History Window Size component, which incorrectly displays "0 seconds" as the default value instead of "7 days". The issue was caused by passing an array of units (['m', 'h', 'd']) using an incorrect prop name.

Also, I fixed stuck last digit being stuck when trying to remove it
Before my changes: can't remove or reset the last digit

Schermopname.2025-01-23.om.16.21.24.mov

After my changes: value resets to minValue on last digit removal

Schermopname.2025-01-23.om.16.19.14.mov

Work started on: 22-Jan-2025

@nikitaindik nikitaindik added release_note:skip Skip the PR/issue when compiling release notes v9.0.0 Team:Detections and Resp Security Detection Response Team Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Team:Detection Rule Management Security Detection Rule Management Team Feature:Rule Creation Security Solution Detection Rule Creation workflow Feature:Rule Edit Security Solution Detection Rule Editing workflow backport:version Backport to applied version labels v8.18.0 labels Jan 22, 2025
@nikitaindik nikitaindik self-assigned this Jan 22, 2025
@nikitaindik nikitaindik force-pushed the new-terms-time-value-bug branch from 5ef4d3b to b7e662c Compare January 23, 2025 15:17
@nikitaindik nikitaindik marked this pull request as ready for review January 23, 2025 15:26
@nikitaindik nikitaindik requested a review from a team as a code owner January 23, 2025 15:26
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-detections-response (Team:Detections and Resp)

@elasticmachine
Copy link
Contributor

Pinging @elastic/security-solution (Team: SecuritySolution)

@elasticmachine
Copy link
Contributor

Pinging @elastic/security-detection-rule-management (Team:Detection Rule Management)

@nikitaindik nikitaindik requested review from vitaliidm and removed request for nkhristinin January 23, 2025 15:27
@nikitaindik
Copy link
Contributor Author

Also, I found a seemingly unused ScheduleItem component here. Looks like its purpose is more or less the same as ScheduleItemField. Should we remove it?

Copy link
Contributor

@vitaliidm vitaliidm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

Can we add a unit test that ensures days displayed correctly? And we good to merge

@nikitaindik nikitaindik force-pushed the new-terms-time-value-bug branch from b7e662c to 0726fe4 Compare January 24, 2025 10:03
@nikitaindik
Copy link
Contributor Author

Thanks for review, @vitaliidm! I've added the test.

@nikitaindik nikitaindik enabled auto-merge (squash) January 24, 2025 10:04
@nikitaindik nikitaindik merged commit 8894c1f into elastic:main Jan 24, 2025
8 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.x

https://github.com/elastic/kibana/actions/runs/12949047912

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
securitySolution 21.3MB 21.3MB +18.0B

History

cc @nikitaindik

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jan 24, 2025
…ze (elastic#207827)

**Resolves: elastic#207348

## Summary
This PR resolves a bug in the editable History Window Size component,
which incorrectly displays "0 seconds" as the default value instead of
"7 days". The issue was caused by passing an array of units `(['m', 'h',
'd'])` using an incorrect prop name.

Also, I fixed stuck last digit being stuck when trying to remove it
**Before my changes: can't remove or reset the last digit**

https://github.com/user-attachments/assets/3a7d28ea-ea71-4ee8-8805-902bae1dc3c1

**After my changes: value resets to minValue on last digit removal**

https://github.com/user-attachments/assets/1cba36bb-9127-4197-871e-62b978b3612c

Work started on: 22-Jan-2025

(cherry picked from commit 8894c1f)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.x

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Jan 24, 2025
…dow Size (#207827) (#208178)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Security Solution] Fix incorrect default value for History Window
Size (#207827)](#207827)

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

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

<!--BACKPORT [{"author":{"name":"Nikita
Indik","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-01-24T11:49:42Z","message":"[Security
Solution] Fix incorrect default value for History Window Size
(#207827)\n\n**Resolves:
https://github.com/elastic/kibana/issues/207348**\n\n## Summary\nThis PR
resolves a bug in the editable History Window Size component,\nwhich
incorrectly displays \"0 seconds\" as the default value instead of\n\"7
days\". The issue was caused by passing an array of units `(['m',
'h',\n'd'])` using an incorrect prop name.\n\nAlso, I fixed stuck last
digit being stuck when trying to remove it\n**Before my changes: can't
remove or reset the last
digit**\n\n\nhttps://github.com/user-attachments/assets/3a7d28ea-ea71-4ee8-8805-902bae1dc3c1\n\n**After
my changes: value resets to minValue on last digit
removal**\n\n\nhttps://github.com/user-attachments/assets/1cba36bb-9127-4197-871e-62b978b3612c\n\n\nWork
started on:
22-Jan-2025","sha":"8894c1f395ce5d30c750db9d5b6c9be4fecac6f7","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","Team:Detections
and Resp","Team: SecuritySolution","Team:Detection Rule
Management","Feature:Rule Creation","Feature:Rule
Edit","backport:version","v8.18.0"],"title":"[Security Solution] Fix
incorrect default value for History Window
Size","number":207827,"url":"https://github.com/elastic/kibana/pull/207827","mergeCommit":{"message":"[Security
Solution] Fix incorrect default value for History Window Size
(#207827)\n\n**Resolves:
https://github.com/elastic/kibana/issues/207348**\n\n## Summary\nThis PR
resolves a bug in the editable History Window Size component,\nwhich
incorrectly displays \"0 seconds\" as the default value instead of\n\"7
days\". The issue was caused by passing an array of units `(['m',
'h',\n'd'])` using an incorrect prop name.\n\nAlso, I fixed stuck last
digit being stuck when trying to remove it\n**Before my changes: can't
remove or reset the last
digit**\n\n\nhttps://github.com/user-attachments/assets/3a7d28ea-ea71-4ee8-8805-902bae1dc3c1\n\n**After
my changes: value resets to minValue on last digit
removal**\n\n\nhttps://github.com/user-attachments/assets/1cba36bb-9127-4197-871e-62b978b3612c\n\n\nWork
started on:
22-Jan-2025","sha":"8894c1f395ce5d30c750db9d5b6c9be4fecac6f7"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/207827","number":207827,"mergeCommit":{"message":"[Security
Solution] Fix incorrect default value for History Window Size
(#207827)\n\n**Resolves:
https://github.com/elastic/kibana/issues/207348**\n\n## Summary\nThis PR
resolves a bug in the editable History Window Size component,\nwhich
incorrectly displays \"0 seconds\" as the default value instead of\n\"7
days\". The issue was caused by passing an array of units `(['m',
'h',\n'd'])` using an incorrect prop name.\n\nAlso, I fixed stuck last
digit being stuck when trying to remove it\n**Before my changes: can't
remove or reset the last
digit**\n\n\nhttps://github.com/user-attachments/assets/3a7d28ea-ea71-4ee8-8805-902bae1dc3c1\n\n**After
my changes: value resets to minValue on last digit
removal**\n\n\nhttps://github.com/user-attachments/assets/1cba36bb-9127-4197-871e-62b978b3612c\n\n\nWork
started on:
22-Jan-2025","sha":"8894c1f395ce5d30c750db9d5b6c9be4fecac6f7"}},{"branch":"8.x","label":"v8.18.0","branchLabelMappingKey":"^v8.18.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Nikita Indik <[email protected]>
JoseLuisGJ pushed a commit to JoseLuisGJ/kibana that referenced this pull request Jan 27, 2025
…ze (elastic#207827)

**Resolves: elastic#207348

## Summary
This PR resolves a bug in the editable History Window Size component,
which incorrectly displays "0 seconds" as the default value instead of
"7 days". The issue was caused by passing an array of units `(['m', 'h',
'd'])` using an incorrect prop name.

Also, I fixed stuck last digit being stuck when trying to remove it
**Before my changes: can't remove or reset the last digit**


https://github.com/user-attachments/assets/3a7d28ea-ea71-4ee8-8805-902bae1dc3c1

**After my changes: value resets to minValue on last digit removal**


https://github.com/user-attachments/assets/1cba36bb-9127-4197-871e-62b978b3612c


Work started on: 22-Jan-2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:version Backport to applied version labels Feature:Rule Creation Security Solution Detection Rule Creation workflow Feature:Rule Edit Security Solution Detection Rule Editing workflow release_note:skip Skip the PR/issue when compiling release notes Team:Detection Rule Management Security Detection Rule Management Team Team:Detections and Resp Security Detection Response Team Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. v8.18.0 v9.0.0
Projects
None yet
4 participants