kibana/x-pack/test/rule_registry
Umberto Pepato bd3032b5fa
[ResponseOps][Alerts] Migrate alerts fetching to TanStack Query (#186978)
## Summary

Implements a new `useSearchAlertsQuery` hook based on TanStack Query to
replace the `useFetchAlerts` hook, following [this organizational
logic](https://github.com/elastic/kibana/issues/186448#issuecomment-2228853337).

This PR focuses mainly on the fetching logic itself, leaving the
surrounding API surface mostly unchanged since it will be likely
addressed in subsequent PRs.

## To verify

1. Create rules that fire alerts in different solutions
2. Check that the alerts table usages work correctly ({O11y, Security,
Stack} alerts and rule details pages, ...)
1. Check that the alerts displayed in the table are coherent with the
solution, KQL query, time filter, pagination
    2. Check that pagination changes are reflected in the table
3. Check that changing the query when in pages > 0 resets the pagination
to the first page

Closes point 1 of https://github.com/elastic/kibana/issues/186448
Should fix https://github.com/elastic/kibana/issues/171738

### Checklist

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

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-07-25 08:36:56 -05:00
..
common [RAM] Use ruletype to determine alert indices (#163574) 2023-08-21 14:52:36 -07:00
security_and_spaces [ResponseOps][Alerts] Migrate alerts fetching to TanStack Query (#186978) 2024-07-25 08:36:56 -05:00
spaces_only Onboard Transaction Error Rate rule type with FAAD (#179496) 2024-04-18 08:44:16 -07:00