-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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] Alert Page Controls do not take Alert Table "Additional Filters" into account. #155861
[Security Solution] [Fix] Alert Page Controls do not take Alert Table "Additional Filters" into account. #155861
Conversation
Do you plan on making the change for the enabling |
}, | ||
[clearEventsLoading, clearEventsDeleted, setStatusFilter] | ||
); | ||
const onFilterGroupChangedCallback = useCallback((newFilterGroup: Status) => {}, []); |
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.
This isn't doing anything anymore? Do we not need to clear the loading/deleted states or update the status filter onChange anymore?
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.
+1, wondering this as well.
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.
@janmonschke and @michaelolo24
Sorry, this change should have been in another branch. I have reverted this. In a separate branch, I was trying to remove old Alert State toggle from the alert page so that feature flag of Alert Page Controls will no longer be needed.
But now I am not sure, because we need to keep it in the minor releases of 8.7 so for now I will keep it and we can remove it later. Hence, reverted that change to same as main
const store = createStore(newState, SUB_PLUGINS_REDUCER, kibanaObservable, storage); | ||
return store; |
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.
const store = createStore(newState, SUB_PLUGINS_REDUCER, kibanaObservable, storage); | |
return store; | |
return createStore(newState, SUB_PLUGINS_REDUCER, kibanaObservable, storage); |
💅
One less const store
in this file ;)
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.
Done.
); | ||
}); | ||
|
||
expect(MockedFilterGroup.mock.calls[0][0].filters[0]).toMatchObject( |
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.
I wonder if it's possible to use toHaveBeenCalledWith
here to avoid reaching into the specifics of the mock implementation.
E.g.
expect(MockedFilterGroup.toMatchObject(expect.objectContaining({
filters: expect.objectContaining({
...
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.
Done.
}); | ||
|
||
expect(MockedFilterGroup.mock.calls[0][0].filters[0]).toMatchObject( |
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.
And then here as well
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.
Done.
}, | ||
[clearEventsLoading, clearEventsDeleted, setStatusFilter] | ||
); | ||
const onFilterGroupChangedCallback = useCallback((newFilterGroup: Status) => {}, []); |
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.
+1, wondering this as well.
I can do that separately as I need some discussion on the same. Thanks. |
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 making the changes! Tested locally and the filters respond as expected to changes in the table additional filters
👍🏾
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Async chunks
Unknown metric groupsESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: |
… "Additional Filters" into account. (elastic#155861) ## Summary This PR handles : [Security Solution] New alert filters are not taking into consideration alert table filters elastic#155173 and elastic#156252 Currently, Alert Page Controls do not take Alert Table Checkboxes ( Building block + Threat indicator alerts only ) into account. This PR enables the effect of Alert Table Checkboxes on Alert Page controls | Before | After | |--|--| | <video src="https://user-images.githubusercontent.com/7485038/234568673-b05ffc32-09bc-4378-aecb-bb64dbc5cbb6.mov" /> | <video src="https://user-images.githubusercontent.com/7485038/234562759-6309d6a0-f7db-48fd-bd9e-62788a1c89fe.mov"/> | ### Checklist Delete any items that are not applicable to this PR. - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios. (cherry picked from commit aeded80)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
… Table "Additional Filters" into account. (#155861) (#156388) # Backport This will backport the following commits from `main` to `8.8`: - [[Security Solution] [Fix] Alert Page Controls do not take Alert Table "Additional Filters" into account. (#155861)](#155861) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Jatin Kathuria","email":"jatin.kathuria@elastic.co"},"sourceCommit":{"committedDate":"2023-05-02T13:47:12Z","message":"[Security Solution] [Fix] Alert Page Controls do not take Alert Table \"Additional Filters\" into account. (#155861)\n\n## Summary\r\n\r\nThis PR handles : [Security Solution] New alert filters are not taking\r\ninto consideration alert table filters #155173 and #156252\r\n\r\nCurrently, Alert Page Controls do not take Alert Table Checkboxes (\r\nBuilding block + Threat indicator alerts only ) into account. This PR\r\nenables the effect of Alert Table Checkboxes on Alert Page controls\r\n\r\n| Before | After |\r\n|--|--|\r\n| <video\r\nsrc=\"https://user-images.githubusercontent.com/7485038/234568673-b05ffc32-09bc-4378-aecb-bb64dbc5cbb6.mov\"\r\n/> | <video\r\nsrc=\"https://user-images.githubusercontent.com/7485038/234562759-6309d6a0-f7db-48fd-bd9e-62788a1c89fe.mov\"/>\r\n|\r\n\r\n\r\n### Checklist\r\n\r\nDelete any items that are not applicable to this PR.\r\n\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios.","sha":"aeded80d8625833a3dee83bb723732631b32c6a9","branchLabelMapping":{"^v8.9.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Threat Hunting:Investigations","v8.8.0","v8.9.0"],"number":155861,"url":"https://github.com/elastic/kibana/pull/155861","mergeCommit":{"message":"[Security Solution] [Fix] Alert Page Controls do not take Alert Table \"Additional Filters\" into account. (#155861)\n\n## Summary\r\n\r\nThis PR handles : [Security Solution] New alert filters are not taking\r\ninto consideration alert table filters #155173 and #156252\r\n\r\nCurrently, Alert Page Controls do not take Alert Table Checkboxes (\r\nBuilding block + Threat indicator alerts only ) into account. This PR\r\nenables the effect of Alert Table Checkboxes on Alert Page controls\r\n\r\n| Before | After |\r\n|--|--|\r\n| <video\r\nsrc=\"https://user-images.githubusercontent.com/7485038/234568673-b05ffc32-09bc-4378-aecb-bb64dbc5cbb6.mov\"\r\n/> | <video\r\nsrc=\"https://user-images.githubusercontent.com/7485038/234562759-6309d6a0-f7db-48fd-bd9e-62788a1c89fe.mov\"/>\r\n|\r\n\r\n\r\n### Checklist\r\n\r\nDelete any items that are not applicable to this PR.\r\n\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios.","sha":"aeded80d8625833a3dee83bb723732631b32c6a9"}},"sourceBranch":"main","suggestedTargetBranches":["8.8"],"targetPullRequestStates":[{"branch":"8.8","label":"v8.8.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.9.0","labelRegex":"^v8.9.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/155861","number":155861,"mergeCommit":{"message":"[Security Solution] [Fix] Alert Page Controls do not take Alert Table \"Additional Filters\" into account. (#155861)\n\n## Summary\r\n\r\nThis PR handles : [Security Solution] New alert filters are not taking\r\ninto consideration alert table filters #155173 and #156252\r\n\r\nCurrently, Alert Page Controls do not take Alert Table Checkboxes (\r\nBuilding block + Threat indicator alerts only ) into account. This PR\r\nenables the effect of Alert Table Checkboxes on Alert Page controls\r\n\r\n| Before | After |\r\n|--|--|\r\n| <video\r\nsrc=\"https://user-images.githubusercontent.com/7485038/234568673-b05ffc32-09bc-4378-aecb-bb64dbc5cbb6.mov\"\r\n/> | <video\r\nsrc=\"https://user-images.githubusercontent.com/7485038/234562759-6309d6a0-f7db-48fd-bd9e-62788a1c89fe.mov\"/>\r\n|\r\n\r\n\r\n### Checklist\r\n\r\nDelete any items that are not applicable to this PR.\r\n\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios.","sha":"aeded80d8625833a3dee83bb723732631b32c6a9"}}]}] BACKPORT--> Co-authored-by: Jatin Kathuria <jatin.kathuria@elastic.co>
Summary
This PR handles : [Security Solution] New alert filters are not taking into consideration alert table filters #155173 and #156252
Currently, Alert Page Controls do not take Alert Table Checkboxes ( Building block + Threat indicator alerts only ) into account. This PR enables the effect of Alert Table Checkboxes on Alert Page controls
Screen.Recording.2023-04-26.at.14.00.50.mov
Screen.Recording.2023-04-26.at.13.33.20.mov
Checklist
Delete any items that are not applicable to this PR.