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

[Cases] Table Solution Filter Not Rendering Any Checked Option When All Selected #172460

Merged
merged 8 commits into from
Dec 13, 2023

Conversation

jcger
Copy link
Contributor

@jcger jcger commented Dec 4, 2023

Sumarry

Closes #172454

Testing

  • 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

Flaky test runner: https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/4506

@jcger jcger added Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) Feature:Cases Cases feature v8.12.0 v8.13.0 labels Dec 11, 2023
@@ -645,82 +644,6 @@ describe('AllCasesListGeneric', () => {
});

describe('Solutions', () => {
it('should set the owner to all available solutions when deselecting all solutions', async () => {
Copy link
Member

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,
Copy link
Member

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.

Comment on lines +38 to +46
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 };
Copy link
Member

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.

@cnasikas cnasikas marked this pull request as ready for review December 12, 2023 13:08
@cnasikas cnasikas requested a review from a team as a code owner December 12, 2023 13:08
@elasticmachine
Copy link
Contributor

Pinging @elastic/response-ops (Team:ResponseOps)

@elasticmachine
Copy link
Contributor

Pinging @elastic/response-ops-cases (Feature:Cases)

@cnasikas cnasikas added bug Fixes for quality problems that affect the customer experience release_note:skip Skip the PR/issue when compiling release notes labels Dec 12, 2023
@cnasikas
Copy link
Member

/ci

@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #41 / discover "before all" hook in "discover"
  • [job] [logs] FTR Configs #66 / serverless security UI Serverless Security Cases Case View "after all" hook in "Case View"

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
cases 443.8KB 443.9KB +117.0B

History

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

Copy link
Contributor

@js-jankisalvi js-jankisalvi left a 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 = {
Copy link
Contributor

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! 👍

@cnasikas cnasikas merged commit b6d291d into elastic:main Dec 13, 2023
4 checks passed
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Dec 13, 2023
…ll Selected (elastic#172460)

Co-authored-by: Christos Nasikas <[email protected]>
(cherry picked from commit b6d291d)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.12

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 Dec 13, 2023
… 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience Feature:Cases Cases feature release_note:skip Skip the PR/issue when compiling release notes Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v8.12.0 v8.13.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Cases] Table Solution Filter Not Rendering Any Checked Option When All Selected
6 participants