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] Alert Page Controls do not take Alert Table "Additional Filters" into account. #155861

Merged

Conversation

logeekal
Copy link
Contributor

@logeekal logeekal commented Apr 26, 2023

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

Before After
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.

@logeekal logeekal added the Team:Threat Hunting:Investigations Security Solution Investigations Team label Apr 26, 2023
@logeekal logeekal requested a review from a team as a code owner April 26, 2023 12:02
@logeekal logeekal changed the title fix: include alert table Filters in Page Controls [Security Solution] [Fix] Alert Page Controls do not take Alert Table "Additional Filters" into account. Apr 26, 2023
@logeekal logeekal added v8.8.0 release_note:skip Skip the PR/issue when compiling release notes backport:skip This commit does not require backporting labels Apr 26, 2023
@michaelolo24
Copy link
Contributor

Do you plan on making the change for the enabling building_block_alerts by default on this branch or a separate branch?

},
[clearEventsLoading, clearEventsDeleted, setStatusFilter]
);
const onFilterGroupChangedCallback = useCallback((newFilterGroup: Status) => {}, []);
Copy link
Contributor

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?

Copy link
Contributor

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.

Copy link
Contributor Author

@logeekal logeekal Apr 28, 2023

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

Comment on lines 177 to 178
const store = createStore(newState, SUB_PLUGINS_REDUCER, kibanaObservable, storage);
return store;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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 ;)

Copy link
Contributor Author

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(
Copy link
Contributor

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({
    ...

Copy link
Contributor Author

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(
Copy link
Contributor

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

Copy link
Contributor Author

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) => {}, []);
Copy link
Contributor

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.

@logeekal
Copy link
Contributor Author

logeekal commented May 2, 2023

Do you plan on making the change for the enabling building_block_alerts by default on this branch or a separate branch?

I can do that separately as I need some discussion on the same. Thanks.

@logeekal logeekal added backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) v8.9.0 and removed backport:skip This commit does not require backporting backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) labels May 2, 2023
Copy link
Contributor

@michaelolo24 michaelolo24 left a 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 👍🏾

@logeekal logeekal enabled auto-merge (squash) May 2, 2023 12:14
@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] Security Solution Tests #3 / timeline flyout button the (+) button popover menu owns focus

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 9.1MB 9.1MB +33.0B
Unknown metric groups

ESLint disabled line counts

id before after diff
enterpriseSearch 19 21 +2
securitySolution 399 402 +3
total +5

Total ESLint disabled count

id before after diff
enterpriseSearch 20 22 +2
securitySolution 479 482 +3
total +5

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@logeekal logeekal merged commit aeded80 into elastic:main May 2, 2023
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request May 2, 2023
… "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)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.8

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 May 2, 2023
… 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:skip Skip the PR/issue when compiling release notes Team:Threat Hunting:Investigations Security Solution Investigations Team v8.8.0 v8.9.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants