diff --git a/src/plugins/discover/public/__mocks__/discover_state.mock.ts b/src/plugins/discover/public/__mocks__/discover_state.mock.ts index 92e06f289d30..aeee4ad02117 100644 --- a/src/plugins/discover/public/__mocks__/discover_state.mock.ts +++ b/src/plugins/discover/public/__mocks__/discover_state.mock.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ import { createBrowserHistory } from 'history'; -import { getDiscoverStateContainer } from '../application/main/services/discover_state'; +import { getDiscoverStateContainer } from '../application/main/state_management/discover_state'; import { savedSearchMockWithTimeField, savedSearchMock } from './saved_search'; import { discoverServiceMock } from './services'; import { SavedSearch } from '@kbn/saved-search-plugin/public'; diff --git a/src/plugins/discover/public/__mocks__/search_session.ts b/src/plugins/discover/public/__mocks__/search_session.ts index abcd5e92a1cb..2902aea0a7aa 100644 --- a/src/plugins/discover/public/__mocks__/search_session.ts +++ b/src/plugins/discover/public/__mocks__/search_session.ts @@ -8,7 +8,7 @@ import { createMemoryHistory } from 'history'; import { dataPluginMock } from '@kbn/data-plugin/public/mocks'; import { DataPublicPluginStart } from '@kbn/data-plugin/public'; -import { DiscoverSearchSessionManager } from '../application/main/services/discover_search_session'; +import { DiscoverSearchSessionManager } from '../application/main/state_management/discover_search_session'; export function createSearchSessionMock( session = dataPluginMock.createStartContract().search.session as jest.Mocked< diff --git a/src/plugins/discover/public/application/main/components/field_stats_table/field_stats_tab.tsx b/src/plugins/discover/public/application/main/components/field_stats_table/field_stats_tab.tsx index f4d302d5c877..c020e380b155 100644 --- a/src/plugins/discover/public/application/main/components/field_stats_table/field_stats_tab.tsx +++ b/src/plugins/discover/public/application/main/components/field_stats_table/field_stats_tab.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { useQuerySubscriber } from '@kbn/unified-field-list/src/hooks/use_query_subscriber'; -import { useSavedSearch } from '../../services/discover_state_provider'; +import { useSavedSearch } from '../../state_management/discover_state_provider'; import { FieldStatisticsTable, type FieldStatisticsTableProps } from './field_stats_table'; import { useDiscoverServices } from '../../../../hooks/use_discover_services'; diff --git a/src/plugins/discover/public/application/main/components/field_stats_table/field_stats_table.tsx b/src/plugins/discover/public/application/main/components/field_stats_table/field_stats_table.tsx index bba3e23d3e70..20b38005aa9e 100644 --- a/src/plugins/discover/public/application/main/components/field_stats_table/field_stats_table.tsx +++ b/src/plugins/discover/public/application/main/components/field_stats_table/field_stats_table.tsx @@ -24,7 +24,7 @@ import useObservable from 'react-use/lib/useObservable'; import { of } from 'rxjs'; import { useDiscoverServices } from '../../../../hooks/use_discover_services'; import { FIELD_STATISTICS_LOADED } from './constants'; -import type { DiscoverStateContainer } from '../../services/discover_state'; +import type { DiscoverStateContainer } from '../../state_management/discover_state'; export interface RandomSamplingOption { mode: 'random_sampling'; seed: string; diff --git a/src/plugins/discover/public/application/main/components/layout/discover_documents.test.tsx b/src/plugins/discover/public/application/main/components/layout/discover_documents.test.tsx index d63da979e4ee..0fcd29247214 100644 --- a/src/plugins/discover/public/application/main/components/layout/discover_documents.test.tsx +++ b/src/plugins/discover/public/application/main/components/layout/discover_documents.test.tsx @@ -11,7 +11,7 @@ import { act } from 'react-dom/test-utils'; import { BehaviorSubject } from 'rxjs'; import { findTestSubject } from '@elastic/eui/lib/test'; import { mountWithIntl } from '@kbn/test-jest-helpers'; -import { DataDocuments$ } from '../../services/discover_data_state_container'; +import { DataDocuments$ } from '../../state_management/discover_data_state_container'; import { discoverServiceMock } from '../../../../__mocks__/services'; import { FetchStatus } from '../../../types'; import { DiscoverDocuments, onResize } from './discover_documents'; @@ -19,9 +19,9 @@ import { dataViewMock, esHitsMock } from '@kbn/discover-utils/src/__mocks__'; import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public'; import { buildDataTableRecord } from '@kbn/discover-utils'; import type { EsHitRecord } from '@kbn/discover-utils/types'; -import { DiscoverMainProvider } from '../../services/discover_state_provider'; +import { DiscoverMainProvider } from '../../state_management/discover_state_provider'; import { getDiscoverStateMock } from '../../../../__mocks__/discover_state.mock'; -import { DiscoverAppState } from '../../services/discover_app_state_container'; +import { DiscoverAppState } from '../../state_management/discover_app_state_container'; import { DiscoverCustomization, DiscoverCustomizationProvider } from '../../../../customizations'; import { createCustomizationService } from '../../../../customizations/customization_service'; import { DiscoverGrid } from '../../../../components/discover_grid'; diff --git a/src/plugins/discover/public/application/main/components/layout/discover_documents.tsx b/src/plugins/discover/public/application/main/components/layout/discover_documents.tsx index 3e733df290ea..8671cc289c28 100644 --- a/src/plugins/discover/public/application/main/components/layout/discover_documents.tsx +++ b/src/plugins/discover/public/application/main/components/layout/discover_documents.tsx @@ -42,12 +42,12 @@ import useObservable from 'react-use/lib/useObservable'; import type { DocViewFilterFn } from '@kbn/unified-doc-viewer/types'; import { DiscoverGrid } from '../../../../components/discover_grid'; import { getDefaultRowsPerPage } from '../../../../../common/constants'; -import { useInternalStateSelector } from '../../services/discover_internal_state_container'; -import { useAppStateSelector } from '../../services/discover_app_state_container'; +import { useInternalStateSelector } from '../../state_management/discover_internal_state_container'; +import { useAppStateSelector } from '../../state_management/discover_app_state_container'; import { useDiscoverServices } from '../../../../hooks/use_discover_services'; import { FetchStatus } from '../../../types'; -import { RecordRawType } from '../../services/discover_data_state_container'; -import { DiscoverStateContainer } from '../../services/discover_state'; +import { RecordRawType } from '../../state_management/discover_data_state_container'; +import { DiscoverStateContainer } from '../../state_management/discover_state'; import { useDataState } from '../../hooks/use_data_state'; import { DocTableInfinite } from '../../../../components/doc_table/doc_table_infinite'; import { DocumentExplorerCallout } from '../document_explorer_callout'; @@ -62,7 +62,7 @@ import { getAllowedSampleSize, } from '../../../../utils/get_allowed_sample_size'; import { DiscoverGridFlyout } from '../../../../components/discover_grid_flyout'; -import { useSavedSearchInitial } from '../../services/discover_state_provider'; +import { useSavedSearchInitial } from '../../state_management/discover_state_provider'; import { useFetchMoreRecords } from './use_fetch_more_records'; import { SelectedVSAvailableCallout } from './selected_vs_available_callout'; import { useDiscoverCustomization } from '../../../../customizations'; diff --git a/src/plugins/discover/public/application/main/components/layout/discover_histogram_layout.test.tsx b/src/plugins/discover/public/application/main/components/layout/discover_histogram_layout.test.tsx index afe323b290ad..a1d450d6aa61 100644 --- a/src/plugins/discover/public/application/main/components/layout/discover_histogram_layout.test.tsx +++ b/src/plugins/discover/public/application/main/components/layout/discover_histogram_layout.test.tsx @@ -18,7 +18,7 @@ import { DataMain$, DataTotalHits$, RecordRawType, -} from '../../services/discover_data_state_container'; +} from '../../state_management/discover_data_state_container'; import { discoverServiceMock } from '../../../../__mocks__/services'; import { FetchStatus, SidebarToggleState } from '../../../types'; import { KibanaRenderContextProvider } from '@kbn/react-kibana-context-render'; @@ -31,7 +31,7 @@ import { createSearchSessionMock } from '../../../../__mocks__/search_session'; import { searchSourceInstanceMock } from '@kbn/data-plugin/common/search/search_source/mocks'; import { getSessionServiceMock } from '@kbn/data-plugin/public/search/session/mocks'; import { getDiscoverStateMock } from '../../../../__mocks__/discover_state.mock'; -import { DiscoverMainProvider } from '../../services/discover_state_provider'; +import { DiscoverMainProvider } from '../../state_management/discover_state_provider'; import { act } from 'react-dom/test-utils'; import { PanelsToggle } from '../../../../components/panels_toggle'; diff --git a/src/plugins/discover/public/application/main/components/layout/discover_histogram_layout.tsx b/src/plugins/discover/public/application/main/components/layout/discover_histogram_layout.tsx index 6b53ea876901..207a2263b0e0 100644 --- a/src/plugins/discover/public/application/main/components/layout/discover_histogram_layout.tsx +++ b/src/plugins/discover/public/application/main/components/layout/discover_histogram_layout.tsx @@ -13,7 +13,7 @@ import useObservable from 'react-use/lib/useObservable'; import type { Datatable } from '@kbn/expressions-plugin/common'; import { useDiscoverHistogram } from './use_discover_histogram'; import { type DiscoverMainContentProps, DiscoverMainContent } from './discover_main_content'; -import { useAppStateSelector } from '../../services/discover_app_state_container'; +import { useAppStateSelector } from '../../state_management/discover_app_state_container'; import { FetchStatus } from '../../../types'; export interface DiscoverHistogramLayoutProps extends DiscoverMainContentProps { diff --git a/src/plugins/discover/public/application/main/components/layout/discover_layout.test.tsx b/src/plugins/discover/public/application/main/components/layout/discover_layout.test.tsx index 2d61a4dbdd7d..248b53051545 100644 --- a/src/plugins/discover/public/application/main/components/layout/discover_layout.test.tsx +++ b/src/plugins/discover/public/application/main/components/layout/discover_layout.test.tsx @@ -26,7 +26,7 @@ import { DataMain$, DataTotalHits$, RecordRawType, -} from '../../services/discover_data_state_container'; +} from '../../state_management/discover_data_state_container'; import { createDiscoverServicesMock } from '../../../../__mocks__/services'; import { FetchStatus } from '../../../types'; import { RequestAdapter } from '@kbn/inspector-plugin/common'; @@ -35,7 +35,7 @@ import { buildDataTableRecord } from '@kbn/discover-utils'; import { getDiscoverStateMock } from '../../../../__mocks__/discover_state.mock'; import { createSearchSessionMock } from '../../../../__mocks__/search_session'; import { getSessionServiceMock } from '@kbn/data-plugin/public/search/session/mocks'; -import { DiscoverMainProvider } from '../../services/discover_state_provider'; +import { DiscoverMainProvider } from '../../state_management/discover_state_provider'; import { act } from 'react-dom/test-utils'; import { ErrorCallout } from '../../../../components/common/error_callout'; import { PanelsToggle } from '../../../../components/panels_toggle'; diff --git a/src/plugins/discover/public/application/main/components/layout/discover_layout.tsx b/src/plugins/discover/public/application/main/components/layout/discover_layout.tsx index a104dc3c9d73..e40bd8335644 100644 --- a/src/plugins/discover/public/application/main/components/layout/discover_layout.tsx +++ b/src/plugins/discover/public/application/main/components/layout/discover_layout.tsx @@ -30,11 +30,11 @@ import { import { popularizeField, useColumns } from '@kbn/unified-data-table'; import { DocViewFilterFn } from '@kbn/unified-doc-viewer/types'; import { BehaviorSubject } from 'rxjs'; -import { useSavedSearchInitial } from '../../services/discover_state_provider'; -import { DiscoverStateContainer } from '../../services/discover_state'; +import { useSavedSearchInitial } from '../../state_management/discover_state_provider'; +import { DiscoverStateContainer } from '../../state_management/discover_state'; import { VIEW_MODE } from '../../../../../common/constants'; -import { useInternalStateSelector } from '../../services/discover_internal_state_container'; -import { useAppStateSelector } from '../../services/discover_app_state_container'; +import { useInternalStateSelector } from '../../state_management/discover_internal_state_container'; +import { useAppStateSelector } from '../../state_management/discover_app_state_container'; import { useDiscoverServices } from '../../../../hooks/use_discover_services'; import { DiscoverNoResults } from '../no_results'; import { LoadingSpinner } from '../loading_spinner/loading_spinner'; @@ -42,7 +42,7 @@ import { DiscoverSidebarResponsive } from '../sidebar'; import { DiscoverTopNav } from '../top_nav/discover_topnav'; import { getResultState } from '../../utils/get_result_state'; import { DiscoverUninitialized } from '../uninitialized/uninitialized'; -import { DataMainMsg, RecordRawType } from '../../services/discover_data_state_container'; +import { DataMainMsg, RecordRawType } from '../../state_management/discover_data_state_container'; import { FetchStatus, SidebarToggleState } from '../../../types'; import { useDataState } from '../../hooks/use_data_state'; import { getRawRecordType } from '../../utils/get_raw_record_type'; diff --git a/src/plugins/discover/public/application/main/components/layout/discover_main_content.test.tsx b/src/plugins/discover/public/application/main/components/layout/discover_main_content.test.tsx index c21fc8854c50..7cb6edcedcf5 100644 --- a/src/plugins/discover/public/application/main/components/layout/discover_main_content.test.tsx +++ b/src/plugins/discover/public/application/main/components/layout/discover_main_content.test.tsx @@ -19,7 +19,7 @@ import { DataMain$, DataTotalHits$, RecordRawType, -} from '../../services/discover_data_state_container'; +} from '../../state_management/discover_data_state_container'; import { createDiscoverServicesMock } from '../../../../__mocks__/services'; import { FetchStatus, SidebarToggleState } from '../../../types'; import { KibanaRenderContextProvider } from '@kbn/react-kibana-context-render'; @@ -31,7 +31,7 @@ import { DocumentViewModeToggle } from '../../../../components/view_mode_toggle' import { searchSourceInstanceMock } from '@kbn/data-plugin/common/search/search_source/mocks'; import { DiscoverDocuments } from './discover_documents'; import { FieldStatisticsTab } from '../field_stats_table'; -import { DiscoverMainProvider } from '../../services/discover_state_provider'; +import { DiscoverMainProvider } from '../../state_management/discover_state_provider'; import { getDiscoverStateMock } from '../../../../__mocks__/discover_state.mock'; import { PanelsToggle } from '../../../../components/panels_toggle'; import type { Storage } from '@kbn/kibana-utils-plugin/public'; diff --git a/src/plugins/discover/public/application/main/components/layout/discover_main_content.tsx b/src/plugins/discover/public/application/main/components/layout/discover_main_content.tsx index 092279d4243b..034e9773cefb 100644 --- a/src/plugins/discover/public/application/main/components/layout/discover_main_content.tsx +++ b/src/plugins/discover/public/application/main/components/layout/discover_main_content.tsx @@ -16,11 +16,11 @@ import type { DocViewFilterFn } from '@kbn/unified-doc-viewer/types'; import { VIEW_MODE } from '../../../../../common/constants'; import { useDiscoverServices } from '../../../../hooks/use_discover_services'; import { DocumentViewModeToggle } from '../../../../components/view_mode_toggle'; -import { DiscoverStateContainer } from '../../services/discover_state'; +import { DiscoverStateContainer } from '../../state_management/discover_state'; import { FieldStatisticsTab } from '../field_stats_table'; import { DiscoverDocuments } from './discover_documents'; import { DOCUMENTS_VIEW_CLICK, FIELD_STATISTICS_VIEW_CLICK } from '../field_stats_table/constants'; -import { useAppStateSelector } from '../../services/discover_app_state_container'; +import { useAppStateSelector } from '../../state_management/discover_app_state_container'; import type { PanelsToggleProps } from '../../../../components/panels_toggle'; const DROP_PROPS = { diff --git a/src/plugins/discover/public/application/main/components/layout/use_discover_histogram.test.tsx b/src/plugins/discover/public/application/main/components/layout/use_discover_histogram.test.tsx index 068f21863de6..98d178ed5466 100644 --- a/src/plugins/discover/public/application/main/components/layout/use_discover_histogram.test.tsx +++ b/src/plugins/discover/public/application/main/components/layout/use_discover_histogram.test.tsx @@ -11,12 +11,12 @@ import { AggregateQuery, Query } from '@kbn/es-query'; import { act, renderHook, WrapperComponent } from '@testing-library/react-hooks'; import { BehaviorSubject, Subject } from 'rxjs'; import { FetchStatus } from '../../../types'; -import type { DiscoverStateContainer } from '../../services/discover_state'; +import type { DiscoverStateContainer } from '../../state_management/discover_state'; import { dataPluginMock } from '@kbn/data-plugin/public/mocks'; import { useDiscoverHistogram, UseDiscoverHistogramProps } from './use_discover_histogram'; import { setTimeout } from 'timers/promises'; import { getDiscoverStateMock } from '../../../../__mocks__/discover_state.mock'; -import { DiscoverMainProvider } from '../../services/discover_state_provider'; +import { DiscoverMainProvider } from '../../state_management/discover_state_provider'; import { RequestAdapter } from '@kbn/inspector-plugin/public'; import { UnifiedHistogramFetchStatus, diff --git a/src/plugins/discover/public/application/main/components/layout/use_discover_histogram.ts b/src/plugins/discover/public/application/main/components/layout/use_discover_histogram.ts index 5617b724df49..bf5fbafa9579 100644 --- a/src/plugins/discover/public/application/main/components/layout/use_discover_histogram.ts +++ b/src/plugins/discover/public/application/main/components/layout/use_discover_histogram.ts @@ -37,12 +37,15 @@ import { useDiscoverServices } from '../../../../hooks/use_discover_services'; import { FetchStatus } from '../../../types'; import type { InspectorAdapters } from '../../hooks/use_inspector'; import { checkHitCount, sendErrorTo } from '../../hooks/use_saved_search_messages'; -import type { DiscoverStateContainer } from '../../services/discover_state'; +import type { DiscoverStateContainer } from '../../state_management/discover_state'; import { addLog } from '../../../../utils/add_log'; -import { useInternalStateSelector } from '../../services/discover_internal_state_container'; -import type { DiscoverAppState } from '../../services/discover_app_state_container'; -import { DataDocumentsMsg, RecordRawType } from '../../services/discover_data_state_container'; -import { useSavedSearch } from '../../services/discover_state_provider'; +import { useInternalStateSelector } from '../../state_management/discover_internal_state_container'; +import type { DiscoverAppState } from '../../state_management/discover_app_state_container'; +import { + DataDocumentsMsg, + RecordRawType, +} from '../../state_management/discover_data_state_container'; +import { useSavedSearch } from '../../state_management/discover_state_provider'; const EMPTY_TEXT_BASED_COLUMNS: DatatableColumn[] = []; const EMPTY_FILTERS: Filter[] = []; diff --git a/src/plugins/discover/public/application/main/components/layout/use_fetch_more_records.test.tsx b/src/plugins/discover/public/application/main/components/layout/use_fetch_more_records.test.tsx index 5149bcc46df2..3d5317d704c0 100644 --- a/src/plugins/discover/public/application/main/components/layout/use_fetch_more_records.test.tsx +++ b/src/plugins/discover/public/application/main/components/layout/use_fetch_more_records.test.tsx @@ -12,7 +12,10 @@ import { buildDataTableRecord } from '@kbn/discover-utils'; import { dataViewMock, esHitsMockWithSort } from '@kbn/discover-utils/src/__mocks__'; import { useFetchMoreRecords } from './use_fetch_more_records'; import { getDiscoverStateMock } from '../../../../__mocks__/discover_state.mock'; -import { DataDocuments$, DataTotalHits$ } from '../../services/discover_data_state_container'; +import { + DataDocuments$, + DataTotalHits$, +} from '../../state_management/discover_data_state_container'; import { FetchStatus } from '../../../types'; describe('useFetchMoreRecords', () => { diff --git a/src/plugins/discover/public/application/main/components/layout/use_fetch_more_records.ts b/src/plugins/discover/public/application/main/components/layout/use_fetch_more_records.ts index e9b6c1c01785..381ded3fc17d 100644 --- a/src/plugins/discover/public/application/main/components/layout/use_fetch_more_records.ts +++ b/src/plugins/discover/public/application/main/components/layout/use_fetch_more_records.ts @@ -9,7 +9,7 @@ import { useMemo } from 'react'; import { FetchStatus } from '../../../types'; import { useDataState } from '../../hooks/use_data_state'; -import type { DiscoverStateContainer } from '../../services/discover_state'; +import type { DiscoverStateContainer } from '../../state_management/discover_state'; /** * Params for the hook diff --git a/src/plugins/discover/public/application/main/components/no_results/no_results.tsx b/src/plugins/discover/public/application/main/components/no_results/no_results.tsx index cf20a679d956..23bc572a2629 100644 --- a/src/plugins/discover/public/application/main/components/no_results/no_results.tsx +++ b/src/plugins/discover/public/application/main/components/no_results/no_results.tsx @@ -12,7 +12,7 @@ import type { DataView } from '@kbn/data-views-plugin/common'; import type { AggregateQuery, Filter, Query } from '@kbn/es-query'; import { SearchResponseWarningsEmptyPrompt } from '@kbn/search-response-warnings'; import { NoResultsSuggestions } from './no_results_suggestions'; -import type { DiscoverStateContainer } from '../../services/discover_state'; +import type { DiscoverStateContainer } from '../../state_management/discover_state'; import { useDataState } from '../../hooks/use_data_state'; import './_no_results.scss'; diff --git a/src/plugins/discover/public/application/main/components/sidebar/discover_sidebar_responsive.test.tsx b/src/plugins/discover/public/application/main/components/sidebar/discover_sidebar_responsive.test.tsx index 41a90d7a8520..d245eb337bff 100644 --- a/src/plugins/discover/public/application/main/components/sidebar/discover_sidebar_responsive.test.tsx +++ b/src/plugins/discover/public/application/main/components/sidebar/discover_sidebar_responsive.test.tsx @@ -24,11 +24,11 @@ import { AvailableFields$, DataDocuments$, RecordRawType, -} from '../../services/discover_data_state_container'; +} from '../../state_management/discover_data_state_container'; import { stubLogstashDataView } from '@kbn/data-plugin/common/stubs'; import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public'; import { getDiscoverStateMock } from '../../../../__mocks__/discover_state.mock'; -import { DiscoverAppStateProvider } from '../../services/discover_app_state_container'; +import { DiscoverAppStateProvider } from '../../state_management/discover_app_state_container'; import * as ExistingFieldsServiceApi from '@kbn/unified-field-list/src/services/field_existing/load_field_existing'; import { resetExistingFieldsCache } from '@kbn/unified-field-list/src/hooks/use_existing_fields'; import { createDiscoverServicesMock } from '../../../../__mocks__/services'; diff --git a/src/plugins/discover/public/application/main/components/sidebar/discover_sidebar_responsive.tsx b/src/plugins/discover/public/application/main/components/sidebar/discover_sidebar_responsive.tsx index ae1e26b54896..e9caffaecccb 100644 --- a/src/plugins/discover/public/application/main/components/sidebar/discover_sidebar_responsive.tsx +++ b/src/plugins/discover/public/application/main/components/sidebar/discover_sidebar_responsive.tsx @@ -27,7 +27,7 @@ import { AvailableFields$, DataDocuments$, RecordRawType, -} from '../../services/discover_data_state_container'; +} from '../../state_management/discover_data_state_container'; import { calcFieldCounts } from '../../utils/calc_field_counts'; import { FetchStatus, SidebarToggleState } from '../../../types'; import { DISCOVER_TOUR_STEP_ANCHOR_IDS } from '../../../../components/discover_tour'; diff --git a/src/plugins/discover/public/application/main/components/top_nav/discover_topnav.test.tsx b/src/plugins/discover/public/application/main/components/top_nav/discover_topnav.test.tsx index 4626eafec936..96533247fadd 100644 --- a/src/plugins/discover/public/application/main/components/top_nav/discover_topnav.test.tsx +++ b/src/plugins/discover/public/application/main/components/top_nav/discover_topnav.test.tsx @@ -13,7 +13,7 @@ import { DiscoverTopNav, DiscoverTopNavProps } from './discover_topnav'; import { TopNavMenu, TopNavMenuData } from '@kbn/navigation-plugin/public'; import { discoverServiceMock as mockDiscoverService } from '../../../../__mocks__/services'; import { getDiscoverStateMock } from '../../../../__mocks__/discover_state.mock'; -import { DiscoverMainProvider } from '../../services/discover_state_provider'; +import { DiscoverMainProvider } from '../../state_management/discover_state_provider'; import type { SearchBarCustomization, TopNavCustomization } from '../../../../customizations'; import type { DiscoverCustomizationId } from '../../../../customizations/customization_service'; import { useDiscoverCustomization } from '../../../../customizations'; diff --git a/src/plugins/discover/public/application/main/components/top_nav/discover_topnav.tsx b/src/plugins/discover/public/application/main/components/top_nav/discover_topnav.tsx index 9353df2c63a2..6222a909a422 100644 --- a/src/plugins/discover/public/application/main/components/top_nav/discover_topnav.tsx +++ b/src/plugins/discover/public/application/main/components/top_nav/discover_topnav.tsx @@ -16,14 +16,14 @@ import { useSavedSearch, useSavedSearchHasChanged, useSavedSearchInitial, -} from '../../services/discover_state_provider'; -import { useInternalStateSelector } from '../../services/discover_internal_state_container'; +} from '../../state_management/discover_state_provider'; +import { useInternalStateSelector } from '../../state_management/discover_internal_state_container'; import { useDiscoverServices } from '../../../../hooks/use_discover_services'; -import type { DiscoverStateContainer } from '../../services/discover_state'; +import type { DiscoverStateContainer } from '../../state_management/discover_state'; import { onSaveSearch } from './on_save_search'; import { useDiscoverCustomization } from '../../../../customizations'; import { addLog } from '../../../../utils/add_log'; -import { useAppStateSelector } from '../../services/discover_app_state_container'; +import { useAppStateSelector } from '../../state_management/discover_app_state_container'; import { isTextBasedQuery } from '../../utils/is_text_based_query'; import { useDiscoverTopNav } from './use_discover_topnav'; diff --git a/src/plugins/discover/public/application/main/components/top_nav/discover_topnav_inline.test.tsx b/src/plugins/discover/public/application/main/components/top_nav/discover_topnav_inline.test.tsx index 811b009effdc..e3762d5e3077 100644 --- a/src/plugins/discover/public/application/main/components/top_nav/discover_topnav_inline.test.tsx +++ b/src/plugins/discover/public/application/main/components/top_nav/discover_topnav_inline.test.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; -import { DiscoverMainProvider } from '../../services/discover_state_provider'; +import { DiscoverMainProvider } from '../../state_management/discover_state_provider'; import { DiscoverTopNavInline } from './discover_topnav_inline'; import { getDiscoverStateMock } from '../../../../__mocks__/discover_state.mock'; import { dataViewMock } from '@kbn/discover-utils/src/__mocks__'; diff --git a/src/plugins/discover/public/application/main/components/top_nav/discover_topnav_inline.tsx b/src/plugins/discover/public/application/main/components/top_nav/discover_topnav_inline.tsx index 2cdb3ec0c008..eddabff4dcb1 100644 --- a/src/plugins/discover/public/application/main/components/top_nav/discover_topnav_inline.tsx +++ b/src/plugins/discover/public/application/main/components/top_nav/discover_topnav_inline.tsx @@ -13,7 +13,7 @@ import { euiThemeVars } from '@kbn/ui-theme'; import { LogsExplorerTabs } from '../../../../components/logs_explorer_tabs'; import { useDiscoverServices } from '../../../../hooks/use_discover_services'; import { useDiscoverTopNav } from './use_discover_topnav'; -import type { DiscoverStateContainer } from '../../services/discover_state'; +import type { DiscoverStateContainer } from '../../state_management/discover_state'; export const DiscoverTopNavInline = ({ stateContainer, diff --git a/src/plugins/discover/public/application/main/components/top_nav/get_top_nav_badges.tsx b/src/plugins/discover/public/application/main/components/top_nav/get_top_nav_badges.tsx index 30d58a58e188..6948eb08e039 100644 --- a/src/plugins/discover/public/application/main/components/top_nav/get_top_nav_badges.tsx +++ b/src/plugins/discover/public/application/main/components/top_nav/get_top_nav_badges.tsx @@ -10,7 +10,7 @@ import type { TopNavMenuBadgeProps } from '@kbn/navigation-plugin/public'; import { getTopNavUnsavedChangesBadge } from '@kbn/unsaved-changes-badge'; import { getManagedContentBadge } from '@kbn/managed-content-badge'; import { i18n } from '@kbn/i18n'; -import { DiscoverStateContainer } from '../../services/discover_state'; +import { DiscoverStateContainer } from '../../state_management/discover_state'; import type { TopNavCustomization } from '../../../../customizations'; import { onSaveSearch } from './on_save_search'; import { DiscoverServices } from '../../../../build_services'; diff --git a/src/plugins/discover/public/application/main/components/top_nav/get_top_nav_links.test.ts b/src/plugins/discover/public/application/main/components/top_nav/get_top_nav_links.test.ts index e83f517242e3..9b5451558529 100644 --- a/src/plugins/discover/public/application/main/components/top_nav/get_top_nav_links.test.ts +++ b/src/plugins/discover/public/application/main/components/top_nav/get_top_nav_links.test.ts @@ -9,7 +9,7 @@ import { getTopNavLinks } from './get_top_nav_links'; import { dataViewMock } from '@kbn/discover-utils/src/__mocks__'; import { DiscoverServices } from '../../../../build_services'; -import { DiscoverStateContainer } from '../../services/discover_state'; +import { DiscoverStateContainer } from '../../state_management/discover_state'; const services = { capabilities: { diff --git a/src/plugins/discover/public/application/main/components/top_nav/get_top_nav_links.tsx b/src/plugins/discover/public/application/main/components/top_nav/get_top_nav_links.tsx index 730f463bb123..a072e02b370d 100644 --- a/src/plugins/discover/public/application/main/components/top_nav/get_top_nav_links.tsx +++ b/src/plugins/discover/public/application/main/components/top_nav/get_top_nav_links.tsx @@ -15,7 +15,7 @@ import { showOpenSearchPanel } from './show_open_search_panel'; import { getSharingData, showPublicUrlSwitch } from '../../../../utils/get_sharing_data'; import { DiscoverServices } from '../../../../build_services'; import { onSaveSearch } from './on_save_search'; -import { DiscoverStateContainer } from '../../services/discover_state'; +import { DiscoverStateContainer } from '../../state_management/discover_state'; import { openAlertsPopover } from './open_alerts_popover'; import type { TopNavCustomization } from '../../../../customizations'; diff --git a/src/plugins/discover/public/application/main/components/top_nav/on_save_search.test.tsx b/src/plugins/discover/public/application/main/components/top_nav/on_save_search.test.tsx index f46952c1ff5f..cd9552944d83 100644 --- a/src/plugins/discover/public/application/main/components/top_nav/on_save_search.test.tsx +++ b/src/plugins/discover/public/application/main/components/top_nav/on_save_search.test.tsx @@ -13,7 +13,7 @@ import { dataViewMock } from '@kbn/discover-utils/src/__mocks__'; import { dataViewWithTimefieldMock } from '../../../../__mocks__/data_view_with_timefield'; import { onSaveSearch } from './on_save_search'; import { savedSearchMock } from '../../../../__mocks__/saved_search'; -import { getDiscoverStateContainer } from '../../services/discover_state'; +import { getDiscoverStateContainer } from '../../state_management/discover_state'; import { ReactElement } from 'react'; import { discoverServiceMock } from '../../../../__mocks__/services'; import { SavedSearch } from '@kbn/saved-search-plugin/public'; diff --git a/src/plugins/discover/public/application/main/components/top_nav/on_save_search.tsx b/src/plugins/discover/public/application/main/components/top_nav/on_save_search.tsx index 6414d7b5685f..57bcf6baa4e8 100644 --- a/src/plugins/discover/public/application/main/components/top_nav/on_save_search.tsx +++ b/src/plugins/discover/public/application/main/components/top_nav/on_save_search.tsx @@ -15,7 +15,7 @@ import { SavedObjectSaveModal, showSaveModal, OnSaveProps } from '@kbn/saved-obj import { SavedSearch, SaveSavedSearchOptions } from '@kbn/saved-search-plugin/public'; import { isLegacyTableEnabled } from '@kbn/discover-utils'; import { DiscoverServices } from '../../../../build_services'; -import { DiscoverStateContainer } from '../../services/discover_state'; +import { DiscoverStateContainer } from '../../state_management/discover_state'; import { getAllowedSampleSize } from '../../../../utils/get_allowed_sample_size'; async function saveDataSource({ diff --git a/src/plugins/discover/public/application/main/components/top_nav/open_alerts_popover.tsx b/src/plugins/discover/public/application/main/components/top_nav/open_alerts_popover.tsx index de6e9607c087..36bea3fb2150 100644 --- a/src/plugins/discover/public/application/main/components/top_nav/open_alerts_popover.tsx +++ b/src/plugins/discover/public/application/main/components/top_nav/open_alerts_popover.tsx @@ -20,7 +20,7 @@ import { STACK_ALERTS_FEATURE_ID, } from '@kbn/rule-data-utils'; import { RuleTypeMetaData } from '@kbn/alerting-plugin/common'; -import { DiscoverStateContainer } from '../../services/discover_state'; +import { DiscoverStateContainer } from '../../state_management/discover_state'; import { DiscoverServices } from '../../../../build_services'; const container = document.createElement('div'); diff --git a/src/plugins/discover/public/application/main/components/top_nav/use_discover_topnav.ts b/src/plugins/discover/public/application/main/components/top_nav/use_discover_topnav.ts index 7304fd941c4a..58eda4f29267 100644 --- a/src/plugins/discover/public/application/main/components/top_nav/use_discover_topnav.ts +++ b/src/plugins/discover/public/application/main/components/top_nav/use_discover_topnav.ts @@ -11,9 +11,9 @@ import useObservable from 'react-use/lib/useObservable'; import { useDiscoverCustomization } from '../../../../customizations'; import { useDiscoverServices } from '../../../../hooks/use_discover_services'; import { useInspector } from '../../hooks/use_inspector'; -import { useAppStateSelector } from '../../services/discover_app_state_container'; -import { useInternalStateSelector } from '../../services/discover_internal_state_container'; -import type { DiscoverStateContainer } from '../../services/discover_state'; +import { useAppStateSelector } from '../../state_management/discover_app_state_container'; +import { useInternalStateSelector } from '../../state_management/discover_internal_state_container'; +import type { DiscoverStateContainer } from '../../state_management/discover_state'; import { isTextBasedQuery } from '../../utils/is_text_based_query'; import { getTopNavBadges } from './get_top_nav_badges'; import { getTopNavLinks } from './get_top_nav_links'; diff --git a/src/plugins/discover/public/application/main/utils/fetch_all.test.ts b/src/plugins/discover/public/application/main/data_fetching/fetch_all.test.ts similarity index 99% rename from src/plugins/discover/public/application/main/utils/fetch_all.test.ts rename to src/plugins/discover/public/application/main/data_fetching/fetch_all.test.ts index 13aaedeeb6e9..e41047dedb88 100644 --- a/src/plugins/discover/public/application/main/utils/fetch_all.test.ts +++ b/src/plugins/discover/public/application/main/data_fetching/fetch_all.test.ts @@ -20,7 +20,7 @@ import { DataTotalHitsMsg, RecordRawType, SavedSearchData, -} from '../services/discover_data_state_container'; +} from '../state_management/discover_data_state_container'; import { fetchDocuments } from './fetch_documents'; import { fetchTextBased } from './fetch_text_based'; import { buildDataTableRecord } from '@kbn/discover-utils'; diff --git a/src/plugins/discover/public/application/main/utils/fetch_all.ts b/src/plugins/discover/public/application/main/data_fetching/fetch_all.ts similarity index 96% rename from src/plugins/discover/public/application/main/utils/fetch_all.ts rename to src/plugins/discover/public/application/main/data_fetching/fetch_all.ts index 9504ffed7783..2d003680904d 100644 --- a/src/plugins/discover/public/application/main/utils/fetch_all.ts +++ b/src/plugins/discover/public/application/main/data_fetching/fetch_all.ts @@ -10,9 +10,9 @@ import type { SavedSearch, SortOrder } from '@kbn/saved-search-plugin/public'; import { BehaviorSubject, filter, firstValueFrom, map, merge, scan } from 'rxjs'; import { reportPerformanceMetricEvent } from '@kbn/ebt-tools'; import { isEqual } from 'lodash'; -import type { DiscoverAppState } from '../services/discover_app_state_container'; +import type { DiscoverAppState } from '../state_management/discover_app_state_container'; import { updateVolatileSearchSource } from './update_search_source'; -import { getRawRecordType } from './get_raw_record_type'; +import { getRawRecordType } from '../utils/get_raw_record_type'; import { checkHitCount, sendCompleteMsg, @@ -25,10 +25,14 @@ import { } from '../hooks/use_saved_search_messages'; import { fetchDocuments } from './fetch_documents'; import { FetchStatus } from '../../types'; -import { DataMsg, RecordRawType, SavedSearchData } from '../services/discover_data_state_container'; +import { + DataMsg, + RecordRawType, + SavedSearchData, +} from '../state_management/discover_data_state_container'; import { DiscoverServices } from '../../../build_services'; import { fetchTextBased } from './fetch_text_based'; -import { InternalState } from '../services/discover_internal_state_container'; +import { InternalState } from '../state_management/discover_internal_state_container'; export interface FetchDeps { abortController: AbortController; diff --git a/src/plugins/discover/public/application/main/utils/fetch_documents.test.ts b/src/plugins/discover/public/application/main/data_fetching/fetch_documents.test.ts similarity index 100% rename from src/plugins/discover/public/application/main/utils/fetch_documents.test.ts rename to src/plugins/discover/public/application/main/data_fetching/fetch_documents.test.ts diff --git a/src/plugins/discover/public/application/main/utils/fetch_documents.ts b/src/plugins/discover/public/application/main/data_fetching/fetch_documents.ts similarity index 100% rename from src/plugins/discover/public/application/main/utils/fetch_documents.ts rename to src/plugins/discover/public/application/main/data_fetching/fetch_documents.ts diff --git a/src/plugins/discover/public/application/main/utils/fetch_text_based.ts b/src/plugins/discover/public/application/main/data_fetching/fetch_text_based.ts similarity index 100% rename from src/plugins/discover/public/application/main/utils/fetch_text_based.ts rename to src/plugins/discover/public/application/main/data_fetching/fetch_text_based.ts diff --git a/src/plugins/discover/public/application/main/utils/get_fetch_observable.ts b/src/plugins/discover/public/application/main/data_fetching/get_fetch_observable.ts similarity index 90% rename from src/plugins/discover/public/application/main/utils/get_fetch_observable.ts rename to src/plugins/discover/public/application/main/data_fetching/get_fetch_observable.ts index c6a1aade3679..f4a6bb70045c 100644 --- a/src/plugins/discover/public/application/main/utils/get_fetch_observable.ts +++ b/src/plugins/discover/public/application/main/data_fetching/get_fetch_observable.ts @@ -14,8 +14,8 @@ import type { ISearchSource, } from '@kbn/data-plugin/public'; import { FetchStatus } from '../../types'; -import { DataMain$, DataRefetch$ } from '../services/discover_data_state_container'; -import { DiscoverSearchSessionManager } from '../services/discover_search_session'; +import { DataMain$, DataRefetch$ } from '../state_management/discover_data_state_container'; +import { DiscoverSearchSessionManager } from '../state_management/discover_search_session'; /** * This function returns an observable that's used to trigger data fetching diff --git a/src/plugins/discover/public/application/main/utils/get_fetch_observeable.test.ts b/src/plugins/discover/public/application/main/data_fetching/get_fetch_observeable.test.ts similarity index 97% rename from src/plugins/discover/public/application/main/utils/get_fetch_observeable.test.ts rename to src/plugins/discover/public/application/main/data_fetching/get_fetch_observeable.test.ts index 10e1b397dc65..e483d0127ea4 100644 --- a/src/plugins/discover/public/application/main/utils/get_fetch_observeable.test.ts +++ b/src/plugins/discover/public/application/main/data_fetching/get_fetch_observeable.test.ts @@ -11,7 +11,7 @@ import { getFetch$ } from './get_fetch_observable'; import { FetchStatus } from '../../types'; import { DataPublicPluginStart } from '@kbn/data-plugin/public'; import { createSearchSessionMock } from '../../../__mocks__/search_session'; -import { DataRefetch$ } from '../services/discover_data_state_container'; +import { DataRefetch$ } from '../state_management/discover_data_state_container'; import { savedSearchMock, savedSearchMockWithTimeField } from '../../../__mocks__/saved_search'; function createDataMock( diff --git a/src/plugins/discover/public/application/main/utils/update_search_source.test.ts b/src/plugins/discover/public/application/main/data_fetching/update_search_source.test.ts similarity index 100% rename from src/plugins/discover/public/application/main/utils/update_search_source.test.ts rename to src/plugins/discover/public/application/main/data_fetching/update_search_source.test.ts diff --git a/src/plugins/discover/public/application/main/utils/update_search_source.ts b/src/plugins/discover/public/application/main/data_fetching/update_search_source.ts similarity index 100% rename from src/plugins/discover/public/application/main/utils/update_search_source.ts rename to src/plugins/discover/public/application/main/data_fetching/update_search_source.ts diff --git a/src/plugins/discover/public/application/main/discover_main_app.test.tsx b/src/plugins/discover/public/application/main/discover_main_app.test.tsx index 43566c95a332..14b5eaecb68d 100644 --- a/src/plugins/discover/public/application/main/discover_main_app.test.tsx +++ b/src/plugins/discover/public/application/main/discover_main_app.test.tsx @@ -17,7 +17,7 @@ import { discoverServiceMock } from '../../__mocks__/services'; import { Router } from '@kbn/shared-ux-router'; import { createMemoryHistory } from 'history'; import { getDiscoverStateMock } from '../../__mocks__/discover_state.mock'; -import { DiscoverMainProvider } from './services/discover_state_provider'; +import { DiscoverMainProvider } from './state_management/discover_state_provider'; discoverServiceMock.data.query.timefilter.timefilter.getTime = () => { return { from: '2020-05-14T11:05:13.590', to: '2020-05-14T11:20:13.590' }; diff --git a/src/plugins/discover/public/application/main/discover_main_app.tsx b/src/plugins/discover/public/application/main/discover_main_app.tsx index d10e74a66523..7872aa544030 100644 --- a/src/plugins/discover/public/application/main/discover_main_app.tsx +++ b/src/plugins/discover/public/application/main/discover_main_app.tsx @@ -9,13 +9,13 @@ import React, { useEffect } from 'react'; import { RootDragDropProvider } from '@kbn/dom-drag-drop'; import { useUrlTracking } from './hooks/use_url_tracking'; -import { DiscoverStateContainer } from './services/discover_state'; +import { DiscoverStateContainer } from './state_management/discover_state'; import { DiscoverLayout } from './components/layout'; import { setBreadcrumbs } from '../../utils/breadcrumbs'; import { addHelpMenuToAppChrome } from '../../components/help_menu/help_menu_util'; import { useDiscoverServices } from '../../hooks/use_discover_services'; import { useSavedSearchAliasMatchRedirect } from '../../hooks/saved_search_alias_match_redirect'; -import { useSavedSearchInitial } from './services/discover_state_provider'; +import { useSavedSearchInitial } from './state_management/discover_state_provider'; import { useAdHocDataViews } from './hooks/use_adhoc_data_views'; import { useTextBasedQueryLanguage } from './hooks/use_text_based_query_language'; import { addLog } from '../../utils/add_log'; diff --git a/src/plugins/discover/public/application/main/discover_main_route.tsx b/src/plugins/discover/public/application/main/discover_main_route.tsx index 2d82d47cddaf..b0c5ff4bc534 100644 --- a/src/plugins/discover/public/application/main/discover_main_route.tsx +++ b/src/plugins/discover/public/application/main/discover_main_route.tsx @@ -31,7 +31,7 @@ import { LoadingIndicator } from '../../components/common/loading_indicator'; import { DiscoverError } from '../../components/common/error_alert'; import { useDiscoverServices } from '../../hooks/use_discover_services'; import { useAlertResultsToast } from './hooks/use_alert_results_toast'; -import { DiscoverMainProvider } from './services/discover_state_provider'; +import { DiscoverMainProvider } from './state_management/discover_state_provider'; import { CustomizationCallback, DiscoverCustomizationContext, @@ -40,7 +40,7 @@ import { } from '../../customizations'; import { DiscoverTopNavInline } from './components/top_nav/discover_topnav_inline'; import { isTextBasedQuery } from './utils/is_text_based_query'; -import { DiscoverStateContainer, LoadParams } from './services/discover_state'; +import { DiscoverStateContainer, LoadParams } from './state_management/discover_state'; const DiscoverMainAppMemoized = memo(DiscoverMainApp); diff --git a/src/plugins/discover/public/application/main/hooks/use_adhoc_data_views.ts b/src/plugins/discover/public/application/main/hooks/use_adhoc_data_views.ts index 5b5aac2310e6..9bb13020533f 100644 --- a/src/plugins/discover/public/application/main/hooks/use_adhoc_data_views.ts +++ b/src/plugins/discover/public/application/main/hooks/use_adhoc_data_views.ts @@ -9,12 +9,12 @@ import { useEffect } from 'react'; import { METRIC_TYPE } from '@kbn/analytics'; import { DiscoverServices } from '../../../build_services'; -import { useSavedSearch } from '../services/discover_state_provider'; +import { useSavedSearch } from '../state_management/discover_state_provider'; import { isTextBasedQuery } from '../utils/is_text_based_query'; -import { useAppStateSelector } from '../services/discover_app_state_container'; -import { useInternalStateSelector } from '../services/discover_internal_state_container'; +import { useAppStateSelector } from '../state_management/discover_app_state_container'; +import { useInternalStateSelector } from '../state_management/discover_internal_state_container'; import { ADHOC_DATA_VIEW_RENDER_EVENT } from '../../../constants'; -import { DiscoverStateContainer } from '../services/discover_state'; +import { DiscoverStateContainer } from '../state_management/discover_state'; import { useFiltersValidation } from './use_filters_validation'; export const useAdHocDataViews = ({ diff --git a/src/plugins/discover/public/application/main/hooks/use_data_state.ts b/src/plugins/discover/public/application/main/hooks/use_data_state.ts index 60aaa385716e..44572bc231a2 100644 --- a/src/plugins/discover/public/application/main/hooks/use_data_state.ts +++ b/src/plugins/discover/public/application/main/hooks/use_data_state.ts @@ -7,7 +7,7 @@ */ import { useState, useEffect } from 'react'; import { BehaviorSubject } from 'rxjs'; -import { DataMsg } from '../services/discover_data_state_container'; +import { DataMsg } from '../state_management/discover_data_state_container'; export function useDataState(data$: BehaviorSubject) { const [fetchState, setFetchState] = useState(data$.getValue()); diff --git a/src/plugins/discover/public/application/main/hooks/use_discover_state_container.ts b/src/plugins/discover/public/application/main/hooks/use_discover_state_container.ts index 5ae3d0d6085f..0a2b65e9c967 100644 --- a/src/plugins/discover/public/application/main/hooks/use_discover_state_container.ts +++ b/src/plugins/discover/public/application/main/hooks/use_discover_state_container.ts @@ -11,7 +11,7 @@ import { DiscoverStateContainer, getDiscoverStateContainer, DiscoverStateContainerParams, -} from '../services/discover_state'; +} from '../state_management/discover_state'; /** * Creates a state container using the initial params and allows to reset it. diff --git a/src/plugins/discover/public/application/main/hooks/use_inspector.ts b/src/plugins/discover/public/application/main/hooks/use_inspector.ts index 45120d524144..80c4b218b4c4 100644 --- a/src/plugins/discover/public/application/main/hooks/use_inspector.ts +++ b/src/plugins/discover/public/application/main/hooks/use_inspector.ts @@ -12,7 +12,7 @@ import { RequestAdapter, Start as InspectorPublicPluginStart, } from '@kbn/inspector-plugin/public'; -import { DiscoverStateContainer } from '../services/discover_state'; +import { DiscoverStateContainer } from '../state_management/discover_state'; import { AggregateRequestAdapter } from '../utils/aggregate_request_adapter'; export interface InspectorAdapters { diff --git a/src/plugins/discover/public/application/main/hooks/use_saved_search_messages.test.ts b/src/plugins/discover/public/application/main/hooks/use_saved_search_messages.test.ts index f8c9b87e1699..6faf1c29257d 100644 --- a/src/plugins/discover/public/application/main/hooks/use_saved_search_messages.test.ts +++ b/src/plugins/discover/public/application/main/hooks/use_saved_search_messages.test.ts @@ -22,7 +22,7 @@ import { DataDocumentsMsg, DataMainMsg, RecordRawType, -} from '../services/discover_data_state_container'; +} from '../state_management/discover_data_state_container'; import { filter } from 'rxjs'; import { dataViewMock, esHitsMockWithSort } from '@kbn/discover-utils/src/__mocks__'; import { buildDataTableRecord } from '@kbn/discover-utils'; diff --git a/src/plugins/discover/public/application/main/hooks/use_saved_search_messages.ts b/src/plugins/discover/public/application/main/hooks/use_saved_search_messages.ts index b5f6e0f2176f..9374045d4b0d 100644 --- a/src/plugins/discover/public/application/main/hooks/use_saved_search_messages.ts +++ b/src/plugins/discover/public/application/main/hooks/use_saved_search_messages.ts @@ -16,8 +16,8 @@ import type { DataMsg, DataTotalHits$, SavedSearchData, -} from '../services/discover_data_state_container'; -import { RecordRawType } from '../services/discover_data_state_container'; +} from '../state_management/discover_data_state_container'; +import { RecordRawType } from '../state_management/discover_data_state_container'; /** * Sends COMPLETE message to the main$ observable with the information diff --git a/src/plugins/discover/public/application/main/hooks/use_test_based_query_language.test.tsx b/src/plugins/discover/public/application/main/hooks/use_test_based_query_language.test.tsx index 559f2bf03b27..c7d530360ca3 100644 --- a/src/plugins/discover/public/application/main/hooks/use_test_based_query_language.test.tsx +++ b/src/plugins/discover/public/application/main/hooks/use_test_based_query_language.test.tsx @@ -12,16 +12,16 @@ import { DataViewsContract } from '@kbn/data-plugin/public'; import { discoverServiceMock } from '../../../__mocks__/services'; import { useTextBasedQueryLanguage } from './use_text_based_query_language'; import { FetchStatus } from '../../types'; -import { RecordRawType } from '../services/discover_data_state_container'; +import { RecordRawType } from '../state_management/discover_data_state_container'; import type { DataTableRecord } from '@kbn/discover-utils/types'; import { AggregateQuery, Query } from '@kbn/es-query'; import { dataViewMock } from '@kbn/discover-utils/src/__mocks__'; import { DataViewListItem } from '@kbn/data-views-plugin/common'; import { savedSearchMock } from '../../../__mocks__/saved_search'; import { getDiscoverStateMock } from '../../../__mocks__/discover_state.mock'; -import { DiscoverMainProvider } from '../services/discover_state_provider'; -import { DiscoverAppState } from '../services/discover_app_state_container'; -import { DiscoverStateContainer } from '../services/discover_state'; +import { DiscoverMainProvider } from '../state_management/discover_state_provider'; +import { DiscoverAppState } from '../state_management/discover_app_state_container'; +import { DiscoverStateContainer } from '../state_management/discover_state'; import { VIEW_MODE } from '@kbn/saved-search-plugin/public'; import { dataViewAdHoc } from '../../../__mocks__/data_view_complex'; diff --git a/src/plugins/discover/public/application/main/hooks/use_text_based_query_language.ts b/src/plugins/discover/public/application/main/hooks/use_text_based_query_language.ts index 6d6558f8a3d3..0a5b7c021046 100644 --- a/src/plugins/discover/public/application/main/hooks/use_text_based_query_language.ts +++ b/src/plugins/discover/public/application/main/hooks/use_text_based_query_language.ts @@ -10,8 +10,8 @@ import { isOfAggregateQueryType, getAggregateQueryMode } from '@kbn/es-query'; import { useCallback, useEffect, useRef } from 'react'; import type { DataViewsContract } from '@kbn/data-views-plugin/public'; import { switchMap } from 'rxjs'; -import { useSavedSearchInitial } from '../services/discover_state_provider'; -import type { DiscoverStateContainer } from '../services/discover_state'; +import { useSavedSearchInitial } from '../state_management/discover_state_provider'; +import type { DiscoverStateContainer } from '../state_management/discover_state'; import { getValidViewMode } from '../utils/get_valid_view_mode'; import { FetchStatus } from '../../types'; diff --git a/src/plugins/discover/public/application/main/hooks/use_url_tracking.ts b/src/plugins/discover/public/application/main/hooks/use_url_tracking.ts index 88f69dceb44a..f647cd87f9fc 100644 --- a/src/plugins/discover/public/application/main/hooks/use_url_tracking.ts +++ b/src/plugins/discover/public/application/main/hooks/use_url_tracking.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ import { useEffect } from 'react'; -import { DiscoverSavedSearchContainer } from '../services/discover_saved_search_container'; +import { DiscoverSavedSearchContainer } from '../state_management/discover_saved_search_container'; import { useDiscoverServices } from '../../../hooks/use_discover_services'; /** diff --git a/src/plugins/discover/public/application/main/services/discover_app_state_container.test.ts b/src/plugins/discover/public/application/main/state_management/discover_app_state_container.test.ts similarity index 100% rename from src/plugins/discover/public/application/main/services/discover_app_state_container.test.ts rename to src/plugins/discover/public/application/main/state_management/discover_app_state_container.test.ts diff --git a/src/plugins/discover/public/application/main/services/discover_app_state_container.ts b/src/plugins/discover/public/application/main/state_management/discover_app_state_container.ts similarity index 98% rename from src/plugins/discover/public/application/main/services/discover_app_state_container.ts rename to src/plugins/discover/public/application/main/state_management/discover_app_state_container.ts index 9f073e14b2e6..ec5d2dc4e843 100644 --- a/src/plugins/discover/public/application/main/services/discover_app_state_container.ts +++ b/src/plugins/discover/public/application/main/state_management/discover_app_state_container.ts @@ -27,8 +27,8 @@ import { connectToQueryState, syncGlobalQueryStateWithUrl } from '@kbn/data-plug import type { DiscoverGridSettings } from '@kbn/saved-search-plugin/common'; import type { DiscoverServices } from '../../../build_services'; import { addLog } from '../../../utils/add_log'; -import { cleanupUrlState } from '../utils/cleanup_url_state'; -import { getStateDefaults } from '../utils/get_state_defaults'; +import { cleanupUrlState } from './utils/cleanup_url_state'; +import { getStateDefaults } from './utils/get_state_defaults'; import { handleSourceColumnState } from '../../../utils/state_helpers'; export const APP_STATE_URL_KEY = '_a'; diff --git a/src/plugins/discover/public/application/main/services/discover_data_state_container.test.ts b/src/plugins/discover/public/application/main/state_management/discover_data_state_container.test.ts similarity index 98% rename from src/plugins/discover/public/application/main/services/discover_data_state_container.test.ts rename to src/plugins/discover/public/application/main/state_management/discover_data_state_container.test.ts index 247a3a4d355a..ac022d587535 100644 --- a/src/plugins/discover/public/application/main/services/discover_data_state_container.test.ts +++ b/src/plugins/discover/public/application/main/state_management/discover_data_state_container.test.ts @@ -14,9 +14,9 @@ import { savedSearchMockWithESQL } from '../../../__mocks__/saved_search'; import { FetchStatus } from '../../types'; import { DataDocuments$, RecordRawType } from './discover_data_state_container'; import { getDiscoverStateMock } from '../../../__mocks__/discover_state.mock'; -import { fetchDocuments } from '../utils/fetch_documents'; +import { fetchDocuments } from '../data_fetching/fetch_documents'; -jest.mock('../utils/fetch_documents', () => ({ +jest.mock('../data_fetching/fetch_documents', () => ({ fetchDocuments: jest.fn().mockResolvedValue({ records: [] }), })); diff --git a/src/plugins/discover/public/application/main/services/discover_data_state_container.ts b/src/plugins/discover/public/application/main/state_management/discover_data_state_container.ts similarity index 97% rename from src/plugins/discover/public/application/main/services/discover_data_state_container.ts rename to src/plugins/discover/public/application/main/state_management/discover_data_state_container.ts index b2f8ae9f0a81..203bd87ec84f 100644 --- a/src/plugins/discover/public/application/main/services/discover_data_state_container.ts +++ b/src/plugins/discover/public/application/main/state_management/discover_data_state_container.ts @@ -17,17 +17,17 @@ import { reportPerformanceMetricEvent } from '@kbn/ebt-tools'; import type { SearchResponseWarning } from '@kbn/search-response-warnings'; import type { DataTableRecord } from '@kbn/discover-utils/types'; import { SEARCH_FIELDS_FROM_SOURCE, SEARCH_ON_PAGE_LOAD_SETTING } from '@kbn/discover-utils'; -import { getDataViewByTextBasedQueryLang } from '../utils/get_data_view_by_text_based_query_lang'; +import { getDataViewByTextBasedQueryLang } from './utils/get_data_view_by_text_based_query_lang'; import { isTextBasedQuery } from '../utils/is_text_based_query'; import { getRawRecordType } from '../utils/get_raw_record_type'; import { DiscoverAppState } from './discover_app_state_container'; import { DiscoverServices } from '../../../build_services'; import { DiscoverSearchSessionManager } from './discover_search_session'; import { FetchStatus } from '../../types'; -import { validateTimeRange } from '../utils/validate_time_range'; -import { fetchAll, fetchMoreDocuments } from '../utils/fetch_all'; +import { validateTimeRange } from './utils/validate_time_range'; +import { fetchAll, fetchMoreDocuments } from '../data_fetching/fetch_all'; import { sendResetMsg } from '../hooks/use_saved_search_messages'; -import { getFetch$ } from '../utils/get_fetch_observable'; +import { getFetch$ } from '../data_fetching/get_fetch_observable'; import { InternalState } from './discover_internal_state_container'; export interface SavedSearchData { diff --git a/src/plugins/discover/public/application/main/services/discover_global_state_container.ts b/src/plugins/discover/public/application/main/state_management/discover_global_state_container.ts similarity index 100% rename from src/plugins/discover/public/application/main/services/discover_global_state_container.ts rename to src/plugins/discover/public/application/main/state_management/discover_global_state_container.ts diff --git a/src/plugins/discover/public/application/main/services/discover_internal_state_container.ts b/src/plugins/discover/public/application/main/state_management/discover_internal_state_container.ts similarity index 100% rename from src/plugins/discover/public/application/main/services/discover_internal_state_container.ts rename to src/plugins/discover/public/application/main/state_management/discover_internal_state_container.ts diff --git a/src/plugins/discover/public/application/main/services/discover_saved_search_container.test.ts b/src/plugins/discover/public/application/main/state_management/discover_saved_search_container.test.ts similarity index 100% rename from src/plugins/discover/public/application/main/services/discover_saved_search_container.test.ts rename to src/plugins/discover/public/application/main/state_management/discover_saved_search_container.test.ts diff --git a/src/plugins/discover/public/application/main/services/discover_saved_search_container.ts b/src/plugins/discover/public/application/main/state_management/discover_saved_search_container.ts similarity index 99% rename from src/plugins/discover/public/application/main/services/discover_saved_search_container.ts rename to src/plugins/discover/public/application/main/state_management/discover_saved_search_container.ts index f5cc24fc762e..69ef4b03c742 100644 --- a/src/plugins/discover/public/application/main/services/discover_saved_search_container.ts +++ b/src/plugins/discover/public/application/main/state_management/discover_saved_search_container.ts @@ -19,12 +19,12 @@ import { import { SavedObjectSaveOpts } from '@kbn/saved-objects-plugin/public'; import { isEqual, isFunction } from 'lodash'; import { restoreStateFromSavedSearch } from '../../../services/saved_searches/restore_from_saved_search'; -import { updateSavedSearch } from '../utils/update_saved_search'; +import { updateSavedSearch } from './utils/update_saved_search'; import { addLog } from '../../../utils/add_log'; import { handleSourceColumnState } from '../../../utils/state_helpers'; import { DiscoverAppState, isEqualFilters } from './discover_app_state_container'; import { DiscoverServices } from '../../../build_services'; -import { getStateDefaults } from '../utils/get_state_defaults'; +import { getStateDefaults } from './utils/get_state_defaults'; import type { DiscoverGlobalStateContainer } from './discover_global_state_container'; const FILTERS_COMPARE_OPTIONS: FilterCompareOptions = { diff --git a/src/plugins/discover/public/application/main/services/discover_search_session.test.ts b/src/plugins/discover/public/application/main/state_management/discover_search_session.test.ts similarity index 100% rename from src/plugins/discover/public/application/main/services/discover_search_session.test.ts rename to src/plugins/discover/public/application/main/state_management/discover_search_session.test.ts diff --git a/src/plugins/discover/public/application/main/services/discover_search_session.ts b/src/plugins/discover/public/application/main/state_management/discover_search_session.ts similarity index 100% rename from src/plugins/discover/public/application/main/services/discover_search_session.ts rename to src/plugins/discover/public/application/main/state_management/discover_search_session.ts diff --git a/src/plugins/discover/public/application/main/services/discover_state.test.ts b/src/plugins/discover/public/application/main/state_management/discover_state.test.ts similarity index 100% rename from src/plugins/discover/public/application/main/services/discover_state.test.ts rename to src/plugins/discover/public/application/main/state_management/discover_state.test.ts diff --git a/src/plugins/discover/public/application/main/services/discover_state.ts b/src/plugins/discover/public/application/main/state_management/discover_state.ts similarity index 98% rename from src/plugins/discover/public/application/main/services/discover_state.ts rename to src/plugins/discover/public/application/main/state_management/discover_state.ts index 94a0a80c54fd..4816ac585c14 100644 --- a/src/plugins/discover/public/application/main/services/discover_state.ts +++ b/src/plugins/discover/public/application/main/state_management/discover_state.ts @@ -24,11 +24,11 @@ import type { SavedSearch } from '@kbn/saved-search-plugin/public'; import { v4 as uuidv4 } from 'uuid'; import { merge } from 'rxjs'; import { AggregateQuery, Query, TimeRange } from '@kbn/es-query'; -import { loadSavedSearch as loadSavedSearchFn } from './load_saved_search'; +import { loadSavedSearch as loadSavedSearchFn } from './utils/load_saved_search'; import { restoreStateFromSavedSearch } from '../../../services/saved_searches/restore_from_saved_search'; import { FetchStatus } from '../../types'; -import { changeDataView } from '../hooks/utils/change_data_view'; -import { buildStateSubscribe } from '../hooks/utils/build_state_subscribe'; +import { changeDataView } from './utils/change_data_view'; +import { buildStateSubscribe } from './utils/build_state_subscribe'; import { addLog } from '../../../utils/add_log'; import { DiscoverDataStateContainer, getDataStateContainer } from './discover_data_state_container'; import { DiscoverSearchSessionManager } from './discover_search_session'; @@ -48,7 +48,7 @@ import { getSavedSearchContainer, DiscoverSavedSearchContainer, } from './discover_saved_search_container'; -import { updateFiltersReferences } from '../utils/update_filter_references'; +import { updateFiltersReferences } from './utils/update_filter_references'; import { getDiscoverGlobalStateContainer, DiscoverGlobalStateContainer, diff --git a/src/plugins/discover/public/application/main/services/discover_state_provider.tsx b/src/plugins/discover/public/application/main/state_management/discover_state_provider.tsx similarity index 100% rename from src/plugins/discover/public/application/main/services/discover_state_provider.tsx rename to src/plugins/discover/public/application/main/state_management/discover_state_provider.tsx diff --git a/src/plugins/discover/public/application/main/hooks/utils/build_state_subscribe.test.ts b/src/plugins/discover/public/application/main/state_management/utils/build_state_subscribe.test.ts similarity index 100% rename from src/plugins/discover/public/application/main/hooks/utils/build_state_subscribe.test.ts rename to src/plugins/discover/public/application/main/state_management/utils/build_state_subscribe.test.ts diff --git a/src/plugins/discover/public/application/main/hooks/utils/build_state_subscribe.ts b/src/plugins/discover/public/application/main/state_management/utils/build_state_subscribe.ts similarity index 91% rename from src/plugins/discover/public/application/main/hooks/utils/build_state_subscribe.ts rename to src/plugins/discover/public/application/main/state_management/utils/build_state_subscribe.ts index 305f67d61a0a..6cc9b8800893 100644 --- a/src/plugins/discover/public/application/main/hooks/utils/build_state_subscribe.ts +++ b/src/plugins/discover/public/application/main/state_management/utils/build_state_subscribe.ts @@ -6,20 +6,20 @@ * Side Public License, v 1. */ import { isEqual } from 'lodash'; -import type { DiscoverInternalStateContainer } from '../../services/discover_internal_state_container'; +import type { DiscoverInternalStateContainer } from '../discover_internal_state_container'; import type { DiscoverServices } from '../../../../build_services'; -import type { DiscoverSavedSearchContainer } from '../../services/discover_saved_search_container'; -import type { DiscoverDataStateContainer } from '../../services/discover_data_state_container'; -import type { DiscoverStateContainer } from '../../services/discover_state'; +import type { DiscoverSavedSearchContainer } from '../discover_saved_search_container'; +import type { DiscoverDataStateContainer } from '../discover_data_state_container'; +import type { DiscoverStateContainer } from '../discover_state'; import { DiscoverAppState, DiscoverAppStateContainer, isEqualState, -} from '../../services/discover_app_state_container'; +} from '../discover_app_state_container'; import { addLog } from '../../../../utils/add_log'; import { isTextBasedQuery } from '../../utils/is_text_based_query'; import { FetchStatus } from '../../../types'; -import { loadAndResolveDataView } from '../../utils/resolve_data_view'; +import { loadAndResolveDataView } from './resolve_data_view'; /** * Builds a subscribe function for the AppStateContainer, that is executed when the AppState changes in URL diff --git a/src/plugins/discover/public/application/main/hooks/utils/change_data_view.test.ts b/src/plugins/discover/public/application/main/state_management/utils/change_data_view.test.ts similarity index 97% rename from src/plugins/discover/public/application/main/hooks/utils/change_data_view.test.ts rename to src/plugins/discover/public/application/main/state_management/utils/change_data_view.test.ts index 118e6e6c0f2d..62cca6a4199f 100644 --- a/src/plugins/discover/public/application/main/hooks/utils/change_data_view.test.ts +++ b/src/plugins/discover/public/application/main/state_management/utils/change_data_view.test.ts @@ -16,7 +16,7 @@ import { discoverServiceMock } from '../../../../__mocks__/services'; import type { DataView } from '@kbn/data-views-plugin/common'; import { getDiscoverStateMock } from '../../../../__mocks__/discover_state.mock'; import { PureTransitionsToTransitions } from '@kbn/kibana-utils-plugin/common/state_containers'; -import { InternalStateTransitions } from '../../services/discover_internal_state_container'; +import { InternalStateTransitions } from '../discover_internal_state_container'; const setupTestParams = (dataView: DataView | undefined) => { const savedSearch = savedSearchMock; diff --git a/src/plugins/discover/public/application/main/hooks/utils/change_data_view.ts b/src/plugins/discover/public/application/main/state_management/utils/change_data_view.ts similarity index 88% rename from src/plugins/discover/public/application/main/hooks/utils/change_data_view.ts rename to src/plugins/discover/public/application/main/state_management/utils/change_data_view.ts index 41a911295cac..65e029260130 100644 --- a/src/plugins/discover/public/application/main/hooks/utils/change_data_view.ts +++ b/src/plugins/discover/public/application/main/state_management/utils/change_data_view.ts @@ -13,11 +13,11 @@ import { SORT_DEFAULT_ORDER_SETTING, DEFAULT_COLUMNS_SETTING, } from '@kbn/discover-utils'; -import { DiscoverInternalStateContainer } from '../../services/discover_internal_state_container'; -import { DiscoverAppStateContainer } from '../../services/discover_app_state_container'; +import { DiscoverInternalStateContainer } from '../discover_internal_state_container'; +import { DiscoverAppStateContainer } from '../discover_app_state_container'; import { addLog } from '../../../../utils/add_log'; import { DiscoverServices } from '../../../../build_services'; -import { getDataViewAppState } from '../../utils/get_switch_data_view_app_state'; +import { getDataViewAppState } from './get_switch_data_view_app_state'; /** * Function executed when switching data view in the UI diff --git a/src/plugins/discover/public/application/main/utils/cleanup_url_state.test.ts b/src/plugins/discover/public/application/main/state_management/utils/cleanup_url_state.test.ts similarity index 96% rename from src/plugins/discover/public/application/main/utils/cleanup_url_state.test.ts rename to src/plugins/discover/public/application/main/state_management/utils/cleanup_url_state.test.ts index 2d49639e0288..46757b8fcffd 100644 --- a/src/plugins/discover/public/application/main/utils/cleanup_url_state.test.ts +++ b/src/plugins/discover/public/application/main/state_management/utils/cleanup_url_state.test.ts @@ -6,9 +6,9 @@ * Side Public License, v 1. */ -import { AppStateUrl } from '../services/discover_app_state_container'; +import { AppStateUrl } from '../discover_app_state_container'; import { cleanupUrlState } from './cleanup_url_state'; -import { createDiscoverServicesMock } from '../../../__mocks__/services'; +import { createDiscoverServicesMock } from '../../../../__mocks__/services'; const services = createDiscoverServicesMock(); diff --git a/src/plugins/discover/public/application/main/utils/cleanup_url_state.ts b/src/plugins/discover/public/application/main/state_management/utils/cleanup_url_state.ts similarity index 90% rename from src/plugins/discover/public/application/main/utils/cleanup_url_state.ts rename to src/plugins/discover/public/application/main/state_management/utils/cleanup_url_state.ts index cdfb95d87f13..07b939c162f7 100644 --- a/src/plugins/discover/public/application/main/utils/cleanup_url_state.ts +++ b/src/plugins/discover/public/application/main/state_management/utils/cleanup_url_state.ts @@ -7,9 +7,9 @@ */ import { isOfAggregateQueryType } from '@kbn/es-query'; import type { IUiSettingsClient } from '@kbn/core-ui-settings-browser'; -import { DiscoverAppState, AppStateUrl } from '../services/discover_app_state_container'; -import { migrateLegacyQuery } from '../../../utils/migrate_legacy_query'; -import { getMaxAllowedSampleSize } from '../../../utils/get_allowed_sample_size'; +import { DiscoverAppState, AppStateUrl } from '../discover_app_state_container'; +import { migrateLegacyQuery } from '../../../../utils/migrate_legacy_query'; +import { getMaxAllowedSampleSize } from '../../../../utils/get_allowed_sample_size'; /** * Takes care of the given url state, migrates legacy props and cleans up empty props diff --git a/src/plugins/discover/public/application/main/utils/get_data_view_by_text_based_query_lang.test.ts b/src/plugins/discover/public/application/main/state_management/utils/get_data_view_by_text_based_query_lang.test.ts similarity index 94% rename from src/plugins/discover/public/application/main/utils/get_data_view_by_text_based_query_lang.test.ts rename to src/plugins/discover/public/application/main/state_management/utils/get_data_view_by_text_based_query_lang.test.ts index c30dc888c85c..b8053c47fd17 100644 --- a/src/plugins/discover/public/application/main/utils/get_data_view_by_text_based_query_lang.test.ts +++ b/src/plugins/discover/public/application/main/state_management/utils/get_data_view_by_text_based_query_lang.test.ts @@ -7,9 +7,9 @@ */ import { getDataViewByTextBasedQueryLang } from './get_data_view_by_text_based_query_lang'; -import { dataViewAdHoc } from '../../../__mocks__/data_view_complex'; +import { dataViewAdHoc } from '../../../../__mocks__/data_view_complex'; import { dataViewMock } from '@kbn/discover-utils/src/__mocks__'; -import { discoverServiceMock } from '../../../__mocks__/services'; +import { discoverServiceMock } from '../../../../__mocks__/services'; describe('getDataViewByTextBasedQueryLang', () => { discoverServiceMock.dataViews.create = jest.fn().mockReturnValue({ diff --git a/src/plugins/discover/public/application/main/utils/get_data_view_by_text_based_query_lang.ts b/src/plugins/discover/public/application/main/state_management/utils/get_data_view_by_text_based_query_lang.ts similarity index 95% rename from src/plugins/discover/public/application/main/utils/get_data_view_by_text_based_query_lang.ts rename to src/plugins/discover/public/application/main/state_management/utils/get_data_view_by_text_based_query_lang.ts index 17e9b29e084d..db964c073a25 100644 --- a/src/plugins/discover/public/application/main/utils/get_data_view_by_text_based_query_lang.ts +++ b/src/plugins/discover/public/application/main/state_management/utils/get_data_view_by_text_based_query_lang.ts @@ -8,7 +8,7 @@ import type { AggregateQuery } from '@kbn/es-query'; import { getESQLAdHocDataview, getIndexPatternFromESQLQuery } from '@kbn/esql-utils'; import { DataView } from '@kbn/data-views-plugin/common'; -import { DiscoverServices } from '../../../build_services'; +import { DiscoverServices } from '../../../../build_services'; export async function getDataViewByTextBasedQueryLang( query: AggregateQuery, diff --git a/src/plugins/discover/public/application/main/utils/get_state_defaults.test.ts b/src/plugins/discover/public/application/main/state_management/utils/get_state_defaults.test.ts similarity index 95% rename from src/plugins/discover/public/application/main/utils/get_state_defaults.test.ts rename to src/plugins/discover/public/application/main/state_management/utils/get_state_defaults.test.ts index 7f5783f98e13..0a862b712186 100644 --- a/src/plugins/discover/public/application/main/utils/get_state_defaults.test.ts +++ b/src/plugins/discover/public/application/main/state_management/utils/get_state_defaults.test.ts @@ -9,10 +9,10 @@ import { getStateDefaults } from './get_state_defaults'; import { createSearchSourceMock } from '@kbn/data-plugin/public/mocks'; import { VIEW_MODE } from '@kbn/saved-search-plugin/common'; -import { dataViewWithTimefieldMock } from '../../../__mocks__/data_view_with_timefield'; -import { savedSearchMock, savedSearchMockWithESQL } from '../../../__mocks__/saved_search'; +import { dataViewWithTimefieldMock } from '../../../../__mocks__/data_view_with_timefield'; +import { savedSearchMock, savedSearchMockWithESQL } from '../../../../__mocks__/saved_search'; import { dataViewMock } from '@kbn/discover-utils/src/__mocks__'; -import { discoverServiceMock } from '../../../__mocks__/services'; +import { discoverServiceMock } from '../../../../__mocks__/services'; describe('getStateDefaults', () => { test('data view with timefield', () => { diff --git a/src/plugins/discover/public/application/main/utils/get_state_defaults.ts b/src/plugins/discover/public/application/main/state_management/utils/get_state_defaults.ts similarity index 91% rename from src/plugins/discover/public/application/main/utils/get_state_defaults.ts rename to src/plugins/discover/public/application/main/state_management/utils/get_state_defaults.ts index fc980fff6c5e..4faf8ffad299 100644 --- a/src/plugins/discover/public/application/main/utils/get_state_defaults.ts +++ b/src/plugins/discover/public/application/main/state_management/utils/get_state_defaults.ts @@ -16,11 +16,11 @@ import { SEARCH_FIELDS_FROM_SOURCE, SORT_DEFAULT_ORDER_SETTING, } from '@kbn/discover-utils'; -import { DiscoverAppState } from '../services/discover_app_state_container'; -import { DiscoverServices } from '../../../build_services'; -import { getDefaultSort, getSortArray } from '../../../utils/sorting'; -import { isTextBasedQuery } from './is_text_based_query'; -import { getValidViewMode } from './get_valid_view_mode'; +import { DiscoverAppState } from '../discover_app_state_container'; +import { DiscoverServices } from '../../../../build_services'; +import { getDefaultSort, getSortArray } from '../../../../utils/sorting'; +import { isTextBasedQuery } from '../../utils/is_text_based_query'; +import { getValidViewMode } from '../../utils/get_valid_view_mode'; function getDefaultColumns(savedSearch: SavedSearch, uiSettings: IUiSettingsClient) { if (savedSearch.columns && savedSearch.columns.length > 0) { diff --git a/src/plugins/discover/public/application/main/utils/get_switch_data_view_app_state.test.ts b/src/plugins/discover/public/application/main/state_management/utils/get_switch_data_view_app_state.test.ts similarity index 100% rename from src/plugins/discover/public/application/main/utils/get_switch_data_view_app_state.test.ts rename to src/plugins/discover/public/application/main/state_management/utils/get_switch_data_view_app_state.test.ts diff --git a/src/plugins/discover/public/application/main/utils/get_switch_data_view_app_state.ts b/src/plugins/discover/public/application/main/state_management/utils/get_switch_data_view_app_state.ts similarity index 97% rename from src/plugins/discover/public/application/main/utils/get_switch_data_view_app_state.ts rename to src/plugins/discover/public/application/main/state_management/utils/get_switch_data_view_app_state.ts index 63fa1b350a80..f94420403f26 100644 --- a/src/plugins/discover/public/application/main/utils/get_switch_data_view_app_state.ts +++ b/src/plugins/discover/public/application/main/state_management/utils/get_switch_data_view_app_state.ts @@ -9,7 +9,7 @@ import { uniq } from 'lodash'; import { isOfAggregateQueryType, Query, AggregateQuery } from '@kbn/es-query'; import type { DataView } from '@kbn/data-views-plugin/public'; import type { SortOrder } from '@kbn/saved-search-plugin/public'; -import { getSortArray } from '../../../utils/sorting'; +import { getSortArray } from '../../../../utils/sorting'; /** * Helper function to remove or adapt the currently selected columns/sort to be valid with the next diff --git a/src/plugins/discover/public/application/main/services/load_saved_search.ts b/src/plugins/discover/public/application/main/state_management/utils/load_saved_search.ts similarity index 88% rename from src/plugins/discover/public/application/main/services/load_saved_search.ts rename to src/plugins/discover/public/application/main/state_management/utils/load_saved_search.ts index ac9e6f60526d..ba7d2a9342c2 100644 --- a/src/plugins/discover/public/application/main/services/load_saved_search.ts +++ b/src/plugins/discover/public/application/main/state_management/utils/load_saved_search.ts @@ -7,23 +7,23 @@ */ import type { SavedSearch } from '@kbn/saved-search-plugin/public'; import { cloneDeep, isEqual } from 'lodash'; -import { getDataViewByTextBasedQueryLang } from '../utils/get_data_view_by_text_based_query_lang'; -import { isTextBasedQuery } from '../utils/is_text_based_query'; -import { loadAndResolveDataView } from '../utils/resolve_data_view'; -import { DiscoverInternalStateContainer } from './discover_internal_state_container'; -import { DiscoverDataStateContainer } from './discover_data_state_container'; -import { cleanupUrlState } from '../utils/cleanup_url_state'; -import { getValidFilters } from '../../../utils/get_valid_filters'; -import { DiscoverStateContainer, LoadParams } from './discover_state'; -import { addLog } from '../../../utils/add_log'; -import { DiscoverSavedSearchContainer } from './discover_saved_search_container'; +import { getDataViewByTextBasedQueryLang } from './get_data_view_by_text_based_query_lang'; +import { isTextBasedQuery } from '../../utils/is_text_based_query'; +import { loadAndResolveDataView } from './resolve_data_view'; +import { DiscoverInternalStateContainer } from '../discover_internal_state_container'; +import { DiscoverDataStateContainer } from '../discover_data_state_container'; +import { cleanupUrlState } from './cleanup_url_state'; +import { getValidFilters } from '../../../../utils/get_valid_filters'; +import { DiscoverStateContainer, LoadParams } from '../discover_state'; +import { addLog } from '../../../../utils/add_log'; +import { DiscoverSavedSearchContainer } from '../discover_saved_search_container'; import { DiscoverAppState, DiscoverAppStateContainer, getInitialState, -} from './discover_app_state_container'; -import { DiscoverGlobalStateContainer } from './discover_global_state_container'; -import { DiscoverServices } from '../../../build_services'; +} from '../discover_app_state_container'; +import { DiscoverGlobalStateContainer } from '../discover_global_state_container'; +import { DiscoverServices } from '../../../../build_services'; interface LoadSavedSearchDeps { appStateContainer: DiscoverAppStateContainer; diff --git a/src/plugins/discover/public/application/main/utils/resolve_data_view.test.ts b/src/plugins/discover/public/application/main/state_management/utils/resolve_data_view.test.ts similarity index 93% rename from src/plugins/discover/public/application/main/utils/resolve_data_view.test.ts rename to src/plugins/discover/public/application/main/state_management/utils/resolve_data_view.test.ts index e321dc51ba3a..28657af21383 100644 --- a/src/plugins/discover/public/application/main/utils/resolve_data_view.test.ts +++ b/src/plugins/discover/public/application/main/state_management/utils/resolve_data_view.test.ts @@ -8,7 +8,7 @@ import { loadDataView } from './resolve_data_view'; import { dataViewMock } from '@kbn/discover-utils/src/__mocks__'; -import { discoverServiceMock as services } from '../../../__mocks__/services'; +import { discoverServiceMock as services } from '../../../../__mocks__/services'; describe('Resolve data view tests', () => { test('returns valid data for an existing data view', async () => { diff --git a/src/plugins/discover/public/application/main/utils/resolve_data_view.ts b/src/plugins/discover/public/application/main/state_management/utils/resolve_data_view.ts similarity index 97% rename from src/plugins/discover/public/application/main/utils/resolve_data_view.ts rename to src/plugins/discover/public/application/main/state_management/utils/resolve_data_view.ts index 761fb9764c82..031193c93cba 100644 --- a/src/plugins/discover/public/application/main/utils/resolve_data_view.ts +++ b/src/plugins/discover/public/application/main/state_management/utils/resolve_data_view.ts @@ -10,8 +10,8 @@ import { i18n } from '@kbn/i18n'; import type { DataView, DataViewListItem, DataViewSpec } from '@kbn/data-views-plugin/public'; import type { ToastsStart } from '@kbn/core/public'; import { SavedSearch } from '@kbn/saved-search-plugin/public'; -import { DiscoverInternalStateContainer } from '../services/discover_internal_state_container'; -import { DiscoverServices } from '../../../build_services'; +import { DiscoverInternalStateContainer } from '../discover_internal_state_container'; +import { DiscoverServices } from '../../../../build_services'; interface DataViewData { /** * List of existing data views diff --git a/src/plugins/discover/public/application/main/utils/update_filter_references.ts b/src/plugins/discover/public/application/main/state_management/utils/update_filter_references.ts similarity index 94% rename from src/plugins/discover/public/application/main/utils/update_filter_references.ts rename to src/plugins/discover/public/application/main/state_management/utils/update_filter_references.ts index 2017e2d41ed9..19f60115022c 100644 --- a/src/plugins/discover/public/application/main/utils/update_filter_references.ts +++ b/src/plugins/discover/public/application/main/state_management/utils/update_filter_references.ts @@ -12,7 +12,7 @@ import { } from '@kbn/unified-search-plugin/public'; import { ActionExecutionContext } from '@kbn/ui-actions-plugin/public'; import type { DataView } from '@kbn/data-views-plugin/public'; -import { DiscoverServices } from '../../../build_services'; +import { DiscoverServices } from '../../../../build_services'; export const updateFiltersReferences = ({ prevDataView, diff --git a/src/plugins/discover/public/application/main/utils/update_saved_search.test.ts b/src/plugins/discover/public/application/main/state_management/utils/update_saved_search.test.ts similarity index 96% rename from src/plugins/discover/public/application/main/utils/update_saved_search.test.ts rename to src/plugins/discover/public/application/main/state_management/utils/update_saved_search.test.ts index c04a687e6afa..3af2b38d679c 100644 --- a/src/plugins/discover/public/application/main/utils/update_saved_search.test.ts +++ b/src/plugins/discover/public/application/main/state_management/utils/update_saved_search.test.ts @@ -6,8 +6,8 @@ * Side Public License, v 1. */ -import { savedSearchMock } from '../../../__mocks__/saved_search'; -import { discoverServiceMock } from '../../../__mocks__/services'; +import { savedSearchMock } from '../../../../__mocks__/saved_search'; +import { discoverServiceMock } from '../../../../__mocks__/services'; import { Filter, FilterStateStore, Query } from '@kbn/es-query'; import { updateSavedSearch } from './update_saved_search'; import { SavedSearch } from '@kbn/saved-search-plugin/public'; diff --git a/src/plugins/discover/public/application/main/utils/update_saved_search.ts b/src/plugins/discover/public/application/main/state_management/utils/update_saved_search.ts similarity index 92% rename from src/plugins/discover/public/application/main/utils/update_saved_search.ts rename to src/plugins/discover/public/application/main/state_management/utils/update_saved_search.ts index 05c17cd3ebcd..ad47bb021ea7 100644 --- a/src/plugins/discover/public/application/main/utils/update_saved_search.ts +++ b/src/plugins/discover/public/application/main/state_management/utils/update_saved_search.ts @@ -8,10 +8,10 @@ import type { SavedSearch, SortOrder } from '@kbn/saved-search-plugin/public'; import type { DataView } from '@kbn/data-views-plugin/common'; import { cloneDeep } from 'lodash'; -import { isTextBasedQuery } from './is_text_based_query'; -import type { DiscoverAppState } from '../services/discover_app_state_container'; -import type { DiscoverServices } from '../../../build_services'; -import type { DiscoverGlobalStateContainer } from '../services/discover_global_state_container'; +import { isTextBasedQuery } from '../../utils/is_text_based_query'; +import type { DiscoverAppState } from '../discover_app_state_container'; +import type { DiscoverServices } from '../../../../build_services'; +import type { DiscoverGlobalStateContainer } from '../discover_global_state_container'; /** * Updates the saved search with a given data view & Appstate diff --git a/src/plugins/discover/public/application/main/utils/validate_time_range.test.ts b/src/plugins/discover/public/application/main/state_management/utils/validate_time_range.test.ts similarity index 100% rename from src/plugins/discover/public/application/main/utils/validate_time_range.test.ts rename to src/plugins/discover/public/application/main/state_management/utils/validate_time_range.test.ts diff --git a/src/plugins/discover/public/application/main/utils/validate_time_range.ts b/src/plugins/discover/public/application/main/state_management/utils/validate_time_range.ts similarity index 94% rename from src/plugins/discover/public/application/main/utils/validate_time_range.ts rename to src/plugins/discover/public/application/main/state_management/utils/validate_time_range.ts index 65748bbd75ce..e38ca00b82ff 100644 --- a/src/plugins/discover/public/application/main/utils/validate_time_range.ts +++ b/src/plugins/discover/public/application/main/state_management/utils/validate_time_range.ts @@ -8,7 +8,7 @@ import { i18n } from '@kbn/i18n'; import { ToastsStart } from '@kbn/core/public'; -import { isTimeRangeValid } from '../../../utils/validate_time'; +import { isTimeRangeValid } from '../../../../utils/validate_time'; /** * Validates a given time filter range, provided by URL or UI diff --git a/src/plugins/discover/public/application/main/utils/get_raw_record_type.test.ts b/src/plugins/discover/public/application/main/utils/get_raw_record_type.test.ts index 781cfef1387a..9626c2d1caad 100644 --- a/src/plugins/discover/public/application/main/utils/get_raw_record_type.test.ts +++ b/src/plugins/discover/public/application/main/utils/get_raw_record_type.test.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { RecordRawType } from '../services/discover_data_state_container'; +import { RecordRawType } from '../state_management/discover_data_state_container'; import { getRawRecordType } from './get_raw_record_type'; describe('getRawRecordType', () => { diff --git a/src/plugins/discover/public/application/main/utils/get_raw_record_type.ts b/src/plugins/discover/public/application/main/utils/get_raw_record_type.ts index bbeff45befe1..3a96973adfba 100644 --- a/src/plugins/discover/public/application/main/utils/get_raw_record_type.ts +++ b/src/plugins/discover/public/application/main/utils/get_raw_record_type.ts @@ -7,7 +7,7 @@ */ import { AggregateQuery, Query, isOfAggregateQueryType } from '@kbn/es-query'; -import { RecordRawType } from '../services/discover_data_state_container'; +import { RecordRawType } from '../state_management/discover_data_state_container'; export function getRawRecordType(query?: Query | AggregateQuery) { if (query && isOfAggregateQueryType(query)) { diff --git a/src/plugins/discover/public/application/main/utils/is_text_based_query.ts b/src/plugins/discover/public/application/main/utils/is_text_based_query.ts index bf86af930423..d92433307aaa 100644 --- a/src/plugins/discover/public/application/main/utils/is_text_based_query.ts +++ b/src/plugins/discover/public/application/main/utils/is_text_based_query.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ import type { AggregateQuery, Query } from '@kbn/es-query'; -import { RecordRawType } from '../services/discover_data_state_container'; +import { RecordRawType } from '../state_management/discover_data_state_container'; import { getRawRecordType } from './get_raw_record_type'; /** diff --git a/src/plugins/discover/public/components/doc_table/doc_table_infinite.tsx b/src/plugins/discover/public/components/doc_table/doc_table_infinite.tsx index 92265f731bf1..73044e99595c 100644 --- a/src/plugins/discover/public/components/doc_table/doc_table_infinite.tsx +++ b/src/plugins/discover/public/components/doc_table/doc_table_infinite.tsx @@ -16,7 +16,7 @@ import { SkipBottomButton } from '../../application/main/components/skip_bottom_ import { shouldLoadNextDocPatch } from './utils/should_load_next_doc_patch'; import { useDiscoverServices } from '../../hooks/use_discover_services'; import { getAllowedSampleSize } from '../../utils/get_allowed_sample_size'; -import { useAppStateSelector } from '../../application/main/services/discover_app_state_container'; +import { useAppStateSelector } from '../../application/main/state_management/discover_app_state_container'; const FOOTER_PADDING = { padding: 0 }; diff --git a/src/plugins/discover/public/components/hits_counter/hits_counter.test.tsx b/src/plugins/discover/public/components/hits_counter/hits_counter.test.tsx index 8d84cdcef5a0..fb56195b74f8 100644 --- a/src/plugins/discover/public/components/hits_counter/hits_counter.test.tsx +++ b/src/plugins/discover/public/components/hits_counter/hits_counter.test.tsx @@ -13,7 +13,7 @@ import { findTestSubject } from '@elastic/eui/lib/test'; import { EuiLoadingSpinner } from '@elastic/eui'; import { BehaviorSubject } from 'rxjs'; import { getDiscoverStateMock } from '../../__mocks__/discover_state.mock'; -import { DataTotalHits$ } from '../../application/main/services/discover_data_state_container'; +import { DataTotalHits$ } from '../../application/main/state_management/discover_data_state_container'; import { FetchStatus } from '../../application/types'; describe('hits counter', function () { diff --git a/src/plugins/discover/public/components/hits_counter/hits_counter.tsx b/src/plugins/discover/public/components/hits_counter/hits_counter.tsx index be3e819a5e07..368c18fbc192 100644 --- a/src/plugins/discover/public/components/hits_counter/hits_counter.tsx +++ b/src/plugins/discover/public/components/hits_counter/hits_counter.tsx @@ -11,7 +11,7 @@ import { EuiFlexGroup, EuiFlexItem, EuiText, EuiLoadingSpinner } from '@elastic/ import { FormattedMessage, FormattedNumber } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { css } from '@emotion/react'; -import type { DiscoverStateContainer } from '../../application/main/services/discover_state'; +import type { DiscoverStateContainer } from '../../application/main/state_management/discover_state'; import { FetchStatus } from '../../application/types'; import { useDataState } from '../../application/main/hooks/use_data_state'; diff --git a/src/plugins/discover/public/components/panels_toggle/panels_toggle.test.tsx b/src/plugins/discover/public/components/panels_toggle/panels_toggle.test.tsx index 54a41fbb9255..f833054a899c 100644 --- a/src/plugins/discover/public/components/panels_toggle/panels_toggle.test.tsx +++ b/src/plugins/discover/public/components/panels_toggle/panels_toggle.test.tsx @@ -12,7 +12,7 @@ import { findTestSubject } from '@elastic/eui/lib/test'; import { BehaviorSubject } from 'rxjs'; import { getDiscoverStateMock } from '../../__mocks__/discover_state.mock'; import { PanelsToggle, type PanelsToggleProps } from './panels_toggle'; -import { DiscoverAppStateProvider } from '../../application/main/services/discover_app_state_container'; +import { DiscoverAppStateProvider } from '../../application/main/state_management/discover_app_state_container'; import { SidebarToggleState } from '../../application/types'; describe('Panels toggle component', () => { diff --git a/src/plugins/discover/public/components/panels_toggle/panels_toggle.tsx b/src/plugins/discover/public/components/panels_toggle/panels_toggle.tsx index bd04823affd8..e1bfbf48259e 100644 --- a/src/plugins/discover/public/components/panels_toggle/panels_toggle.tsx +++ b/src/plugins/discover/public/components/panels_toggle/panels_toggle.tsx @@ -11,8 +11,8 @@ import { i18n } from '@kbn/i18n'; import useObservable from 'react-use/lib/useObservable'; import { BehaviorSubject } from 'rxjs'; import { IconButtonGroup } from '@kbn/shared-ux-button-toolbar'; -import { useAppStateSelector } from '../../application/main/services/discover_app_state_container'; -import { DiscoverStateContainer } from '../../application/main/services/discover_state'; +import { useAppStateSelector } from '../../application/main/state_management/discover_app_state_container'; +import { DiscoverStateContainer } from '../../application/main/state_management/discover_state'; import { SidebarToggleState } from '../../application/types'; export interface PanelsToggleProps { diff --git a/src/plugins/discover/public/components/view_mode_toggle/view_mode_toggle.test.tsx b/src/plugins/discover/public/components/view_mode_toggle/view_mode_toggle.test.tsx index e1788389d3ca..b5d176d0404a 100644 --- a/src/plugins/discover/public/components/view_mode_toggle/view_mode_toggle.test.tsx +++ b/src/plugins/discover/public/components/view_mode_toggle/view_mode_toggle.test.tsx @@ -15,7 +15,7 @@ import { findTestSubject } from '@elastic/eui/lib/test'; import { DocumentViewModeToggle } from './view_mode_toggle'; import { BehaviorSubject } from 'rxjs'; import { getDiscoverStateMock } from '../../__mocks__/discover_state.mock'; -import { DataTotalHits$ } from '../../application/main/services/discover_data_state_container'; +import { DataTotalHits$ } from '../../application/main/state_management/discover_data_state_container'; import { FetchStatus } from '../../application/types'; describe('Document view mode toggle component', () => { diff --git a/src/plugins/discover/public/components/view_mode_toggle/view_mode_toggle.tsx b/src/plugins/discover/public/components/view_mode_toggle/view_mode_toggle.tsx index 98b9ac12ef05..363288107470 100644 --- a/src/plugins/discover/public/components/view_mode_toggle/view_mode_toggle.tsx +++ b/src/plugins/discover/public/components/view_mode_toggle/view_mode_toggle.tsx @@ -13,7 +13,7 @@ import { css } from '@emotion/react'; import { isLegacyTableEnabled, SHOW_FIELD_STATISTICS } from '@kbn/discover-utils'; import { VIEW_MODE } from '../../../common/constants'; import { useDiscoverServices } from '../../hooks/use_discover_services'; -import { DiscoverStateContainer } from '../../application/main/services/discover_state'; +import { DiscoverStateContainer } from '../../application/main/state_management/discover_state'; import { HitsCounter, HitsCounterMode } from '../hits_counter'; export const DocumentViewModeToggle = ({ diff --git a/src/plugins/discover/public/customizations/customization_provider.ts b/src/plugins/discover/public/customizations/customization_provider.ts index a23869cdf878..a44c04009d64 100644 --- a/src/plugins/discover/public/customizations/customization_provider.ts +++ b/src/plugins/discover/public/customizations/customization_provider.ts @@ -10,7 +10,7 @@ import { createContext, useContext, useState } from 'react'; import useObservable from 'react-use/lib/useObservable'; import { isFunction } from 'lodash'; import useEffectOnce from 'react-use/lib/useEffectOnce'; -import type { DiscoverStateContainer } from '../application/main/services/discover_state'; +import type { DiscoverStateContainer } from '../application/main/state_management/discover_state'; import type { CustomizationCallback } from './types'; import { createCustomizationService, diff --git a/src/plugins/discover/public/customizations/types.ts b/src/plugins/discover/public/customizations/types.ts index 3f81b2cce7aa..079cde37da71 100644 --- a/src/plugins/discover/public/customizations/types.ts +++ b/src/plugins/discover/public/customizations/types.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import type { DiscoverStateContainer } from '../application/main/services/discover_state'; +import type { DiscoverStateContainer } from '../application/main/state_management/discover_state'; import type { DiscoverCustomizationService } from './customization_service'; export interface CustomizationCallbackContext { diff --git a/src/plugins/discover/public/embeddable/saved_search_embeddable.tsx b/src/plugins/discover/public/embeddable/saved_search_embeddable.tsx index 5a83197818a4..35c60deff573 100644 --- a/src/plugins/discover/public/embeddable/saved_search_embeddable.tsx +++ b/src/plugins/discover/public/embeddable/saved_search_embeddable.tsx @@ -66,7 +66,7 @@ import { SavedSearchEmbeddableComponent } from './saved_search_embeddable_compon import { handleSourceColumnState } from '../utils/state_helpers'; import { updateSearchSource } from './utils/update_search_source'; import { FieldStatisticsTable } from '../application/main/components/field_stats_table'; -import { fetchTextBased } from '../application/main/utils/fetch_text_based'; +import { fetchTextBased } from '../application/main/data_fetching/fetch_text_based'; import { isTextBasedQuery } from '../application/main/utils/is_text_based_query'; import { getValidViewMode } from '../application/main/utils/get_valid_view_mode'; import { ADHOC_DATA_VIEW_RENDER_EVENT } from '../constants'; diff --git a/src/plugins/discover/public/index.ts b/src/plugins/discover/public/index.ts index b25e4a25decf..a2ce384dd0e6 100644 --- a/src/plugins/discover/public/index.ts +++ b/src/plugins/discover/public/index.ts @@ -15,9 +15,9 @@ export function plugin(initializerContext: PluginInitializerContext) { } export type { ISearchEmbeddable, SearchInput } from './embeddable'; -export type { DiscoverAppState } from './application/main/services/discover_app_state_container'; -export type { DiscoverStateContainer } from './application/main/services/discover_state'; -export type { DataDocumentsMsg } from './application/main/services/discover_data_state_container'; +export type { DiscoverAppState } from './application/main/state_management/discover_app_state_container'; +export type { DiscoverStateContainer } from './application/main/state_management/discover_state'; +export type { DataDocumentsMsg } from './application/main/state_management/discover_data_state_container'; export type { DiscoverContainerProps } from './components/discover_container'; export type { CustomizationCallback, diff --git a/src/plugins/discover/public/utils/get_sharing_data.ts b/src/plugins/discover/public/utils/get_sharing_data.ts index 938705369801..b32f64cf79fb 100644 --- a/src/plugins/discover/public/utils/get_sharing_data.ts +++ b/src/plugins/discover/public/utils/get_sharing_data.ts @@ -24,7 +24,7 @@ import { import { DiscoverAppState, isEqualFilters, -} from '../application/main/services/discover_app_state_container'; +} from '../application/main/state_management/discover_app_state_container'; import { getSortForSearchSource } from './sorting'; /** diff --git a/x-pack/plugins/security_solution/public/common/components/discover_in_timeline/use_discover_in_timeline_actions.tsx b/x-pack/plugins/security_solution/public/common/components/discover_in_timeline/use_discover_in_timeline_actions.tsx index c651b039a97c..34e797c0b4be 100644 --- a/x-pack/plugins/security_solution/public/common/components/discover_in_timeline/use_discover_in_timeline_actions.tsx +++ b/x-pack/plugins/security_solution/public/common/components/discover_in_timeline/use_discover_in_timeline_actions.tsx @@ -12,7 +12,7 @@ import { useMemo, useCallback, useRef } from 'react'; import type { RefObject } from 'react'; import { useDispatch } from 'react-redux'; import type { SavedSearch } from '@kbn/saved-search-plugin/common'; -import type { DiscoverAppState } from '@kbn/discover-plugin/public/application/main/services/discover_app_state_container'; +import type { DiscoverAppState } from '@kbn/discover-plugin/public/application/main/state_management/discover_app_state_container'; import type { TimeRange } from '@kbn/es-query'; import { useMutation, useQueryClient } from '@tanstack/react-query'; import { useDiscoverState } from '../../../timelines/components/timeline/tabs/esql/use_discover_state'; diff --git a/x-pack/plugins/security_solution/public/common/store/discover/model.ts b/x-pack/plugins/security_solution/public/common/store/discover/model.ts index fa37e3a2c465..de06451bf2dc 100644 --- a/x-pack/plugins/security_solution/public/common/store/discover/model.ts +++ b/x-pack/plugins/security_solution/public/common/store/discover/model.ts @@ -5,8 +5,8 @@ * 2.0. */ -import type { DiscoverAppState } from '@kbn/discover-plugin/public/application/main/services/discover_app_state_container'; -import type { InternalState } from '@kbn/discover-plugin/public/application/main/services/discover_internal_state_container'; +import type { DiscoverAppState } from '@kbn/discover-plugin/public/application/main/state_management/discover_app_state_container'; +import type { InternalState } from '@kbn/discover-plugin/public/application/main/state_management/discover_internal_state_container'; import type { SavedSearch } from '@kbn/saved-search-plugin/common'; export interface SecuritySolutionDiscoverState { diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/esql/use_discover_state.ts b/x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/esql/use_discover_state.ts index 4edbcd404d40..5a2b35ec8f92 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/esql/use_discover_state.ts +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/esql/use_discover_state.ts @@ -5,8 +5,8 @@ * 2.0. */ -import type { DiscoverAppState } from '@kbn/discover-plugin/public/application/main/services/discover_app_state_container'; -import type { InternalState } from '@kbn/discover-plugin/public/application/main/services/discover_internal_state_container'; +import type { DiscoverAppState } from '@kbn/discover-plugin/public/application/main/state_management/discover_app_state_container'; +import type { InternalState } from '@kbn/discover-plugin/public/application/main/state_management/discover_internal_state_container'; import type { SavedSearch } from '@kbn/saved-search-plugin/common'; import { useCallback } from 'react'; import { useDispatch, useSelector } from 'react-redux';