forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Cases] Persist the cases table state on the URL (elastic#175237)
## Summary This PR persists the whole state of the cases table in the URL. Specifically: - The format of the URL changed. The Rison format will be used which is widely used in Kibana. - The old format will be supported to support BWC. - All filters are persisted in the URL including custom fields. - The URL is the source of truth and it takes precedence over everything. - The state is also persisted in the local storage. The state from the local storage is loaded only when the URL is empty. - The state in the local storage is stored under a new key called `cases.list.state`. The old key will not be taken into account. - Navigate through pages and back to the cases table do not lose the state of the table. - ## Testing - Test that the filtering is working as expected with all possible filters and values. - Test that the URL is updating correctly as you change the filters and the pagination. - Test that submitting a URL takes priority over the state persisted in the local storage. - Test that submitting a URL changes the filters and the pagination as expected. - Test that submitting a URL makes any hidden filters visible. - Test that legacy URLs are working as expected. - Put malformed values and keys in the URL and see how the application behaves. - Test that the extra query params put by the Security solution persisted and do not affect the cases filtering. - Test that the configuration of the filters (which ones are visible and which ones are hidden) is not affected. - Hide all filters and put a URL that contains all filters. They should be shown. - Remove the local storage state and check how the application behaves when you enter a URL with filters - Ensure that when you navigate between pages your filtering is persisted. - Ensure that the state from the local storage is loaded when you enter a URL without query parameters. - No assignees filtering is working. - Passing non-existing custom fields on the URL does not lead to an error. - Paste a URL that is not the same as the state in the local storage, navigate to a case, and come back to the cases table. The filters set by the URL should be the same. Blocked by: elastic#176546 Flaky test runner: https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/5114, https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/5119 ### Checklist Delete any items that are not applicable to this PR. - [x] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md) - [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 - [x] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed ### For maintainers - [x] This was checked for breaking API changes and was [labeled appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) ## Release notes Persist all filter options of the cases table, including custom fields, in the URL. The filtering also persists when navigating back and forth between pages. --------- Co-authored-by: kibanamachine <[email protected]>
- Loading branch information
1 parent
3503a11
commit d696e91
Showing
58 changed files
with
3,228 additions
and
1,103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
x-pack/plugins/cases/public/components/all_cases/constants.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
export const CUSTOM_FIELD_KEY_PREFIX = 'cf_'; | ||
export const ALL_CASES_STATE_URL_KEY = 'cases'; | ||
|
||
export const LEGACY_SUPPORTED_STATE_KEYS = [ | ||
'status', | ||
'severity', | ||
'page', | ||
'perPage', | ||
'sortField', | ||
'sortOrder', | ||
] as const; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.