* Add wrapper function to make an AbortSignal arg optional
Components commonly do not care about aborting a request, but are
required to pass `{ signal: new AbortController().signal }` anyway. This
addresses that use case.
* Adds hook for retrieving the component's mount status
This is useful for dealing with asynchronous tasks that may complete
after the invoking component has been unmounted. Using this hook,
callbacks can determine whether they're currently unmounted, i.e.
whether it's safe to set state or not.
* Add our own implemetation of useAsync
This does not suffer from the Typescript issues that the react-use
implementation had, and is generally a cleaner hook than useAsyncTask as
it makes no assumptions about the underlying function.
* Update exported Lists API hooks to use useAsync and withOptionalSignal
Removes the now-unused useAsyncTask as well.
* Add some JSDoc for our new functions
* add _meta field to index templates
* fix typescript issue
* make package an object
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
The observability plugin is now code-owned by a new observability-ui GH team to avoid pinging 4 separate teams for mandatory reviews when that plugin changes.
* refactor: 💡 rename folder to "explore_data"
* style: 💄 check for "share" plugin in more semantic way
"explore data" actions use Discover URL generator, which is registered
in "share" plugin, which is optional plugin, so we check for its
existance, because otherwise URL generator is not available.
* refactor: 💡 move KibanaURL to a separate file
* feat: 🎸 add "Explore underlying data" in-chart action
* fix: 🐛 fix imports after refactor
* feat: 🎸 add start.filtersFromContext to embeddable plugin
* feat: 🎸 add type checkers to data plugin
* feat: 🎸 better handle empty filters in Discover URL generator
* feat: 🎸 implement .getUrl() method of explore data in-chart act
* feat: 🎸 add embeddable.filtersAndTimeRangeFromContext()
* feat: 🎸 improve getUrl() method of explore data action
* test: 💍 update test mock
* fix possible stale hashHistory.location in discover
* style: 💄 ensureHashHistoryLocation -> syncHistoryLocations
* docs: ✏️ update autogenerated docs
* test: 💍 add in-chart "Explore underlying data" unit tests
* test: 💍 add in-chart "Explore underlying data" functional tests
* test: 💍 clean-up custom time range after panel action tests
* chore: 🤖 fix embeddable plugin mocks
* chore: 🤖 fix another mock
* test: 💍 add support for new action to pie chart service
* feat: 🎸 enable "Explore underlying data" action for Lens vis
* test: 💍 make tests green again
* refactor: 💡 rename trigger contexts
* chore: 🤖 fix TypeScript errors
Co-authored-by: Anton Dosov <anton.dosov@elastic.co>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* remove unused piece of state
* Move related event total calculation to selector
* rename xScale
* remove `let`
* Move `dispatch` call out of HTTP try-catch
* add POC logic to modify the 'from' param in the search
* fixes formatting for appending gap diff to from
* computes new max signals based on how many intervals of rule runs were missed when gap in consecutive rule runs is detected
* adds logging, fixes bug where we could end up with negative values for diff, adds calculatedFrom to the search after query
* remove console.log and for some reason two eslint disables were added so i removed one of them
* rename variables, add test based on log message - need to figure out a better way to test this
* remove unused import
* fully re-worked the algorithm for searching discrete time periods, still need search_after because a user could submit a rule with a custom maxSignals so that would still serve a purpose. This needs heavy refactoring though, and tests.
* updated loop to include maxSignals per time interval tuple, this way we guarantee maxSignals per full rule interval. Needs some refactoring though.
* move logic into utils function, utils function still needs refactoring
* adds unit tests and cleans up new util function for determining time intervals for searching to occur
* more code cleanup
* remove more logging statements
* fix type errors
* updates unit tests and fixes bug where search result would return 0 hits but we were accessing property on non-existent hit item
* fix rebase conflict
* fixes a bug where a negative gap could exist if a rule ran before the lookback time, also fixes a bug where the search and bulk loop would return false when successful.
* gap is a duration, not a number.
* remove logging variable
* remove logging function from test
* fix type import from rebase with master
* updates missed test when rebased with master, removes unused import
* modify log statements to include meta information for logged rule events, adds tests
* remove unnecessary ts-ignores
* indentation on stringify
* adds a test to ensure we are parsing the elapsed time correctly
* Switches mount callbacks to only use start deps
Fixes#58014
* Sets up skeleton logs data fetchers for overview
* Fixes type hacks for logs fetcher
* Prevent kibana from crashing on initial load
* Fixes types and linting errors
* Fixes some linting import/export issues
Co-authored-by: Alejandro Fernández Gómez <alejandro.fernandez@elastic.co>