-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[ResponseOps][AlertsTable] Migrate API hooks to React Query #186448
Labels
Feature:Alerting/AlertsTable
Team:ResponseOps
Label for the ResponseOps team (formerly the Cases and Alerting teams)
Comments
cnasikas
added
Team:ResponseOps
Label for the ResponseOps team (formerly the Cases and Alerting teams)
Feature:Alerting/AlertsTable
and removed
needs-team
Issues missing a team label
labels
Jun 19, 2024
Pinging @elastic/response-ops (Team:ResponseOps) |
This was referenced Jul 10, 2024
While doing this refactor I'm taking the occasion to try and standardize the naming and shape of TanStack Query-based hooks in the alerts area. Naming rule
Arguments
ReturnThe whole query or mutation object, to better standardize the return types across different data fetching hooks and to give the user the freedom to access loading states, refetch functions etc. |
umbopepato
added a commit
that referenced
this issue
Jul 25, 2024
) ## Summary Implements a new `useSearchAlertsQuery` hook based on TanStack Query to replace the `useFetchAlerts` hook, following [this organizational logic](#186448 (comment)). 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 #186448 Should fix #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 <[email protected]>
umbopepato
added a commit
that referenced
this issue
Jul 29, 2024
#188320) ## Summary Migrates the `useFetchBrowserFieldCapabilities` hook (renamed to `useFetchAlertsFieldsQuery`) to TanStack Query, following [this organizational logic](#186448 (comment)). 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 4. Check that the fields browser shows and works correctly (`Fields` button in the alerts table header) Closes point 2 of #186448 ### 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 <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Feature:Alerting/AlertsTable
Team:ResponseOps
Label for the ResponseOps team (formerly the Cases and Alerting teams)
The alerts table uses various hooks to make API calls. Most of the hooks are using React Query to perform these API calls, The
useFetchAlerts
anduseFetchBrowserFieldCapabilities
do not. We should migrate the rest of the hook to use React Query.DoD
The text was updated successfully, but these errors were encountered: