Skip to content

Commit

Permalink
[ML] Remove export wildcard syntax for data visualizer plugin. (#123213)
Browse files Browse the repository at this point in the history
Remove export wildcard syntax for data visualizer plugin.
  • Loading branch information
walterra authored Jan 24, 2022
1 parent ed51852 commit a6853ec
Show file tree
Hide file tree
Showing 32 changed files with 38 additions and 48 deletions.
12 changes: 0 additions & 12 deletions x-pack/plugins/data_visualizer/common/index.ts

This file was deleted.

3 changes: 0 additions & 3 deletions x-pack/plugins/data_visualizer/kibana.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@
"fieldFormats",
"uiActions"
],
"extraPublicDirs": [
"common"
],
"owner": {
"name": "Machine Learning UI",
"githubTeam": "ml-ui"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
NumberContent,
} from '../stats_table/components/field_data_expanded_row';
import { GeoPointContent } from './geo_point_content/geo_point_content';
import { JOB_FIELD_TYPES } from '../../../../../common';
import { JOB_FIELD_TYPES } from '../../../../../common/constants';
import type { FileBasedFieldVisConfig } from '../../../../../common/types/field_vis_config';

export const FileBasedDataVisualizerExpandedRow = ({ item }: { item: FileBasedFieldVisConfig }) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { DocumentStatsTable } from '../../stats_table/components/field_data_expa
import { ExamplesList } from '../../examples_list';
import { FieldVisConfig } from '../../stats_table/types';
import { useDataVisualizerKibana } from '../../../../kibana_context';
import { JOB_FIELD_TYPES } from '../../../../../../common';
import { JOB_FIELD_TYPES } from '../../../../../../common/constants';
import { ES_GEO_FIELD_TYPE, LayerDescriptor } from '../../../../../../../maps/common';
import { EmbeddedMapComponent } from '../../embedded_map';
import { ExpandedRowPanel } from '../../stats_table/components/field_data_expanded_row/expanded_row_panel';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import React from 'react';
import { GeoPointContentWithMap } from './geo_point_content_with_map';
import { JOB_FIELD_TYPES } from '../../../../../common';
import { JOB_FIELD_TYPES } from '../../../../../common/constants';
import {
BooleanContent,
DateContent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
dataVisualizerRefresh$,
Refresh,
} from '../../../../index_data_visualizer/services/timefilter_refresh_service';
import { JOB_FIELD_TYPES } from '../../../../../../common';
import { JOB_FIELD_TYPES } from '../../../../../../common/constants';
import { VISUALIZE_GEO_FIELD_TRIGGER } from '../../../../../../../../../src/plugins/ui_actions/public';

export function getActions(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import type {
XYLayerConfig,
} from '../../../../../../../lens/public';
import { FieldVisConfig } from '../../stats_table/types';
import { JOB_FIELD_TYPES } from '../../../../../../common';
import { JOB_FIELD_TYPES } from '../../../../../../common/constants';

interface ColumnsAndLayer {
columns: Record<string, GenericIndexPatternColumn>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import React from 'react';
import { mount, shallow } from 'enzyme';

import { FieldTypeIcon } from './field_type_icon';
import { JOB_FIELD_TYPES } from '../../../../../common';
import { JOB_FIELD_TYPES } from '../../../../../common/constants';

describe('FieldTypeIcon', () => {
test(`render component when type matches a field type`, () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { EuiToolTip } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { FieldIcon } from '@kbn/react-field';
import { getJobTypeLabel } from '../../util/field_types_utils';
import type { JobFieldType } from '../../../../../common';
import type { JobFieldType } from '../../../../../common/types';
import './_index.scss';

interface FieldTypeIconProps {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import { FindFileStructureResponse } from '../../../../../../file_upload/common';
import { getFieldNames, getSupportedFieldType } from './get_field_names';
import { FileBasedFieldVisConfig } from '../stats_table/types';
import { JOB_FIELD_TYPES } from '../../../../../common';
import { JOB_FIELD_TYPES } from '../../../../../common/constants';
import { roundToDecimalPlace } from '../utils';

export function createFields(results: FindFileStructureResponse) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import React, { useMemo, FC, useState } from 'react';
import { EuiFlexGroup, EuiSpacer } from '@elastic/eui';
import type { FindFileStructureResponse } from '../../../../../../file_upload/common';
import type { DataVisualizerTableState } from '../../../../../common';
import type { DataVisualizerTableState } from '../../../../../common/types';
import { DataVisualizerTable, ItemIdToExpandedRowMap } from '../stats_table';
import type { FileBasedFieldVisConfig } from '../../../../../common/types/field_vis_config';
import { FileBasedDataVisualizerExpandedRow } from '../expanded_row';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

import { JOB_FIELD_TYPES } from '../../../../../common';
import { JOB_FIELD_TYPES } from '../../../../../common/constants';
import type {
FileBasedFieldVisConfig,
FileBasedUnknownFieldVisConfig,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
import { difference } from 'lodash';
import { ES_FIELD_TYPES } from '../../../../../../../../src/plugins/data/common';
import type { FindFileStructureResponse } from '../../../../../../file_upload/common';
import type { JobFieldType } from '../../../../../common';
import { JOB_FIELD_TYPES } from '../../../../../common';
import type { JobFieldType } from '../../../../../common/types';
import { JOB_FIELD_TYPES } from '../../../../../common/constants';
export function getFieldNames(results: FindFileStructureResponse) {
const { mappings, field_stats: fieldStats, column_names: columnNames } = results;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ import {
import { i18n } from '@kbn/i18n';
import { EuiTableComputedColumnType } from '@elastic/eui/src/components/basic_table/table_types';
import { throttle } from 'lodash';
import { JOB_FIELD_TYPES, JobFieldType, DataVisualizerTableState } from '../../../../../common';
import { JOB_FIELD_TYPES } from '../../../../../common/constants';
import type { JobFieldType, DataVisualizerTableState } from '../../../../../common/types';
import { DocumentStat } from './components/field_data_row/document_stats';
import { IndexBasedNumberContentPreview } from './components/field_data_row/number_content_preview';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import { Direction, EuiBasicTableProps, Pagination, PropertySort } from '@elastic/eui';
import { useCallback, useMemo } from 'react';

import { DataVisualizerTableState } from '../../../../../common';
import type { DataVisualizerTableState } from '../../../../../common/types';

const PAGE_SIZE_OPTIONS = [10, 25, 50, 100];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import { isEqual } from 'lodash';
import type { AnalysisResult, InputOverrides } from '../../../../../../file_upload/common';
import { MB, FILE_FORMATS } from '../../../../../common';
import { MB, FILE_FORMATS } from '../../../../../common/constants';

export const DEFAULT_LINES_TO_SAMPLE = 1000;
const UPLOAD_SIZE_MB = 5;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

import { JOB_FIELD_TYPES } from '../../../../common';
import { JOB_FIELD_TYPES } from '../../../../common/constants';
import { getJobTypeLabel, jobTypeLabels } from './field_types_utils';

describe('field type utils', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import { i18n } from '@kbn/i18n';
import { JOB_FIELD_TYPES } from '../../../../common';
import { JOB_FIELD_TYPES } from '../../../../common/constants';
import type { IndexPatternField } from '../../../../../../../src/plugins/data/common';
import { KBN_FIELD_TYPES } from '../../../../../../../src/plugins/data/common';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import React, { FC } from 'react';

import { EuiTitle, EuiSpacer, EuiDescriptionList } from '@elastic/eui';
import type { FindFileStructureResponse } from '../../../../../../file_upload/common';
import { FILE_FORMATS } from '../../../../../common';
import { FILE_FORMATS } from '../../../../../common/constants';

export const AnalysisSummary: FC<{ results: FindFileStructureResponse }> = ({ results }) => {
const items = createDisplayItems(results);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

import { FILE_FORMATS } from '../../../../../../common/';
import { FILE_FORMATS } from '../../../../../../common/constants';

import {
TIMESTAMP_OPTIONS,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {
EuiTextArea,
} from '@elastic/eui';

import { FILE_FORMATS } from '../../../../../common';
import { FILE_FORMATS } from '../../../../../common/constants';

import {
getFormatOptions,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import { mountWithIntl, shallowWithIntl } from '@kbn/test/jest';
import React from 'react';
import { FILE_FORMATS } from '../../../../../common';
import { FILE_FORMATS } from '../../../../../common/constants';

import { Overrides } from './overrides';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import React, { FC } from 'react';
import { EuiCallOut, EuiSpacer, EuiButtonEmpty, EuiHorizontalRule } from '@elastic/eui';

import numeral from '@elastic/numeral';
import { FILE_SIZE_DISPLAY_FORMAT } from '../../../../../common';
import { FILE_SIZE_DISPLAY_FORMAT } from '../../../../../common/constants';
import { FindFileStructureErrorResponse } from '../../../../../../file_upload/common';

interface FileTooLargeProps {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import { JobFieldType, SavedSearchSavedObject } from '../../../../../common/type
import { useDataVisualizerKibana } from '../../../kibana_context';
import { FieldCountPanel } from '../../../common/components/field_count_panel';
import { DocumentCountContent } from '../../../common/components/document_count_content';
import { OMIT_FIELDS } from '../../../../../common';
import { OMIT_FIELDS } from '../../../../../common/constants';
import { kbnTypeToJobType } from '../../../common/util/field_types_utils';
import { SearchPanel } from '../search_panel';
import { ActionsPanel } from '../actions_panel';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import React, { FC, useMemo } from 'react';
import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { JobFieldType } from '../../../../../common';
import type { JobFieldType } from '../../../../../common/types';
import { FieldTypeIcon } from '../../../common/components/field_type_icon';
import { MultiSelectPicker, Option } from '../../../common/components/multi_select_picker';
import { jobTypeLabels } from '../../../common/util/field_types_utils';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import {
} from '../../../common/components/stats_table';
import { FieldVisConfig } from '../../../common/components/stats_table/types';
import { getDefaultDataVisualizerListState } from '../../components/index_data_visualizer_view/index_data_visualizer_view';
import { DataVisualizerTableState, SavedSearchSavedObject } from '../../../../../common';
import type { DataVisualizerTableState, SavedSearchSavedObject } from '../../../../../common/types';
import { DataVisualizerIndexBasedAppState } from '../../types/index_data_visualizer_state';
import { IndexBasedDataVisualizerExpandedRow } from '../../../common/components/expanded_row/index_based_expanded_row';
import { useDataVisualizerGridData } from '../../hooks/use_data_visualizer_grid_data';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,11 @@ import {
} from '../../../../../../../src/plugins/data/common';
import { FieldVisConfig } from '../../common/components/stats_table/types';
import {
FieldRequestConfig,
JOB_FIELD_TYPES,
JobFieldType,
NON_AGGREGATABLE_FIELD_TYPES,
OMIT_FIELDS,
} from '../../../../common';
} from '../../../../common/constants';
import type { FieldRequestConfig, JobFieldType } from '../../../../common/types';
import { kbnTypeToJobType } from '../../common/util/field_types_utils';
import { getActions } from '../../common/components/field_data_row/action_menu';
import { DataVisualizerGridInput } from '../embeddables/grid_embeddable/grid_embeddable';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import type {
Field,
} from '../../../../common/types/field_stats';
import { useDataVisualizerKibana } from '../../kibana_context';
import type { FieldRequestConfig } from '../../../../common';
import type { FieldRequestConfig } from '../../../../common/types';
import type { DataVisualizerIndexBasedAppState } from '../types/index_data_visualizer_state';
import {
buildBaseFilterCriteria,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import type { FieldStatsError } from '../../../../../common/types/field_stats';
import type { ISearchOptions } from '../../../../../../../../src/plugins/data/common';
import { ISearchStart } from '../../../../../../../../src/plugins/data/public';
import type { FieldStats } from '../../../../../common/types/field_stats';
import { JOB_FIELD_TYPES } from '../../../../../common';
import { JOB_FIELD_TYPES } from '../../../../../common/constants';
import { fetchDateFieldsStats } from './get_date_field_stats';
import { fetchBooleanFieldsStats } from './get_boolean_field_stats';
import { fetchFieldsExamples } from './get_field_examples';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
createMergedEsQuery,
getEsQueryFromSavedSearch,
} from './saved_search_utils';
import type { SavedSearchSavedObject } from '../../../../common';
import type { SavedSearchSavedObject } from '../../../../common/types';
import type { SavedSearch } from '../../../../../../../src/plugins/discover/public';
import type { Filter, FilterStateStore } from '@kbn/es-query';
import { stubbedSavedObjectIndexPattern } from '../../../../../../../src/plugins/data_views/common/data_view.stub';
Expand Down
7 changes: 6 additions & 1 deletion x-pack/plugins/data_visualizer/public/register_home.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@ import { i18n } from '@kbn/i18n';
import type { HomePublicPluginSetup } from '../../../../src/plugins/home/public';
import { FeatureCatalogueCategory } from '../../../../src/plugins/home/public';
import { FileDataVisualizerWrapper } from './lazy_load_bundle/component_wrapper';
import { featureTitle, FILE_DATA_VIS_TAB_ID, applicationPath, featureId } from '../common';
import {
featureTitle,
FILE_DATA_VIS_TAB_ID,
applicationPath,
featureId,
} from '../common/constants';

export function registerHomeAddData(home: HomePublicPluginSetup) {
home.addData.registerAddDataTab({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import { i18n } from '@kbn/i18n';
import { CustomIntegrationsPluginSetup } from '../../../../src/plugins/custom_integrations/server';
import { applicationPath, featureId, featureTitle } from '../common';
import { applicationPath, featureId, featureTitle } from '../common/constants';

export function registerWithCustomIntegrations(customIntegrations: CustomIntegrationsPluginSetup) {
customIntegrations.registerCustomIntegration({
Expand Down

0 comments on commit a6853ec

Please sign in to comment.