mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
Bump react-query@4 (#137429)
This commit is contained in:
parent
89276af0c0
commit
a5ef5916a3
166 changed files with 567 additions and 524 deletions
|
@ -91,6 +91,7 @@
|
|||
"**/refractor/prismjs": "~1.27.0",
|
||||
"**/trim": "1.0.1",
|
||||
"**/typescript": "4.6.3",
|
||||
"@tanstack/query-core": "^4.2.1",
|
||||
"globby/fast-glob": "3.2.7",
|
||||
"puppeteer/node-fetch": "^2.6.7"
|
||||
},
|
||||
|
@ -360,6 +361,8 @@
|
|||
"@opentelemetry/semantic-conventions": "^1.4.0",
|
||||
"@reduxjs/toolkit": "^1.6.1",
|
||||
"@slack/webhook": "^5.0.4",
|
||||
"@tanstack/react-query": "^4.2.1",
|
||||
"@tanstack/react-query-devtools": "^4.2.1",
|
||||
"@turf/along": "6.0.1",
|
||||
"@turf/area": "6.0.1",
|
||||
"@turf/bbox": "6.0.1",
|
||||
|
@ -519,7 +522,6 @@
|
|||
"react-moment-proptypes": "^1.7.0",
|
||||
"react-monaco-editor": "^0.41.2",
|
||||
"react-popper-tooltip": "^2.10.1",
|
||||
"react-query": "^3.39.1",
|
||||
"react-redux": "^7.2.0",
|
||||
"react-resizable": "^1.7.5",
|
||||
"react-resize-detector": "^4.2.0",
|
||||
|
|
|
@ -168,7 +168,7 @@
|
|||
},
|
||||
{
|
||||
"groupName": "react-query",
|
||||
"packageNames": ["react-query"],
|
||||
"packageNames": ["@tanstack/react-query", "@tanstack/react-query-devtools"],
|
||||
"reviewers": [
|
||||
"team:response-ops",
|
||||
"team:kibana-cloud-security-posture",
|
||||
|
|
|
@ -12,7 +12,7 @@ import { ThemeProvider } from 'styled-components';
|
|||
|
||||
import { render as reactRender, RenderOptions, RenderResult } from '@testing-library/react';
|
||||
import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public';
|
||||
import { QueryClient, QueryClientProvider } from 'react-query';
|
||||
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
||||
import { SECURITY_SOLUTION_OWNER } from '../../../common/constants';
|
||||
import { CasesCapabilities, CasesFeatures, CasesPermissions } from '../../../common/ui/types';
|
||||
import { CasesProvider } from '../../components/cases_context';
|
||||
|
|
|
@ -15,7 +15,7 @@ import {
|
|||
EuiModalHeaderTitle,
|
||||
} from '@elastic/eui';
|
||||
import styled from 'styled-components';
|
||||
import { QueryClientProvider } from 'react-query';
|
||||
import { QueryClientProvider } from '@tanstack/react-query';
|
||||
import { Case, CaseStatusWithAllStatus } from '../../../../common/ui/types';
|
||||
import * as i18n from '../../../common/translations';
|
||||
import { AllCasesList } from '../all_cases_list';
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
import React, { lazy, Suspense, useCallback } from 'react';
|
||||
import { Redirect, Switch } from 'react-router-dom';
|
||||
import { Route } from '@kbn/kibana-react-plugin/public';
|
||||
import { QueryClientProvider } from 'react-query';
|
||||
import { QueryClientProvider } from '@tanstack/react-query';
|
||||
import { EuiLoadingSpinner } from '@elastic/eui';
|
||||
import { AllCases } from '../all_cases';
|
||||
import { CreateCase } from '../create';
|
||||
|
|
|
@ -171,7 +171,7 @@ describe('CaseView', () => {
|
|||
const queryClientSpy = jest.spyOn(appMockRenderer.queryClient, 'invalidateQueries');
|
||||
const result = appMockRenderer.render(<CaseView {...caseViewProps} />);
|
||||
userEvent.click(result.getByTestId('case-refresh'));
|
||||
expect(queryClientSpy).toHaveBeenCalledWith('case');
|
||||
expect(queryClientSpy).toHaveBeenCalledWith(['case']);
|
||||
});
|
||||
|
||||
describe('when a `refreshRef` prop is provided', () => {
|
||||
|
@ -203,7 +203,7 @@ describe('CaseView', () => {
|
|||
it('should refresh actions and comments', async () => {
|
||||
refreshRef!.current!.refreshCase();
|
||||
await waitFor(() => {
|
||||
expect(queryClientSpy).toHaveBeenCalledWith(CASE_VIEW_CACHE_KEY);
|
||||
expect(queryClientSpy).toHaveBeenCalledWith([CASE_VIEW_CACHE_KEY]);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
import { useCallback } from 'react';
|
||||
import { useQueryClient } from 'react-query';
|
||||
import { useQueryClient } from '@tanstack/react-query';
|
||||
import { CASE_TAGS_CACHE_KEY, CASE_VIEW_CACHE_KEY } from '../../containers/constants';
|
||||
|
||||
/**
|
||||
|
@ -20,7 +20,7 @@ import { CASE_TAGS_CACHE_KEY, CASE_VIEW_CACHE_KEY } from '../../containers/const
|
|||
export const useRefreshCaseViewPage = () => {
|
||||
const queryClient = useQueryClient();
|
||||
return useCallback(() => {
|
||||
queryClient.invalidateQueries(CASE_VIEW_CACHE_KEY);
|
||||
queryClient.invalidateQueries(CASE_TAGS_CACHE_KEY);
|
||||
queryClient.invalidateQueries([CASE_VIEW_CACHE_KEY]);
|
||||
queryClient.invalidateQueries([CASE_TAGS_CACHE_KEY]);
|
||||
}, [queryClient]);
|
||||
};
|
||||
|
|
|
@ -5,6 +5,6 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { QueryClient } from 'react-query';
|
||||
import { QueryClient } from '@tanstack/react-query';
|
||||
|
||||
export const casesQueryClient = new QueryClient();
|
||||
|
|
|
@ -9,7 +9,7 @@ import React from 'react';
|
|||
import styled, { createGlobalStyle } from 'styled-components';
|
||||
import { EuiFlyout, EuiFlyoutHeader, EuiTitle, EuiFlyoutBody } from '@elastic/eui';
|
||||
|
||||
import { QueryClientProvider } from 'react-query';
|
||||
import { QueryClientProvider } from '@tanstack/react-query';
|
||||
import * as i18n from '../translations';
|
||||
import { Case } from '../../../../common/ui/types';
|
||||
import { CreateCaseForm } from '../form';
|
||||
|
|
|
@ -14,11 +14,38 @@ exports[`EditableTitle renders 1`] = `
|
|||
"retry": false,
|
||||
},
|
||||
},
|
||||
"logger": BufferedConsole {
|
||||
"Console": [Function],
|
||||
"_buffer": Array [],
|
||||
"_counters": Object {},
|
||||
"_groupDepth": 0,
|
||||
"_timers": Object {},
|
||||
"assert": [Function],
|
||||
"clear": [Function],
|
||||
"count": [Function],
|
||||
"countReset": [Function],
|
||||
"debug": [Function],
|
||||
"dir": [Function],
|
||||
"dirxml": [Function],
|
||||
"error": [Function],
|
||||
"group": [Function],
|
||||
"groupCollapsed": [Function],
|
||||
"groupEnd": [Function],
|
||||
"info": [Function],
|
||||
"log": [Function],
|
||||
"table": [Function],
|
||||
"time": [Function],
|
||||
"timeEnd": [Function],
|
||||
"timeLog": [Function],
|
||||
"trace": [Function],
|
||||
"warn": [Function],
|
||||
},
|
||||
"mutationCache": MutationCache {
|
||||
"config": Object {},
|
||||
"listeners": Array [],
|
||||
"mutationId": 0,
|
||||
"mutations": Array [],
|
||||
"subscribe": [Function],
|
||||
},
|
||||
"mutationDefaults": Array [],
|
||||
"queryCache": QueryCache {
|
||||
|
@ -26,6 +53,7 @@ exports[`EditableTitle renders 1`] = `
|
|||
"listeners": Array [],
|
||||
"queries": Array [],
|
||||
"queriesMap": Object {},
|
||||
"subscribe": [Function],
|
||||
},
|
||||
"queryDefaults": Array [],
|
||||
}
|
||||
|
|
|
@ -14,11 +14,38 @@ exports[`HeaderPage it renders 1`] = `
|
|||
"retry": false,
|
||||
},
|
||||
},
|
||||
"logger": BufferedConsole {
|
||||
"Console": [Function],
|
||||
"_buffer": Array [],
|
||||
"_counters": Object {},
|
||||
"_groupDepth": 0,
|
||||
"_timers": Object {},
|
||||
"assert": [Function],
|
||||
"clear": [Function],
|
||||
"count": [Function],
|
||||
"countReset": [Function],
|
||||
"debug": [Function],
|
||||
"dir": [Function],
|
||||
"dirxml": [Function],
|
||||
"error": [Function],
|
||||
"group": [Function],
|
||||
"groupCollapsed": [Function],
|
||||
"groupEnd": [Function],
|
||||
"info": [Function],
|
||||
"log": [Function],
|
||||
"table": [Function],
|
||||
"time": [Function],
|
||||
"timeEnd": [Function],
|
||||
"timeLog": [Function],
|
||||
"trace": [Function],
|
||||
"warn": [Function],
|
||||
},
|
||||
"mutationCache": MutationCache {
|
||||
"config": Object {},
|
||||
"listeners": Array [],
|
||||
"mutationId": 0,
|
||||
"mutations": Array [],
|
||||
"subscribe": [Function],
|
||||
},
|
||||
"mutationDefaults": Array [],
|
||||
"queryCache": QueryCache {
|
||||
|
@ -26,6 +53,7 @@ exports[`HeaderPage it renders 1`] = `
|
|||
"listeners": Array [],
|
||||
"queries": Array [],
|
||||
"queriesMap": Object {},
|
||||
"subscribe": [Function],
|
||||
},
|
||||
"queryDefaults": Array [],
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
import { EuiFlexGroup, EuiFlexItem, EuiHorizontalRule, EuiText, EuiTitle } from '@elastic/eui';
|
||||
import React, { useCallback, useMemo, useState } from 'react';
|
||||
|
||||
import { QueryClientProvider } from 'react-query';
|
||||
import { QueryClientProvider } from '@tanstack/react-query';
|
||||
import * as i18n from './translations';
|
||||
import { LinkAnchor } from '../links';
|
||||
import { RecentCasesFilters } from './filters';
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { useQuery } from 'react-query';
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import * as i18n from '../translations';
|
||||
import { fetchActionTypes } from './api';
|
||||
import { useToasts } from '../../common/lib/kibana';
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { useQuery } from 'react-query';
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import { fetchConnectors } from './api';
|
||||
import { useApplicationCapabilities, useToasts } from '../../common/lib/kibana';
|
||||
import * as i18n from './translations';
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { useQuery } from 'react-query';
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import { useToasts } from '../common/lib/kibana';
|
||||
import { getActionLicense } from './api';
|
||||
import * as i18n from './translations';
|
||||
|
|
|
@ -10,7 +10,7 @@ import { useGetCase } from './use_get_case';
|
|||
import * as api from './api';
|
||||
import { waitFor } from '@testing-library/dom';
|
||||
import React from 'react';
|
||||
import { QueryClient, QueryClientProvider } from 'react-query';
|
||||
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
||||
import { useToasts } from '../common/lib/kibana';
|
||||
|
||||
jest.mock('./api');
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { useQuery } from 'react-query';
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import { ResolvedCase } from './types';
|
||||
import * as i18n from './translations';
|
||||
import { useToasts } from '../common/lib/kibana';
|
||||
|
|
|
@ -48,13 +48,11 @@ describe('useGetCaseMetrics', () => {
|
|||
throw new Error('Something went wrong');
|
||||
});
|
||||
|
||||
await act(async () => {
|
||||
const { waitForNextUpdate } = renderHook(() => useGetCaseMetrics(basicCase.id, features), {
|
||||
wrapper,
|
||||
});
|
||||
await waitForNextUpdate();
|
||||
expect(spyOnGetCaseMetrics).toBeCalledWith(basicCase.id, features, abortCtrl.signal);
|
||||
expect(addError).toHaveBeenCalled();
|
||||
const { waitForNextUpdate } = renderHook(() => useGetCaseMetrics(basicCase.id, features), {
|
||||
wrapper,
|
||||
});
|
||||
await waitForNextUpdate();
|
||||
expect(spyOnGetCaseMetrics).toBeCalledWith(basicCase.id, features, abortCtrl.signal);
|
||||
expect(addError).toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { useQuery } from 'react-query';
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import { SingleCaseMetrics, SingleCaseMetricsFeature } from './types';
|
||||
import { useToasts } from '../common/lib/kibana';
|
||||
import { getSingleCaseMetrics } from './api';
|
||||
|
|
|
@ -22,7 +22,7 @@ import {
|
|||
} from './mock';
|
||||
import { Actions } from '../../common/api';
|
||||
import React from 'react';
|
||||
import { QueryClientProvider } from 'react-query';
|
||||
import { QueryClientProvider } from '@tanstack/react-query';
|
||||
import { testQueryClient } from '../common/mock';
|
||||
import { waitFor } from '@testing-library/dom';
|
||||
import * as api from './api';
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
import { isEmpty, uniqBy } from 'lodash/fp';
|
||||
import deepEqual from 'fast-deep-equal';
|
||||
|
||||
import { useQuery } from 'react-query';
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import { CaseUserActions, CaseExternalService } from '../../common/ui/types';
|
||||
import { ActionTypes, CaseConnector, NONE_CONNECTOR_ID } from '../../common/api';
|
||||
import { getCaseUserActions } from './api';
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { useQuery, UseQueryResult } from 'react-query';
|
||||
import { useQuery, UseQueryResult } from '@tanstack/react-query';
|
||||
import { CASE_LIST_CACHE_KEY, DEFAULT_TABLE_ACTIVE_PAGE, DEFAULT_TABLE_LIMIT } from './constants';
|
||||
import { Cases, FilterOptions, QueryParams, SortFieldCase, StatusAll, SeverityAll } from './types';
|
||||
import { useToasts } from '../common/lib/kibana';
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { useQuery } from 'react-query';
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import { useToasts } from '../common/lib/kibana';
|
||||
import { useCasesContext } from '../components/cases_context/use_cases_context';
|
||||
import { ServerError } from '../types';
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { useQuery, UseQueryResult } from 'react-query';
|
||||
import { useQuery, UseQueryResult } from '@tanstack/react-query';
|
||||
import { UserProfile } from '@kbn/security-plugin/common';
|
||||
import * as i18n from '../translations';
|
||||
import { useKibana, useToasts } from '../../common/lib/kibana';
|
||||
|
|
|
@ -26,21 +26,8 @@ describe('useSuggestUserProfiles', () => {
|
|||
|
||||
let appMockRender: AppMockRenderer;
|
||||
|
||||
beforeAll(() => {
|
||||
jest.useFakeTimers();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
appMockRender = createAppMockRenderer();
|
||||
jest.clearAllMocks();
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
jest.clearAllTimers();
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
jest.useRealTimers();
|
||||
});
|
||||
|
||||
it('calls suggestUserProfiles with correct arguments', async () => {
|
||||
|
@ -50,7 +37,6 @@ describe('useSuggestUserProfiles', () => {
|
|||
wrapper: appMockRender.AppWrapper,
|
||||
});
|
||||
|
||||
jest.advanceTimersByTime(500);
|
||||
await waitFor(() => result.current.isSuccess);
|
||||
|
||||
expect(spyOnSuggestUserProfiles).toBeCalledWith({
|
||||
|
@ -75,7 +61,6 @@ describe('useSuggestUserProfiles', () => {
|
|||
wrapper: appMockRender.AppWrapper,
|
||||
});
|
||||
|
||||
jest.advanceTimersByTime(500);
|
||||
await waitFor(() => result.current.isError);
|
||||
|
||||
expect(addError).toHaveBeenCalled();
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
import { useState } from 'react';
|
||||
import { useQuery, UseQueryResult } from 'react-query';
|
||||
import { useQuery, UseQueryResult } from '@tanstack/react-query';
|
||||
import useDebounce from 'react-use/lib/useDebounce';
|
||||
import { UserProfile } from '@kbn/security-plugin/common';
|
||||
import { DEFAULT_USER_SIZE } from '../../../common/constants';
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { QueryClient, QueryClientProvider } from 'react-query';
|
||||
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
||||
import { Redirect, Route, RouteComponentProps, type RouteProps, Switch } from 'react-router-dom';
|
||||
import { CLOUD_SECURITY_POSTURE_BASE_PATH, type CspSecuritySolutionContext } from '..';
|
||||
import { cloudPosturePages } from '../common/navigation/constants';
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { useQuery } from 'react-query';
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import {
|
||||
epmRouteService,
|
||||
type GetInfoResponse,
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { type QueryObserverOptions, useQuery } from 'react-query';
|
||||
import { type QueryObserverOptions, useQuery } from '@tanstack/react-query';
|
||||
import { useKibana } from '../hooks/use_kibana';
|
||||
import { ComplianceDashboardData } from '../../../common/types';
|
||||
import { STATS_ROUTE_PATH } from '../../../common/constants';
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { useQuery } from 'react-query';
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import { useKibana } from '@kbn/kibana-react-plugin/public';
|
||||
import type { DataView } from '@kbn/data-plugin/common';
|
||||
import { CSP_LATEST_FINDINGS_DATA_VIEW } from '../../../common/constants';
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { useQuery, type UseQueryOptions } from 'react-query';
|
||||
import { useQuery, type UseQueryOptions } from '@tanstack/react-query';
|
||||
import { useKibana } from '../hooks/use_kibana';
|
||||
import { CspSetupStatus } from '../../../common/types';
|
||||
import { STATUS_ROUTE_PATH } from '../../../common/constants';
|
||||
|
|
|
@ -18,7 +18,7 @@ import { TestProvider } from '../test/test_provider';
|
|||
import { coreMock } from '@kbn/core/public/mocks';
|
||||
import { render, screen } from '@testing-library/react';
|
||||
import React, { ComponentProps } from 'react';
|
||||
import { UseQueryResult } from 'react-query';
|
||||
import { UseQueryResult } from '@tanstack/react-query';
|
||||
import { CloudPosturePage } from './cloud_posture_page';
|
||||
import { NoDataPage } from '@kbn/kibana-react-plugin/public';
|
||||
import { useCspSetupStatusApi } from '../common/api/use_setup_status_api';
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
import React from 'react';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import type { UseQueryResult } from 'react-query';
|
||||
import type { UseQueryResult } from '@tanstack/react-query';
|
||||
import { EuiEmptyPrompt } from '@elastic/eui';
|
||||
import { FormattedMessage } from '@kbn/i18n-react';
|
||||
import { NoDataPage } from '@kbn/kibana-react-plugin/public';
|
||||
|
@ -166,7 +166,7 @@ export const CloudPosturePage = <TData, TError>({
|
|||
return defaultErrorRenderer(getSetupStatus.error);
|
||||
}
|
||||
|
||||
if (getSetupStatus.isLoading || getSetupStatus.isIdle) {
|
||||
if (getSetupStatus.isLoading) {
|
||||
return defaultLoadingRenderer();
|
||||
}
|
||||
|
||||
|
@ -182,7 +182,7 @@ export const CloudPosturePage = <TData, TError>({
|
|||
return errorRender(query.error);
|
||||
}
|
||||
|
||||
if (query.isLoading || query.isIdle) {
|
||||
if (query.isLoading) {
|
||||
return loadingRender();
|
||||
}
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
import React from 'react';
|
||||
import Chance from 'chance';
|
||||
import { render, screen } from '@testing-library/react';
|
||||
import type { UseQueryResult } from 'react-query/types/react/types';
|
||||
import type { UseQueryResult } from '@tanstack/react-query';
|
||||
import { createCspBenchmarkIntegrationFixture } from '../../test/fixtures/csp_benchmark_integration';
|
||||
import { createReactQueryResponse } from '../../test/fixtures/react_query';
|
||||
import { TestProvider } from '../../test/test_provider';
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { useQuery } from 'react-query';
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import type { ListResult } from '@kbn/fleet-plugin/common';
|
||||
import { BENCHMARKS_ROUTE_PATH } from '../../../common/constants';
|
||||
import type { BenchmarksQueryParams } from '../../../common/schemas/benchmark';
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
import { createContext, type MutableRefObject } from 'react';
|
||||
import type { UseQueryResult } from 'react-query';
|
||||
import type { UseQueryResult } from '@tanstack/react-query';
|
||||
|
||||
interface FindingsEsPitContextValue {
|
||||
setPitId(newPitId: string): void;
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
import { useCallback, useRef, useState } from 'react';
|
||||
import { useQuery } from 'react-query';
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import { CSP_LATEST_FINDINGS_DATA_VIEW, ES_PIT_ROUTE_PATH } from '../../../../common/constants';
|
||||
import { useKibana } from '../../../common/hooks/use_kibana';
|
||||
import { FINDINGS_PIT_KEEP_ALIVE } from '../constants';
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
import React from 'react';
|
||||
import Chance from 'chance';
|
||||
import type { UseQueryResult } from 'react-query';
|
||||
import type { UseQueryResult } from '@tanstack/react-query';
|
||||
import { of } from 'rxjs';
|
||||
import { useLatestFindingsDataView } from '../../common/api/use_latest_findings_data_view';
|
||||
import { Findings } from './findings';
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
import React from 'react';
|
||||
import type { UseQueryResult } from 'react-query';
|
||||
import type { UseQueryResult } from '@tanstack/react-query';
|
||||
import { Redirect, Switch, Route, useLocation } from 'react-router-dom';
|
||||
import { useCspSetupStatusApi } from '../../common/api/use_setup_status_api';
|
||||
import { NoFindingsStates } from '../../components/no_findings_states';
|
||||
|
@ -28,7 +28,7 @@ export const Findings = () => {
|
|||
if (!hasFindings) return <NoFindingsStates />;
|
||||
|
||||
let queryForCloudPosturePage: UseQueryResult = dataViewQuery;
|
||||
if (pitQuery.isError || pitQuery.isLoading || pitQuery.isIdle) {
|
||||
if (pitQuery.isError || pitQuery.isLoading) {
|
||||
queryForCloudPosturePage = pitQuery;
|
||||
}
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* 2.0; you may not use this file except in compliance with the Elastic License
|
||||
* 2.0.
|
||||
*/
|
||||
import type { UseQueryResult } from 'react-query';
|
||||
import type { UseQueryResult } from '@tanstack/react-query';
|
||||
import { createReactQueryResponse } from '../../../test/fixtures/react_query';
|
||||
import React from 'react';
|
||||
import { render } from '@testing-library/react';
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
import { useContext } from 'react';
|
||||
import { useQuery } from 'react-query';
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import { number } from 'io-ts';
|
||||
import { lastValueFrom } from 'rxjs';
|
||||
import type { IKibanaSearchRequest, IKibanaSearchResponse } from '@kbn/data-plugin/common';
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* 2.0; you may not use this file except in compliance with the Elastic License
|
||||
* 2.0.
|
||||
*/
|
||||
import { useQuery } from 'react-query';
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import { lastValueFrom } from 'rxjs';
|
||||
import { IKibanaSearchRequest, IKibanaSearchResponse } from '@kbn/data-plugin/common';
|
||||
import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
import { useContext } from 'react';
|
||||
import { useQuery } from 'react-query';
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import { lastValueFrom } from 'rxjs';
|
||||
import { IKibanaSearchRequest, IKibanaSearchResponse } from '@kbn/data-plugin/common';
|
||||
import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
|
||||
|
|
|
@ -9,7 +9,7 @@ import React from 'react';
|
|||
import Chance from 'chance';
|
||||
import { Rules } from '.';
|
||||
import { render, screen } from '@testing-library/react';
|
||||
import { QueryClient } from 'react-query';
|
||||
import { QueryClient } from '@tanstack/react-query';
|
||||
import { TestProvider } from '../../test/test_provider';
|
||||
import { useCspIntegrationInfo } from './use_csp_integration';
|
||||
import { type RouteComponentProps } from 'react-router-dom';
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
import React from 'react';
|
||||
import { RulesContainer } from './rules_container';
|
||||
import { render, screen, fireEvent, within } from '@testing-library/react';
|
||||
import { QueryClient } from 'react-query';
|
||||
import { QueryClient } from '@tanstack/react-query';
|
||||
import { useFindCspRules, useBulkUpdateCspRules, type RuleSavedObject } from './use_csp_rules';
|
||||
import * as TEST_SUBJECTS from './test_subjects';
|
||||
import { Chance } from 'chance';
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* 2.0; you may not use this file except in compliance with the Elastic License
|
||||
* 2.0.
|
||||
*/
|
||||
import { useQuery } from 'react-query';
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import {
|
||||
type CopyAgentPolicyResponse,
|
||||
type GetOnePackagePolicyResponse,
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* 2.0; you may not use this file except in compliance with the Elastic License
|
||||
* 2.0.
|
||||
*/
|
||||
import { useQuery, useMutation, useQueryClient } from 'react-query';
|
||||
import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query';
|
||||
import { FunctionKeys } from 'utility-types';
|
||||
import type { SavedObjectsFindOptions, SimpleSavedObject } from '@kbn/core/public';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
|
@ -74,10 +74,7 @@ export const useBulkUpdateCspRules = () => {
|
|||
},
|
||||
onSettled: () =>
|
||||
// Invalidate all queries for simplicity
|
||||
queryClient.invalidateQueries({
|
||||
queryKey: CSP_RULE_SAVED_OBJECT_TYPE,
|
||||
exact: false,
|
||||
}),
|
||||
queryClient.invalidateQueries([CSP_RULE_SAVED_OBJECT_TYPE]),
|
||||
}
|
||||
);
|
||||
};
|
||||
|
|
|
@ -5,10 +5,10 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import type { UseQueryResult } from 'react-query/types/react/types';
|
||||
import type { UseQueryResult } from '@tanstack/react-query';
|
||||
|
||||
interface CreateReactQueryResponseInput<TData = unknown, TError = unknown> {
|
||||
status?: UseQueryResult['status'];
|
||||
status?: UseQueryResult['status'] | 'idle';
|
||||
data?: TData;
|
||||
error?: TError;
|
||||
}
|
||||
|
@ -35,12 +35,12 @@ export const createReactQueryResponse = <TData = unknown, TError = unknown>({
|
|||
|
||||
if (status === 'idle') {
|
||||
return {
|
||||
status,
|
||||
status: 'loading',
|
||||
data: undefined,
|
||||
isSuccess: false,
|
||||
isLoading: false,
|
||||
isLoading: true,
|
||||
isError: false,
|
||||
isIdle: true,
|
||||
fetchStatus: 'idle',
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ import type { AppMountParameters, CoreStart } from '@kbn/core/public';
|
|||
import React, { useMemo } from 'react';
|
||||
import { I18nProvider } from '@kbn/i18n-react';
|
||||
import { Router, Switch, Route } from 'react-router-dom';
|
||||
import { QueryClient, QueryClientProvider } from 'react-query';
|
||||
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
||||
import { coreMock } from '@kbn/core/public/mocks';
|
||||
import { dataPluginMock } from '@kbn/data-plugin/public/mocks';
|
||||
import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public';
|
||||
|
|
|
@ -16,7 +16,7 @@ import {
|
|||
EuiSpacer,
|
||||
EuiText,
|
||||
} from '@elastic/eui';
|
||||
import { useQuery } from 'react-query';
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
|
||||
import { FormattedMessage } from '@kbn/i18n-react';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
|
@ -52,7 +52,7 @@ export const AgentPolicyDebugger: React.FunctionComponent = () => {
|
|||
|
||||
// TODO: Depending on the number of agent policies, this might need to be switched to
|
||||
// `useInfinite` query with an infinite scrolling approach in the dropdown options.
|
||||
const { data, status } = useQuery('debug-agent-policies', fetchAgentPolicies);
|
||||
const { data, status } = useQuery(['debug-agent-policies'], fetchAgentPolicies);
|
||||
|
||||
const agentPolicies = data?.data?.items ?? [];
|
||||
const comboBoxOptions = agentPolicies.map((policy) => ({
|
||||
|
@ -68,7 +68,7 @@ export const AgentPolicyDebugger: React.FunctionComponent = () => {
|
|||
|
||||
const onDelete = () => {
|
||||
setSelectedPolicyId(undefined);
|
||||
queryClient.invalidateQueries('debug-agent-policies');
|
||||
queryClient.invalidateQueries(['debug-agent-policies']);
|
||||
};
|
||||
|
||||
if (status === 'error') {
|
||||
|
|
|
@ -15,7 +15,7 @@ import {
|
|||
EuiSpacer,
|
||||
EuiText,
|
||||
} from '@elastic/eui';
|
||||
import { useQuery } from 'react-query';
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { FormattedMessage } from '@kbn/i18n-react';
|
||||
|
|
|
@ -20,7 +20,7 @@ import {
|
|||
EuiSpacer,
|
||||
EuiText,
|
||||
} from '@elastic/eui';
|
||||
import { useMutation, useQuery } from 'react-query';
|
||||
import { useMutation, useQuery } from '@tanstack/react-query';
|
||||
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { FormattedMessage } from '@kbn/i18n-react';
|
||||
|
@ -58,7 +58,7 @@ export const IntegrationDebugger: React.FunctionComponent = () => {
|
|||
const [isReinstallModalVisible, setIsReinstallModalVisible] = useState(false);
|
||||
const [isUninstallModalVisible, setIsUninstallModalVisible] = useState(false);
|
||||
|
||||
const integrations = useQuery('debug-integrations', fetchInstalledIntegrations);
|
||||
const integrations = useQuery(['debug-integrations'], fetchInstalledIntegrations);
|
||||
|
||||
const uninstallMutation = useMutation(async (integration: PackageListItem) => {
|
||||
const response = await sendRemovePackage(integration.name, integration.version, true);
|
||||
|
@ -86,7 +86,7 @@ export const IntegrationDebugger: React.FunctionComponent = () => {
|
|||
setSelectedIntegrationId(undefined);
|
||||
setIsUninstallModalVisible(false);
|
||||
|
||||
queryClient.invalidateQueries('debug-integrations');
|
||||
queryClient.invalidateQueries(['debug-integrations']);
|
||||
|
||||
return response.data;
|
||||
});
|
||||
|
@ -132,7 +132,7 @@ export const IntegrationDebugger: React.FunctionComponent = () => {
|
|||
setSelectedIntegrationId(undefined);
|
||||
setIsReinstallModalVisible(false);
|
||||
|
||||
queryClient.invalidateQueries('debug-integrations');
|
||||
queryClient.invalidateQueries(['debug-integrations']);
|
||||
|
||||
return installResponse.data;
|
||||
});
|
||||
|
|
|
@ -15,7 +15,7 @@ import {
|
|||
EuiButton,
|
||||
EuiConfirmModal,
|
||||
} from '@elastic/eui';
|
||||
import { useMutation, useQuery } from 'react-query';
|
||||
import { useMutation, useQuery } from '@tanstack/react-query';
|
||||
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { FormattedMessage } from '@kbn/i18n-react';
|
||||
|
@ -46,7 +46,7 @@ export const OrphanedIntegrationPolicyDebugger: React.FunctionComponent = () =>
|
|||
const [isDeleteModalVisible, setIsDeleteModalVisible] = useState(false);
|
||||
const [isDeleteAllModalVisible, setIsDeleteAllModalVisible] = useState(false);
|
||||
|
||||
const { data: orphanedPolicies } = useQuery('debug-orphaned-policies', fetchOrphanedPolicies);
|
||||
const { data: orphanedPolicies } = useQuery(['debug-orphaned-policies'], fetchOrphanedPolicies);
|
||||
|
||||
const comboBoxOptions =
|
||||
orphanedPolicies?.map((policy: { id: string; name: string }) => ({
|
||||
|
@ -83,7 +83,7 @@ export const OrphanedIntegrationPolicyDebugger: React.FunctionComponent = () =>
|
|||
defaultMessage: 'Successfully deleted orphaned policy',
|
||||
})
|
||||
);
|
||||
queryClient.invalidateQueries('debug-orphaned-policies');
|
||||
queryClient.invalidateQueries(['debug-orphaned-policies']);
|
||||
setSelectedPolicyId(undefined);
|
||||
setIsDeleteModalVisible(false);
|
||||
|
||||
|
@ -112,7 +112,7 @@ export const OrphanedIntegrationPolicyDebugger: React.FunctionComponent = () =>
|
|||
defaultMessage: 'Successfully deleted all orphaned policies',
|
||||
})
|
||||
);
|
||||
queryClient.invalidateQueries('debug-orphaned-policies');
|
||||
queryClient.invalidateQueries(['debug-orphaned-policies']);
|
||||
setSelectedPolicyId(undefined);
|
||||
setIsDeleteAllModalVisible(false);
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ import {
|
|||
EuiLink,
|
||||
EuiConfirmModal,
|
||||
} from '@elastic/eui';
|
||||
import { useMutation, useQuery } from 'react-query';
|
||||
import { useMutation, useQuery } from '@tanstack/react-query';
|
||||
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { FormattedMessage } from '@kbn/i18n-react';
|
||||
|
@ -55,7 +55,7 @@ export const PreconfigurationDebugger: React.FunctionComponent = () => {
|
|||
const [isResetAllModalVisible, setIsResetAllModalVisible] = useState(false);
|
||||
|
||||
const preconfiguredPolicies = useQuery(
|
||||
'debug-preconfigured-policies',
|
||||
['debug-preconfigured-policies'],
|
||||
fetchPreconfiguredPolicies
|
||||
);
|
||||
|
||||
|
@ -91,7 +91,7 @@ export const PreconfigurationDebugger: React.FunctionComponent = () => {
|
|||
defaultMessage: 'Successfully reset policy',
|
||||
})
|
||||
);
|
||||
queryClient.invalidateQueries('debug-preconfigured-policies');
|
||||
queryClient.invalidateQueries(['debug-preconfigured-policies']);
|
||||
setSelectedPolicyId(undefined);
|
||||
setIsResetModalVisible(false);
|
||||
|
||||
|
@ -116,7 +116,7 @@ export const PreconfigurationDebugger: React.FunctionComponent = () => {
|
|||
defaultMessage: 'Successfully reset policies',
|
||||
})
|
||||
);
|
||||
queryClient.invalidateQueries('debug-preconfigured-policies');
|
||||
queryClient.invalidateQueries(['debug-preconfigured-policies']);
|
||||
setSelectedPolicyId(undefined);
|
||||
setIsResetAllModalVisible(false);
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
import React, { useState, useRef } from 'react';
|
||||
import { useQuery } from 'react-query';
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import {
|
||||
EuiFlexGroup,
|
||||
EuiFlexItem,
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
import React, { forwardRef, useImperativeHandle } from 'react';
|
||||
import { useQuery } from 'react-query';
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import { EuiComboBox } from '@elastic/eui';
|
||||
|
||||
import { i18n } from '@kbn/i18n';
|
||||
|
|
|
@ -18,8 +18,8 @@ import {
|
|||
EuiText,
|
||||
EuiTitle,
|
||||
} from '@elastic/eui';
|
||||
import { QueryClient, QueryClientProvider } from 'react-query';
|
||||
import { ReactQueryDevtools } from 'react-query/devtools';
|
||||
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
||||
import { ReactQueryDevtools } from '@tanstack/react-query-devtools';
|
||||
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { FormattedMessage } from '@kbn/i18n-react';
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { useInfiniteQuery } from 'react-query';
|
||||
import { useInfiniteQuery } from '@tanstack/react-query';
|
||||
import { CoreStart } from '@kbn/core/public';
|
||||
import { useKibana } from '@kbn/kibana-react-plugin/public';
|
||||
import { QUERY_KEY_CONTAINER_NAME_WIDGET, AGGREGATE_ROUTE } from '../../../common/constants';
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { useInfiniteQuery } from 'react-query';
|
||||
import { useInfiniteQuery } from '@tanstack/react-query';
|
||||
import { CoreStart } from '@kbn/core/public';
|
||||
import { useKibana } from '@kbn/kibana-react-plugin/public';
|
||||
import { QUERY_KEY_COUNT_WIDGET, COUNT_ROUTE } from '../../../common/constants';
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* 2.0; you may not use this file except in compliance with the Elastic License
|
||||
* 2.0.
|
||||
*/
|
||||
import { useQuery } from 'react-query';
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import { CoreStart } from '@kbn/core/public';
|
||||
import { useKibana } from '@kbn/kibana-react-plugin/public';
|
||||
import { QUERY_KEY_PERCENT_WIDGET, AGGREGATE_ROUTE } from '../../../common/constants';
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* 2.0; you may not use this file except in compliance with the Elastic License
|
||||
* 2.0.
|
||||
*/
|
||||
import { useInfiniteQuery } from 'react-query';
|
||||
import { useInfiniteQuery } from '@tanstack/react-query';
|
||||
import { CoreStart } from '@kbn/core/public';
|
||||
import { useKibana } from '@kbn/kibana-react-plugin/public';
|
||||
import { QueryDslQueryContainerBool } from '../../../types';
|
||||
|
|
|
@ -18,8 +18,6 @@ describe('DynamicTreeView component', () => {
|
|||
let mockedContext: AppContextTestRender;
|
||||
let mockedApi: AppContextTestRender['coreStart']['http']['get'];
|
||||
|
||||
const waitForApiCall = () => waitFor(() => expect(mockedApi).toHaveBeenCalled());
|
||||
|
||||
const defaultProps = {
|
||||
globalFilter: {
|
||||
startDate: Date.now().toString(),
|
||||
|
@ -69,8 +67,9 @@ describe('DynamicTreeView component', () => {
|
|||
it('should show loading state while retrieving empty data and hide it when settled', async () => {
|
||||
render();
|
||||
expect(renderResult.queryByText(/loading/i)).toBeInTheDocument();
|
||||
await waitForApiCall();
|
||||
expect(renderResult.queryByText(/loading/i)).not.toBeInTheDocument();
|
||||
await waitFor(() => {
|
||||
expect(renderResult.queryByText(/loading/i)).not.toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -92,39 +91,42 @@ describe('DynamicTreeView component', () => {
|
|||
render({
|
||||
tree,
|
||||
});
|
||||
await waitForApiCall();
|
||||
|
||||
expect(mockedApi).toHaveBeenCalledWith(
|
||||
'/internal/kubernetes_security/multi_terms_aggregate',
|
||||
{
|
||||
query: {
|
||||
groupBys: `[{"field":"${key}"},{"field":"orchestrator.cluster.name","missing":""}]`,
|
||||
index: '*-logs',
|
||||
page: 0,
|
||||
perPage: 50,
|
||||
query: '{"bool":{"filter":[],"must":[],"must_not":[],"should":[]}}',
|
||||
},
|
||||
}
|
||||
);
|
||||
await waitFor(() => {
|
||||
expect(mockedApi).toHaveBeenCalledWith(
|
||||
'/internal/kubernetes_security/multi_terms_aggregate',
|
||||
{
|
||||
query: {
|
||||
groupBys: `[{"field":"${key}"},{"field":"orchestrator.cluster.name","missing":""}]`,
|
||||
index: '*-logs',
|
||||
page: 0,
|
||||
perPage: 50,
|
||||
query: '{"bool":{"filter":[],"must":[],"must_not":[],"should":[]}}',
|
||||
},
|
||||
}
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
it('should render the parent level based on api response', async () => {
|
||||
render({
|
||||
tree,
|
||||
});
|
||||
await waitForApiCall();
|
||||
|
||||
['awp-demo-gke-main', 'awp-demo-gke-test'].forEach((cluster) => {
|
||||
expect(renderResult.queryByText(cluster)).toBeInTheDocument();
|
||||
await waitFor(() => {
|
||||
['awp-demo-gke-main', 'awp-demo-gke-test'].forEach((cluster) => {
|
||||
expect(renderResult.queryByText(cluster)).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
it('should trigger a callback when tree node is clicked', async () => {
|
||||
const callback = jest.fn();
|
||||
render({ tree, onSelect: callback });
|
||||
await waitForApiCall();
|
||||
|
||||
renderResult.getByRole('button', { name: 'awp-demo-gke-main' }).click();
|
||||
await waitFor(() => {
|
||||
renderResult.getByRole('button', { name: 'awp-demo-gke-main' }).click();
|
||||
});
|
||||
|
||||
expect(callback).toHaveBeenCalled();
|
||||
});
|
||||
|
@ -156,37 +158,43 @@ describe('DynamicTreeView component', () => {
|
|||
|
||||
it('should make a children api call with filter when parent is expanded', async () => {
|
||||
render({ tree });
|
||||
await waitForApiCall();
|
||||
renderResult.getByRole('button', { name: parent }).click();
|
||||
await waitFor(() => {
|
||||
renderResult.getByRole('button', { name: parent }).click();
|
||||
});
|
||||
|
||||
mockedApi.mockResolvedValueOnce(nodeResponseMock);
|
||||
|
||||
await waitForApiCall();
|
||||
expect(mockedApi).toHaveBeenCalledWith('/internal/kubernetes_security/aggregate', {
|
||||
query: {
|
||||
groupBy: 'node',
|
||||
index: '*-logs',
|
||||
page: 0,
|
||||
perPage: 50,
|
||||
query: `{"bool":{"filter":[{"term":{"orchestrator.cluster.id":"${parent}"}}],"must":[],"must_not":[],"should":[]}}`,
|
||||
},
|
||||
await waitFor(() => {
|
||||
expect(mockedApi).toHaveBeenCalledWith('/internal/kubernetes_security/aggregate', {
|
||||
query: {
|
||||
groupBy: 'node',
|
||||
index: '*-logs',
|
||||
page: 0,
|
||||
perPage: 50,
|
||||
query: `{"bool":{"filter":[{"term":{"orchestrator.cluster.id":"${parent}"}}],"must":[],"must_not":[],"should":[]}}`,
|
||||
},
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
it('should render children when parent is expanded based on api request', async () => {
|
||||
render({ tree });
|
||||
await waitForApiCall();
|
||||
|
||||
renderResult.getByRole('button', { name: parent }).click();
|
||||
|
||||
mockedApi.mockResolvedValueOnce(nodeResponseMock);
|
||||
await waitFor(() => {
|
||||
expect(renderResult.getByRole('button', { name: parent })).toBeTruthy();
|
||||
mockedApi.mockResolvedValueOnce(nodeResponseMock);
|
||||
renderResult.getByRole('button', { name: parent }).click();
|
||||
});
|
||||
|
||||
// check if children has loading state
|
||||
expect(renderResult.queryByText(/loading/i)).toBeInTheDocument();
|
||||
await waitForApiCall();
|
||||
await waitFor(() => {
|
||||
expect(renderResult.queryByText(/loading/i)).toBeInTheDocument();
|
||||
});
|
||||
|
||||
['default', 'kube-system', 'production', 'qa', 'staging'].forEach((node) => {
|
||||
expect(renderResult.queryByText(node)).toBeInTheDocument();
|
||||
await waitFor(() => {
|
||||
['default', 'kube-system', 'production', 'qa', 'staging'].forEach((node) => {
|
||||
expect(renderResult.queryByText(node)).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
import React, { lazy, Suspense } from 'react';
|
||||
import { EuiLoadingSpinner } from '@elastic/eui';
|
||||
import { QueryClient, QueryClientProvider } from 'react-query';
|
||||
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
||||
import { KubernetesSecurityDeps } from '../types';
|
||||
|
||||
// Initializing react-query
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
import React, { memo, ReactNode, useMemo } from 'react';
|
||||
import { createMemoryHistory, MemoryHistory } from 'history';
|
||||
import { render as reactRender, RenderOptions, RenderResult } from '@testing-library/react';
|
||||
import { QueryClient, QueryClientProvider, setLogger } from 'react-query';
|
||||
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
||||
import { Router } from 'react-router-dom';
|
||||
import { History } from 'history';
|
||||
import useObservable from 'react-use/lib/useObservable';
|
||||
|
@ -20,15 +20,6 @@ import { EuiThemeProvider } from '@kbn/kibana-react-plugin/common';
|
|||
|
||||
type UiRender = (ui: React.ReactElement, options?: RenderOptions) => RenderResult;
|
||||
|
||||
// hide react-query output in console
|
||||
setLogger({
|
||||
error: () => {},
|
||||
// eslint-disable-next-line no-console
|
||||
log: console.log,
|
||||
// eslint-disable-next-line no-console
|
||||
warn: console.warn,
|
||||
});
|
||||
|
||||
/**
|
||||
* Mocked app root context renderer
|
||||
*/
|
||||
|
@ -113,6 +104,14 @@ export const createAppRootMockRenderer = (): AppContextTestRender => {
|
|||
cacheTime: Infinity,
|
||||
},
|
||||
},
|
||||
// hide react-query output in console
|
||||
logger: {
|
||||
error: () => {},
|
||||
// eslint-disable-next-line no-console
|
||||
log: console.log,
|
||||
// eslint-disable-next-line no-console
|
||||
warn: console.warn,
|
||||
},
|
||||
});
|
||||
|
||||
const AppWrapper: React.FC<{ children: React.ReactElement }> = ({ children }) => (
|
||||
|
|
|
@ -26,6 +26,7 @@ describe('ALL - Edit saved query', () => {
|
|||
});
|
||||
|
||||
it('by changing ecs mappings and platforms', () => {
|
||||
cy.getBySel('pagination-button-next').click();
|
||||
cy.react('CustomItemAction', {
|
||||
props: { index: 1, item: { attributes: { id: SAVED_QUERY_ID } } },
|
||||
}).click();
|
||||
|
|
|
@ -46,7 +46,7 @@ describe('ALL - Inventory', () => {
|
|||
|
||||
cy.getBySel('comboBoxInput').first().click();
|
||||
cy.wait(500);
|
||||
cy.getBySel('comboBoxInput').first().type('{downArrow}{enter}');
|
||||
cy.getBySel('comboBoxInput').first().type('saved{downArrow}{enter}');
|
||||
|
||||
submitQuery();
|
||||
checkResults();
|
||||
|
|
|
@ -27,6 +27,7 @@ describe('Reader - only READ', () => {
|
|||
it('should not be able to add nor run saved queries', () => {
|
||||
navigateTo('/app/osquery/saved_queries');
|
||||
cy.waitForReact(1000);
|
||||
cy.getBySel('pagination-button-next').click();
|
||||
cy.contains(SAVED_QUERY_ID);
|
||||
cy.contains('Add saved query').should('be.disabled');
|
||||
cy.react('PlayButtonComponent', {
|
||||
|
|
|
@ -29,6 +29,7 @@ describe('T1 Analyst - READ + runSavedQueries ', () => {
|
|||
it('should be able to run saved queries but not add new ones', () => {
|
||||
navigateTo('/app/osquery/saved_queries');
|
||||
cy.waitForReact(1000);
|
||||
cy.getBySel('pagination-button-next').click();
|
||||
cy.contains(SAVED_QUERY_ID);
|
||||
cy.contains('Add saved query').should('be.disabled');
|
||||
cy.react('PlayButtonComponent', {
|
||||
|
|
|
@ -100,7 +100,7 @@ describe('T2 Analyst - READ + Write Live/Saved + runSavedQueries ', () => {
|
|||
});
|
||||
it('to click the edit button and edit pack', () => {
|
||||
navigateTo('/app/osquery/saved_queries');
|
||||
|
||||
cy.getBySel('pagination-button-next').click();
|
||||
cy.react('CustomItemAction', {
|
||||
props: { index: 1, item: { attributes: { id: SAVED_QUERY_ID } } },
|
||||
}).click();
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
import { LIVE_QUERY_EDITOR } from '../screens/live_query';
|
||||
|
||||
export const DEFAULT_QUERY = 'select * from processes;';
|
||||
export const BIG_QUERY = 'select * from processes, users limit 200;';
|
||||
export const BIG_QUERY = 'select * from processes, users limit 110;';
|
||||
|
||||
export const selectAllAgents = () => {
|
||||
cy.react('AgentsTable').find('input').should('not.be.disabled');
|
||||
|
|
|
@ -53,9 +53,8 @@ const ActionResultsSummaryComponent: React.FC<ActionResultsSummaryProps> = ({
|
|||
skip: !hasActionResultsPrivileges,
|
||||
});
|
||||
if (expired) {
|
||||
// @ts-expect-error update types
|
||||
edges.forEach((edge) => {
|
||||
if (!edge.fields.completed_at) {
|
||||
if (!edge.fields?.completed_at && edge.fields) {
|
||||
edge.fields['error.keyword'] = edge.fields.error = [
|
||||
i18n.translate('xpack.osquery.liveQueryActionResults.table.expiredErrorText', {
|
||||
defaultMessage: 'The action request timed out.',
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { useQuery } from 'react-query';
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import { useKibana } from '../common/lib/kibana';
|
||||
|
||||
export const useActionResultsPrivileges = () => {
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
|
||||
import { flatten, reverse, uniqBy } from 'lodash/fp';
|
||||
import { useQuery } from 'react-query';
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { lastValueFrom } from 'rxjs';
|
||||
import type { InspectResponse } from '../common/helpers';
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { useQuery } from 'react-query';
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { createFilter } from '../common/helpers';
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { useQuery } from 'react-query';
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { useKibana } from '../common/lib/kibana';
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
import { mapKeys } from 'lodash';
|
||||
import { useQuery } from 'react-query';
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import type { GetAgentPoliciesResponseItem } from '@kbn/fleet-plugin/common';
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { useQuery } from 'react-query';
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import type { AgentPolicy } from '@kbn/fleet-plugin/common';
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { useQuery } from 'react-query';
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
|
||||
import type { GetOneAgentResponse } from '@kbn/fleet-plugin/common';
|
||||
import { useErrorToast } from '../common/hooks/use_error_toast';
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* 2.0; you may not use this file except in compliance with the Elastic License
|
||||
* 2.0.
|
||||
*/
|
||||
import { useQuery } from 'react-query';
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { lastValueFrom } from 'rxjs';
|
||||
import { useKibana } from '../common/lib/kibana';
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
*/
|
||||
|
||||
import { mapKeys } from 'lodash';
|
||||
import type { UseQueryResult } from 'react-query';
|
||||
import { useQueries } from 'react-query';
|
||||
import type { UseQueryResult } from '@tanstack/react-query';
|
||||
import { useQueries } from '@tanstack/react-query';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import type { GetOneAgentPolicyResponse } from '@kbn/fleet-plugin/common';
|
||||
import { useKibana } from '../common/lib/kibana';
|
||||
|
@ -17,20 +17,21 @@ export const useAgentPolicies = (policyIds: string[] = []) => {
|
|||
const { http } = useKibana().services;
|
||||
const setErrorToast = useErrorToast();
|
||||
|
||||
const agentResponse = useQueries(
|
||||
policyIds.map((policyId) => ({
|
||||
const agentResponse = useQueries({
|
||||
queries: policyIds.map((policyId) => ({
|
||||
queryKey: ['agentPolicy', policyId],
|
||||
queryFn: () => http.get(`/internal/osquery/fleet_wrapper/agent_policies/${policyId}`),
|
||||
enabled: policyIds.length > 0,
|
||||
onSuccess: () => setErrorToast(),
|
||||
|
||||
onError: (error: Error) =>
|
||||
setErrorToast(error, {
|
||||
title: i18n.translate('xpack.osquery.action_policy_details.fetchError', {
|
||||
defaultMessage: 'Error while fetching policy details',
|
||||
}),
|
||||
}),
|
||||
}))
|
||||
) as Array<UseQueryResult<GetOneAgentPolicyResponse>>;
|
||||
})),
|
||||
}) as Array<UseQueryResult<GetOneAgentPolicyResponse>>;
|
||||
|
||||
const agentPoliciesLoading = agentResponse.some((p) => p.isLoading);
|
||||
const agentPolicies = agentResponse.map((p) => p.data?.item);
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
import { map } from 'lodash';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { useQuery } from 'react-query';
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
|
||||
import type { Agent } from '@kbn/fleet-plugin/common';
|
||||
import { AGENTS_PREFIX } from '@kbn/fleet-plugin/common';
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { useQuery } from 'react-query';
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
|
||||
import type { GetAgentStatusResponse } from '@kbn/fleet-plugin/common';
|
||||
import { useErrorToast } from '../common/hooks/use_error_toast';
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { useQuery } from 'react-query';
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
|
||||
import type { ListResult, Agent } from '@kbn/fleet-plugin/common';
|
||||
import { useErrorToast } from '../common/hooks/use_error_toast';
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
import { uniq } from 'lodash';
|
||||
import { useQuery } from 'react-query';
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { useKibana } from '../common/lib/kibana';
|
||||
import { useErrorToast } from '../common/hooks/use_error_toast';
|
||||
|
|
|
@ -12,8 +12,8 @@ import ReactDOM from 'react-dom';
|
|||
import { Router } from 'react-router-dom';
|
||||
import { I18nProvider } from '@kbn/i18n-react';
|
||||
import { ThemeProvider } from 'styled-components';
|
||||
import { QueryClientProvider } from 'react-query';
|
||||
import { ReactQueryDevtools } from 'react-query/devtools';
|
||||
import { QueryClientProvider } from '@tanstack/react-query';
|
||||
import { ReactQueryDevtools } from '@tanstack/react-query-devtools';
|
||||
|
||||
import type { Storage } from '@kbn/kibana-utils-plugin/public';
|
||||
import type { AppMountParameters, CoreStart } from '@kbn/core/public';
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
import type { SavedObject } from '@kbn/core/public';
|
||||
import { useQuery } from 'react-query';
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import { useKibana } from '../common/lib/kibana';
|
||||
import { INTEGRATION_ASSETS_STATUS_ID } from './constants';
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { useMutation, useQueryClient } from 'react-query';
|
||||
import { useMutation, useQueryClient } from '@tanstack/react-query';
|
||||
import { useKibana } from '../common/lib/kibana';
|
||||
import { useErrorToast } from '../common/hooks/use_error_toast';
|
||||
import { PACKS_ID } from '../packs/constants';
|
||||
|
@ -26,8 +26,8 @@ export const useImportAssets = ({ successToastText }: UseImportAssetsProps) => {
|
|||
return useMutation(() => http.post('/internal/osquery/assets/update'), {
|
||||
onSuccess: () => {
|
||||
setErrorToast();
|
||||
queryClient.invalidateQueries(PACKS_ID);
|
||||
queryClient.invalidateQueries(INTEGRATION_ASSETS_STATUS_ID);
|
||||
queryClient.invalidateQueries([PACKS_ID]);
|
||||
queryClient.invalidateQueries([INTEGRATION_ASSETS_STATUS_ID]);
|
||||
toasts.addSuccess(successToastText);
|
||||
},
|
||||
onError: (error) => {
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { useQuery } from 'react-query';
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import type { DataView } from '@kbn/data-plugin/common';
|
||||
|
||||
import { useKibana } from '../lib/kibana';
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { useQuery } from 'react-query';
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
|
||||
import { useKibana } from '../lib/kibana';
|
||||
import { useErrorToast } from './use_error_toast';
|
||||
|
@ -16,7 +16,7 @@ export const useOsqueryIntegrationStatus = () => {
|
|||
const setErrorToast = useErrorToast();
|
||||
|
||||
return useQuery(
|
||||
'integration',
|
||||
['integration'],
|
||||
() =>
|
||||
http.get<{ name: string; version: string; title: string; install_status: string }>(
|
||||
'/internal/osquery/status'
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { useMutation } from 'react-query';
|
||||
import { useMutation } from '@tanstack/react-query';
|
||||
import type { AgentSelection } from '../../common/schemas/common';
|
||||
import type { CreateLiveQueryRequestBodySchema } from '../../common/schemas/routes/live_query';
|
||||
import { useKibana } from '../common/lib/kibana';
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
import { EuiSwitch, EuiLoadingSpinner } from '@elastic/eui';
|
||||
import React, { useCallback, useMemo, useState } from 'react';
|
||||
import { useQueryClient } from 'react-query';
|
||||
import { useQueryClient } from '@tanstack/react-query';
|
||||
import styled from 'styled-components';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
|
||||
|
@ -55,7 +55,7 @@ const ActiveStateSwitchComponent: React.FC<ActiveStateSwitchProps> = ({ item })
|
|||
const { isLoading, mutateAsync } = useUpdatePack({
|
||||
options: {
|
||||
onSuccess: (response) => {
|
||||
queryClient.invalidateQueries(PACKS_ID);
|
||||
queryClient.invalidateQueries([PACKS_ID]);
|
||||
setErrorToast();
|
||||
toasts.addSuccess(
|
||||
response?.data?.attributes.enabled
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { useMutation, useQueryClient } from 'react-query';
|
||||
import { useMutation, useQueryClient } from '@tanstack/react-query';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
|
||||
import { useKibana } from '../common/lib/kibana';
|
||||
|
@ -42,7 +42,7 @@ export const useCreatePack = ({ withRedirect }: UseCreatePackProps) => {
|
|||
setErrorToast(error, { title: error.body.error, toastMessage: error.body.message });
|
||||
},
|
||||
onSuccess: (payload) => {
|
||||
queryClient.invalidateQueries(PACKS_ID);
|
||||
queryClient.invalidateQueries([PACKS_ID]);
|
||||
if (withRedirect) {
|
||||
navigateToApp(PLUGIN_ID, { path: pagePathGetters.packs() });
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { useMutation, useQueryClient } from 'react-query';
|
||||
import { useMutation, useQueryClient } from '@tanstack/react-query';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
|
||||
import { useKibana } from '../common/lib/kibana';
|
||||
|
@ -36,7 +36,7 @@ export const useDeletePack = ({ packId, withRedirect }: UseDeletePackProps) => {
|
|||
});
|
||||
},
|
||||
onSuccess: () => {
|
||||
queryClient.invalidateQueries(PACKS_ID);
|
||||
queryClient.invalidateQueries([PACKS_ID]);
|
||||
if (withRedirect) {
|
||||
navigateToApp(PLUGIN_ID, { path: pagePathGetters.packs() });
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { useQuery } from 'react-query';
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import { useKibana } from '../common/lib/kibana';
|
||||
import type { PackItem } from './types';
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { useQuery } from 'react-query';
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import { lastValueFrom } from 'rxjs';
|
||||
import type { DataView } from '@kbn/data-plugin/common';
|
||||
import { SortDirection } from '@kbn/data-plugin/common';
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { useQuery } from 'react-query';
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import moment from 'moment-timezone';
|
||||
import { lastValueFrom } from 'rxjs';
|
||||
import { SortDirection } from '@kbn/data-plugin/common';
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
import type { SavedObjectsFindResponse } from '@kbn/core/public';
|
||||
import { useQuery } from 'react-query';
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
|
||||
import { useKibana } from '../common/lib/kibana';
|
||||
import { PACKS_ID } from './constants';
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import type { UseMutationOptions } from 'react-query';
|
||||
import { useMutation, useQueryClient } from 'react-query';
|
||||
import type { UseMutationOptions } from '@tanstack/react-query';
|
||||
import { useMutation, useQueryClient } from '@tanstack/react-query';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
|
||||
import { useKibana } from '../common/lib/kibana';
|
||||
|
@ -48,7 +48,7 @@ export const useUpdatePack = ({ withRedirect, options }: UseUpdatePackProps) =>
|
|||
setErrorToast(error, { title: error?.body?.error, toastMessage: error?.body?.message });
|
||||
},
|
||||
onSuccess: (response) => {
|
||||
queryClient.invalidateQueries(PACKS_ID);
|
||||
queryClient.invalidateQueries([PACKS_ID]);
|
||||
if (withRedirect) {
|
||||
navigateToApp(PLUGIN_ID, { path: pagePathGetters.packs() });
|
||||
}
|
||||
|
|
|
@ -5,14 +5,12 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-empty-function */
|
||||
import { QueryClient } from '@tanstack/react-query';
|
||||
|
||||
import { QueryClient, setLogger } from 'react-query';
|
||||
|
||||
setLogger({
|
||||
log: () => {},
|
||||
warn: () => {},
|
||||
error: () => {},
|
||||
export const queryClient = new QueryClient({
|
||||
logger: {
|
||||
log: () => null,
|
||||
warn: () => null,
|
||||
error: () => null,
|
||||
},
|
||||
});
|
||||
|
||||
export const queryClient = new QueryClient();
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { useQuery } from 'react-query';
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { lastValueFrom } from 'rxjs';
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue