kibana/test
Davis McPhee 96d6b899ac
[Unified Histogram] [Discover] Unified Histogram solutions cleanup (#146352)
## Summary

This PR includes a number of updates to Unified Histogram to prepare for
sharing with solutions, as well as updating its usage in Discover:

Unified Histogram:
- Adds a `disableAutoFetching` prop, similar to Unified Field List, to
disable automatic Unified Histogram refetching based on prop changes.
- Accepts an `input$` observable prop that can be used to control manual
refetches.
- Removes `refetchId` used internally and replaces it with an
observables based approach to simplify refetch logic.
- Introduces a `use_stable_callback` utility hook to create callback
functions with stable identities which simplifies `useCallback` logic —
should be replaced with `useEvent` or whatever the React team comes up
with to solve this specific issue when available:
https://github.com/reactjs/rfcs/pull/220.
- Eliminates debouncing logic in Unified Histogram since it was hacky —
manual refetching should be used instead if debouncing is needed.
- Accepts `query`, `filters`, and `timeRange` props to remove
dependencies on specific services.
- Updates `use_request_params` to export `getTimeRange` and
`updateTimeRange` functions for easier absolute time range handling.
- Exposes some Lens embeddable props to allow further customizing
Unified Histogram behaviour.

Discover:
- Exports a `fetch$` observable from `use_saved_search` to allow
listening for when data fetches should be triggered.
- Uses new manual refetching support in Unified Histogram to simplify
refetching logic.
- Passes `query`, `filters`, and `timeRange` props to Unified Histogram.

### Checklist

- [ ] ~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)~
- [ ]
~[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials~
- [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
- [ ] ~Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard
accessibility](https://webaim.org/techniques/keyboard/))~
- [ ] ~Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))~
- [ ] ~If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)~
- [ ] ~This renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))~
- [ ] ~This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)~

### For maintainers

- [ ] 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)

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-01-18 09:56:43 -04:00
..
accessibility [Discover] Unskip a11y flaky test (#148300) 2023-01-04 09:01:34 +01:00
analytics Move real plugins out of 'fixtures' dirs (#148756) 2023-01-12 12:38:49 -07:00
api_integration [Telemetry] Set telemetry SO as hidden (#147631) 2022-12-20 09:13:36 -07:00
common Move real plugins out of 'fixtures' dirs (#148756) 2023-01-12 12:38:49 -07:00
examples Transpile packages on demand, validate all TS projects (#146212) 2022-12-22 19:00:29 -06:00
functional [Unified Histogram] [Discover] Unified Histogram solutions cleanup (#146352) 2023-01-18 09:56:43 -04:00
harden Add 'fork' to child_process hardening tests (#139222) 2022-08-23 07:53:28 -04:00
health_gateway Transpile packages on demand, validate all TS projects (#146212) 2022-12-22 19:00:29 -06:00
interactive_setup_api_integration Move real plugins out of 'fixtures' dirs (#148756) 2023-01-12 12:38:49 -07:00
interactive_setup_functional Move real plugins out of 'fixtures' dirs (#148756) 2023-01-12 12:38:49 -07:00
interpreter_functional Transpile packages on demand, validate all TS projects (#146212) 2022-12-22 19:00:29 -06:00
node_roles_functional Transpile packages on demand, validate all TS projects (#146212) 2022-12-22 19:00:29 -06:00
package Adds base implementation of the Kibana Health Gateway. (#141172) 2022-11-07 09:14:42 -07:00
plugin_functional [Security Solution] Adds support for testing of prerelease detection rules (#148426) 2023-01-17 15:02:57 -07:00
scripts Move real plugins out of 'fixtures' dirs (#148756) 2023-01-12 12:38:49 -07:00
server_integration Move real plugins out of 'fixtures' dirs (#148756) 2023-01-12 12:38:49 -07:00
ui_capabilities/newsfeed_err [ftr] automatically determine config run order (#130983) 2022-05-04 17:05:58 -05:00
tsconfig.json Move real plugins out of 'fixtures' dirs (#148756) 2023-01-12 12:38:49 -07:00