Skip to content

Commit

Permalink
refactor to mainly use data_view/public imports
Browse files Browse the repository at this point in the history
  • Loading branch information
kertal committed Mar 9, 2022
1 parent c0e1d20 commit 79a0b96
Show file tree
Hide file tree
Showing 99 changed files with 127 additions and 120 deletions.
2 changes: 1 addition & 1 deletion src/plugins/discover/public/__mocks__/index_pattern.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Side Public License, v 1.
*/

import { IIndexPatternFieldList, DataView } from '../../../data_views/common';
import { IIndexPatternFieldList, DataView } from '../../../data_views/public';

const fields = [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Side Public License, v 1.
*/

import { IIndexPatternFieldList, DataView } from '../../../data_views/common';
import { IIndexPatternFieldList, DataView } from '../../../data_views/public';

const fields = [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { EuiText, EuiPageContent, EuiPage, EuiSpacer } from '@elastic/eui';
import { cloneDeep } from 'lodash';
import { DOC_TABLE_LEGACY, SEARCH_FIELDS_FROM_SOURCE } from '../../../common';
import { ContextErrorMessage } from './components/context_error_message';
import { DataView, DataViewField } from '../../../../data_views/common';
import { DataView, DataViewField } from '../../../../data_views/public';
import { LoadingStatus } from './services/context_query_state';
import { AppState, isEqualFilters } from './services/context_state';
import { useColumns } from '../../utils/use_data_grid_columns';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import React, { useState, Fragment, useMemo, useCallback } from 'react';
import { FormattedMessage } from '@kbn/i18n-react';
import { EuiHorizontalRule, EuiText } from '@elastic/eui';
import { CONTEXT_STEP_SETTING, DOC_HIDE_TIME_COLUMN_SETTING } from '../../../common';
import type { DataView } from '../../../../data_views/common';
import type { DataView } from '../../../../data_views/public';
import { SortDirection } from '../../../../data/common';
import { LoadingStatus } from './services/context_query_state';
import { ActionBar } from './components/action_bar/action_bar';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
import { DataView } from '../../../../../data_views/common';
import { DataView } from '../../../../../data_views/public';
import { SortDirection } from '../../../../../data/common';
import { createSearchSourceStub } from './_stubs';
import { fetchAnchor, updateSearchSource } from './anchor';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import { i18n } from '@kbn/i18n';
import { ISearchSource, EsQuerySortValue } from '../../../../../data/common';
import { DataView } from '../../../../../data_views/common';
import { DataView } from '../../../../../data_views/public';
import { EsHitRecord } from '../../types';

export async function fetchAnchor(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import moment from 'moment';
import { get, last } from 'lodash';
import type { DataView } from 'src/plugins/data_views/common';
import type { DataView } from 'src/plugins/data_views/public';
import { SortDirection } from 'src/plugins/data/common';
import { createContextSearchSourceStub } from './_stubs';
import { fetchSurroundingDocs, SurrDocType } from './context';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import moment from 'moment';
import { get, last } from 'lodash';
import { SortDirection } from 'src/plugins/data/common';
import type { DataView } from 'src/plugins/data_views/common';
import type { DataView } from 'src/plugins/data_views/public';
import { createContextSearchSourceStub } from './_stubs';
import { DataPublicPluginStart, Query } from '../../../../../data/public';
import { fetchSurroundingDocs, SurrDocType } from './context';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Side Public License, v 1.
*/
import type { Filter } from '@kbn/es-query';
import { DataView } from 'src/plugins/data_views/common';
import { DataView } from 'src/plugins/data_views/public';
import { ISearchSource } from 'src/plugins/data/common';
import { DataPublicPluginStart } from 'src/plugins/data/public';
import { reverseSortDir, SortDirection } from '../utils/sorting';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Side Public License, v 1.
*/

import type { DataView } from 'src/plugins/data_views/common';
import type { DataView } from 'src/plugins/data_views/public';

export enum SortDirection {
asc = 'asc',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {
} from '../__mocks__/use_context_app_fetch';
import { indexPatternWithTimefieldMock } from '../../../__mocks__/index_pattern_with_timefield';
import { createContextSearchSourceStub } from '../services/_stubs';
import { DataView } from '../../../../../data_views/common';
import { DataView } from '../../../../../data_views/public';
import { themeServiceMock } from '../../../../../../core/public/mocks';
import { KibanaContextProvider } from '../../../../../kibana_react/public';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { CONTEXT_TIE_BREAKER_FIELDS_SETTING } from '../../../../common';
import { fetchAnchor } from '../services/anchor';
import { fetchSurroundingDocs, SurrDocType } from '../services/context';
import { MarkdownSimple, toMountPoint, wrapWithTheme } from '../../../../../kibana_react/public';
import type { DataView } from '../../../../../data_views/common';
import type { DataView } from '../../../../../data_views/public';
import { SortDirection } from '../../../../../data/common';
import {
ContextFetchState,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import React from 'react';
import { FormattedMessage } from '@kbn/i18n-react';
import { EuiCallOut, EuiLink, EuiLoadingSpinner, EuiPageContent, EuiPage } from '@elastic/eui';
import type { DataView } from 'src/plugins/data_views/common';
import type { DataView } from 'src/plugins/data_views/public';
import { DocViewer } from '../../../services/doc_views/components/doc_viewer';
import { ElasticRequestState } from '../types';
import { useEsDocSearch } from '../../../utils/use_es_doc_search';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import React from 'react';
import { act } from 'react-dom/test-utils';
import { Subject, BehaviorSubject } from 'rxjs';
import { mountWithIntl } from '@kbn/test-jest-helpers';
import type { DataView } from '../../../../../../data_views/common';
import type { DataView } from '../../../../../../data_views/public';
import { setHeaderActionMenuMounter, setUiActions } from '../../../../kibana_services';
import { esHits } from '../../../../__mocks__/es_hits';
import { savedSearchMock } from '../../../../__mocks__/saved_search';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
EuiSpacer,
} from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import type { DataView } from '../../../../../../data_views/common';
import type { DataView } from '../../../../../../data_views/public';
import { HitsCounter } from '../hits_counter';
import { SavedSearch } from '../../../../services/saved_searches';
import { GetStateReturn } from '../../services/discover_state';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import type { Filter } from '@kbn/es-query';
import { METRIC_TYPE, UiCounterMetricType } from '@kbn/analytics';
import { useDiscoverServices } from '../../../../utils/use_discover_services';
import type { Query } from '../../../../../../data/common';
import type { DataViewField, DataView } from '../../../../../../data_views/common';
import type { DataViewField, DataView } from '../../../../../../data_views/public';
import {
EmbeddableInput,
EmbeddableOutput,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {
SEARCH_FIELDS_FROM_SOURCE,
} from '../../../../../common';
import { useColumns } from '../../../../utils/use_data_grid_columns';
import { DataView } from '../../../../../../data_views/common';
import { DataView } from '../../../../../../data_views/public';
import { SavedSearch } from '../../../../services/saved_searches';
import { DataDocumentsMsg, DataDocuments$ } from '../../utils/use_saved_search';
import { AppState, GetStateReturn } from '../../services/discover_state';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ import { esHits } from '../../../../__mocks__/es_hits';
import { indexPatternMock } from '../../../../__mocks__/index_pattern';
import { savedSearchMock } from '../../../../__mocks__/saved_search';
import { createSearchSourceMock } from '../../../../../../data/common/search/search_source/mocks';
import type { DataView, DataViewAttributes } from '../../../../../../data_views/common';
import type { DataViewAttributes } from '../../../../../../data_views/common';
import type { DataView } from '../../../../../../data_views/public';
import { SavedObject } from '../../../../../../../core/types';
import { indexPatternWithTimefieldMock } from '../../../../__mocks__/index_pattern_with_timefield';
import { GetStateReturn } from '../../services/discover_state';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { useDiscoverServices } from '../../../../utils/use_discover_services';
import { DiscoverNoResults } from '../no_results';
import { LoadingSpinner } from '../loading_spinner/loading_spinner';
import { generateFilters } from '../../../../../../data/public';
import { DataViewField } from '../../../../../../data_views/common';
import { DataViewField } from '../../../../../../data_views/public';
import { DiscoverSidebarResponsive } from '../sidebar';
import { DiscoverLayoutProps } from './types';
import { SEARCH_FIELDS_FROM_SOURCE, SHOW_FIELD_STATISTICS } from '../../../../../common';
Expand All @@ -48,7 +48,7 @@ import {
import { FieldStatisticsTable } from '../field_stats_table';
import { VIEW_MODE } from '../../../../components/view_mode_toggle';
import { DOCUMENTS_VIEW_CLICK, FIELD_STATISTICS_VIEW_CLICK } from '../field_stats_table/constants';
import { DataViewType, DataView } from '../../../../../../data_views/common';
import { DataViewType, DataView } from '../../../../../../data_views/public';

/**
* Local storage key for sidebar persistence state
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
*/

import type { Query, SavedObject, TimeRange } from '../../../../../../data/common';
import type { DataView, DataViewAttributes } from '../../../../../../data_views/common';
import type { DataViewAttributes } from '../../../../../../data_views/common';
import type { DataView } from '../../../../../../data_views/public';
import { ISearchSource } from '../../../../../../data/public';
import { AppState, GetStateReturn } from '../../services/discover_state';
import { DataRefetch$, SavedSearchData } from '../../utils/use_saved_search';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { storiesOf } from '@storybook/react';
import React from 'react';
import { KBN_FIELD_TYPES } from '@kbn/field-types';
import { DiscoverFieldDetails } from '../discover_field_details';
import { DataView, IndexPatternField } from '../../../../../../../data_views/common';
import { DataView, IndexPatternField } from '../../../../../../../data_views/public';
import { fieldSpecMap } from './fields';
import { numericField as field } from './fields';
import { Bucket } from '../types';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
* Side Public License, v 1.
*/

import { FieldSpec, DataViewField } from '../../../../../../../data_views/common';
import { FieldSpec } from '../../../../../../../data_views/common';
import { DataViewField } from '../../../../../../../data_views/public';

export const fieldSpecMap: Record<string, FieldSpec> = {
'machine.os': {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { findTestSubject } from '@elastic/eui/lib/test';
import { mountWithIntl } from '@kbn/test-jest-helpers';

import { DiscoverField } from './discover_field';
import { DataViewField } from '../../../../../../data_views/common';
import { DataViewField } from '../../../../../../data_views/public';
import { stubIndexPattern } from '../../../../../../data/common/stubs';
import { KibanaContextProvider } from '../../../../../../kibana_react/public';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import classNames from 'classnames';
import { FieldButton, FieldIcon } from '@kbn/react-field';
import { DiscoverFieldDetails } from './discover_field_details';
import { FieldDetails } from './types';
import type { DataViewField, DataView } from '../../../../../../data_views/common';
import type { DataViewField, DataView } from '../../../../../../data_views/public';
import { getFieldTypeName } from './lib/get_field_type_name';
import { DiscoverFieldVisualize } from './discover_field_visualize';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { EuiText, EuiButtonIcon, EuiFlexGroup, EuiFlexItem, EuiSpacer } from '@e
import { i18n } from '@kbn/i18n';
import { StringFieldProgressBar } from './string_progress_bar';
import { Bucket } from './types';
import { DataViewField } from '../../../../../../data_views/common';
import { DataViewField } from '../../../../../../data_views/public';
import './discover_field_bucket.scss';

interface Props {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { findTestSubject } from '@elastic/eui/lib/test';
import { mountWithIntl } from '@kbn/test-jest-helpers';

import { DiscoverFieldDetails } from './discover_field_details';
import { DataViewField } from '../../../../../../data_views/common';
import { DataViewField } from '../../../../../../data_views/public';
import { stubIndexPattern } from '../../../../../../data/common/stubs';

describe('discover sidebar field details', function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { EuiText, EuiSpacer, EuiLink } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n-react';
import { DiscoverFieldBucket } from './discover_field_bucket';
import { Bucket, FieldDetails } from './types';
import { DataViewField, DataView } from '../../../../../../data_views/common';
import { DataViewField, DataView } from '../../../../../../data_views/public';

interface DiscoverFieldDetailsProps {
field: DataViewField;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import React, { useEffect, useState } from 'react';
import { METRIC_TYPE, UiCounterMetricType } from '@kbn/analytics';
import type { DataView, DataViewField } from 'src/plugins/data_views/common';
import type { DataView, DataViewField } from 'src/plugins/data_views/public';

import { triggerVisualizeActions, VisualizeInformation } from './lib/visualize_trigger_utils';
import type { FieldDetails } from './types';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import React from 'react';
import { EuiButton } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n-react';
import type { DataViewField } from '../../../../../../data_views/common';
import type { DataViewField } from '../../../../../../data_views/public';
import { VisualizeInformation } from './lib/visualize_trigger_utils';

interface DiscoverFieldVisualizeInnerProps {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ import { ChangeIndexPattern } from './change_indexpattern';
import { SavedObject } from 'kibana/server';
import { DiscoverIndexPattern, DiscoverIndexPatternProps } from './discover_index_pattern';
import { EuiSelectable } from '@elastic/eui';
import type { DataView, DataViewAttributes } from 'src/plugins/data_views/common';
import type { DataViewAttributes } from 'src/plugins/data_views/common';
import type { DataView } from 'src/plugins/data_views/public';
import { indexPatternsMock } from '../../../../__mocks__/index_patterns';

const indexPattern = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@

import React, { useState, useEffect } from 'react';
import { SavedObject } from 'kibana/public';
import type { DataView, DataViewAttributes } from 'src/plugins/data_views/common';
import type { DataViewAttributes } from 'src/plugins/data_views/common';
import type { DataView } from 'src/plugins/data_views/public';
import { IndexPatternRef } from './types';
import { ChangeIndexPattern } from './change_indexpattern';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
} from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { useDiscoverServices } from '../../../../utils/use_discover_services';
import type { DataView } from '../../../../../../data_views/common';
import type { DataView } from '../../../../../../data_views/public';

export interface DiscoverIndexPatternManagementProps {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import { DiscoverSidebarResponsiveProps } from './discover_sidebar_responsive';
import { DiscoverIndexPatternManagement } from './discover_index_pattern_management';
import { VIEW_MODE } from '../../../../components/view_mode_toggle';
import { ElasticSearchHit } from '../../../../types';
import { DataViewField } from '../../../../../../data_views/common';
import { DataViewField } from '../../../../../../data_views/public';

/**
* Default number of available fields displayed and added on scroll
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,8 @@ import {
} from '@elastic/eui';
import { useDiscoverServices } from '../../../../utils/use_discover_services';
import { DiscoverIndexPattern } from './discover_index_pattern';
import type {
DataViewField,
DataView,
DataViewAttributes,
} from '../../../../../../data_views/common';
import type { DataViewField, DataView } from '../../../../../../data_views/public';
import type { DataViewAttributes } from '../../../../../../data_views/common';
import { SavedObject } from '../../../../../../../core/types';
import { getDefaultFieldFilter } from './lib/field_filter';
import { DiscoverSidebar } from './discover_sidebar';
Expand Down
Loading

0 comments on commit 79a0b96

Please sign in to comment.