-
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
[Cases] Table Solution Filter Not Rendering Any Checked Option When All Selected #172460
Conversation
@@ -645,82 +644,6 @@ describe('AllCasesListGeneric', () => { | |||
}); | |||
|
|||
describe('Solutions', () => { | |||
it('should set the owner to all available solutions when deselecting all solutions', async () => { |
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.
The logic and the test moved to the useGetCases
hook.
const firstAvailableStatus = head(difference(caseStatuses, hiddenStatuses)); | ||
const initialFilterOptions = { | ||
...(!isEmpty(hiddenStatuses) && firstAvailableStatus && { status: [firstAvailableStatus] }), | ||
owner: hasOwner ? owner : availableSolutions, |
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.
Logic moved inside the useGetCases
hook.
const availableSolutions = useAvailableCasesOwners(getAllPermissionsExceptFrom('delete')); | ||
|
||
const hasOwner = !!owner.length; | ||
const initialOwner = hasOwner ? owner : availableSolutions; | ||
|
||
const ownerFilter = | ||
params.filterOptions?.owner != null && params.filterOptions.owner.length > 0 | ||
? { owner: params.filterOptions.owner } | ||
: { owner: initialOwner }; |
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.
Logic moved from the components to this hook.
Pinging @elastic/response-ops (Team:ResponseOps) |
Pinging @elastic/response-ops-cases (Feature:Cases) |
/ci |
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Async chunks
History
To update your PR or re-run it, just comment with: |
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.
LGTM 👍
- Verify that the solutions filter works correctly. Click on all solutions to verify that you can filter by all of them ✅
- Verify that the solution filter is not showing if you have access only to one solution ✅
- Verify that the solution filter shows only the solution you have access to (for example Security solution and Stack) ✅
- Verify that the solution filter is not showing when you attach alerts from within the solutions and you see the correct cases ✅
- Verify that you can see the correct cases on each solution when you have access to all solutions ✅
it('should set all owners when no owner is provided', async () => { | ||
appMockRender = createAppMockRenderer({ owner: [] }); | ||
|
||
appMockRender.coreStart.application.capabilities = { |
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.
Good to know we can mock capabilities this way! 👍
…ll Selected (elastic#172460) Co-authored-by: Christos Nasikas <[email protected]> (cherry picked from commit b6d291d)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
… When All Selected (#172460) (#173244) # Backport This will backport the following commits from `main` to `8.12`: - [[Cases] Table Solution Filter Not Rendering Any Checked Option When All Selected (#172460)](#172460) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Julian Gernun","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-12-13T09:30:49Z","message":"[Cases] Table Solution Filter Not Rendering Any Checked Option When All Selected (#172460)\n\nCo-authored-by: Christos Nasikas <[email protected]>","sha":"b6d291d1034752515b56439d4b2437f085cd2147","branchLabelMapping":{"^v8.13.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:skip","Team:ResponseOps","Feature:Cases","v8.12.0","v8.13.0"],"number":172460,"url":"https://github.com/elastic/kibana/pull/172460","mergeCommit":{"message":"[Cases] Table Solution Filter Not Rendering Any Checked Option When All Selected (#172460)\n\nCo-authored-by: Christos Nasikas <[email protected]>","sha":"b6d291d1034752515b56439d4b2437f085cd2147"}},"sourceBranch":"main","suggestedTargetBranches":["8.12"],"targetPullRequestStates":[{"branch":"8.12","label":"v8.12.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.13.0","labelRegex":"^v8.13.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/172460","number":172460,"mergeCommit":{"message":"[Cases] Table Solution Filter Not Rendering Any Checked Option When All Selected (#172460)\n\nCo-authored-by: Christos Nasikas <[email protected]>","sha":"b6d291d1034752515b56439d4b2437f085cd2147"}}]}] BACKPORT--> Co-authored-by: Julian Gernun <[email protected]>
Sumarry
Closes #172454
Testing
Flaky test runner: https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/4506