[Data Plugin]: Remove export *
for common code from public/server index files (#52821)
This commit is contained in:
parent
f8ba2fdd78
commit
2caf640d48
|
@ -20,7 +20,5 @@
|
||||||
export { buildEsQuery, EsQueryConfig } from './build_es_query';
|
export { buildEsQuery, EsQueryConfig } from './build_es_query';
|
||||||
export { buildQueryFromFilters } from './from_filters';
|
export { buildQueryFromFilters } from './from_filters';
|
||||||
export { luceneStringToDsl } from './lucene_string_to_dsl';
|
export { luceneStringToDsl } from './lucene_string_to_dsl';
|
||||||
export { migrateFilter } from './migrate_filter';
|
|
||||||
export { decorateQuery } from './decorate_query';
|
export { decorateQuery } from './decorate_query';
|
||||||
export { filterMatchesIndex } from './filter_matches_index';
|
|
||||||
export { getEsQueryConfig } from './get_es_query_config';
|
export { getEsQueryConfig } from './get_es_query_config';
|
||||||
|
|
|
@ -21,13 +21,14 @@ import { omit, get } from 'lodash';
|
||||||
import { Filter } from './meta_filter';
|
import { Filter } from './meta_filter';
|
||||||
|
|
||||||
export * from './build_filters';
|
export * from './build_filters';
|
||||||
export * from './get_filter_params';
|
|
||||||
export * from './get_filter_field';
|
|
||||||
|
|
||||||
export * from './custom_filter';
|
export * from './custom_filter';
|
||||||
export * from './exists_filter';
|
export * from './exists_filter';
|
||||||
export * from './geo_bounding_box_filter';
|
export * from './geo_bounding_box_filter';
|
||||||
export * from './geo_polygon_filter';
|
export * from './geo_polygon_filter';
|
||||||
|
export * from './get_display_value';
|
||||||
|
export * from './get_filter_field';
|
||||||
|
export * from './get_filter_params';
|
||||||
|
export * from './get_index_pattern_from_filter';
|
||||||
export * from './match_all_filter';
|
export * from './match_all_filter';
|
||||||
export * from './meta_filter';
|
export * from './meta_filter';
|
||||||
export * from './missing_filter';
|
export * from './missing_filter';
|
||||||
|
|
|
@ -19,6 +19,5 @@
|
||||||
import * as esQuery from './es_query';
|
import * as esQuery from './es_query';
|
||||||
import * as esFilters from './filters';
|
import * as esFilters from './filters';
|
||||||
import * as esKuery from './kuery';
|
import * as esKuery from './kuery';
|
||||||
import * as utils from './utils';
|
|
||||||
|
|
||||||
export { esFilters, esQuery, utils, esKuery };
|
export { esFilters, esQuery, esKuery };
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
import { get, isUndefined } from 'lodash';
|
import { get, isUndefined } from 'lodash';
|
||||||
import { getPhraseScript } from '../../filters';
|
import { getPhraseScript } from '../../filters';
|
||||||
import { getFields } from './utils/get_fields';
|
import { getFields } from './utils/get_fields';
|
||||||
import { getTimeZoneFromSettings } from '../../utils/get_time_zone_from_settings';
|
import { getTimeZoneFromSettings } from '../../utils';
|
||||||
import { getFullFieldNameNode } from './utils/get_full_field_name_node';
|
import { getFullFieldNameNode } from './utils/get_full_field_name_node';
|
||||||
|
|
||||||
import * as ast from '../ast';
|
import * as ast from '../ast';
|
||||||
|
|
|
@ -22,7 +22,7 @@ import { nodeTypes } from '../node_types';
|
||||||
import * as ast from '../ast';
|
import * as ast from '../ast';
|
||||||
import { getRangeScript } from '../../filters';
|
import { getRangeScript } from '../../filters';
|
||||||
import { getFields } from './utils/get_fields';
|
import { getFields } from './utils/get_fields';
|
||||||
import { getTimeZoneFromSettings } from '../../utils/get_time_zone_from_settings';
|
import { getTimeZoneFromSettings } from '../../utils';
|
||||||
import { getFullFieldNameNode } from './utils/get_full_field_name_node';
|
import { getFullFieldNameNode } from './utils/get_full_field_name_node';
|
||||||
|
|
||||||
export function buildNodeParams(fieldName, params) {
|
export function buildNodeParams(fieldName, params) {
|
||||||
|
|
|
@ -1,22 +0,0 @@
|
||||||
/*
|
|
||||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
|
||||||
* license agreements. See the NOTICE file distributed with
|
|
||||||
* this work for additional information regarding copyright
|
|
||||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
|
||||||
* the Apache License, Version 2.0 (the "License"); you may
|
|
||||||
* not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing,
|
|
||||||
* software distributed under the License is distributed on an
|
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
||||||
* KIND, either express or implied. See the License for the
|
|
||||||
* specific language governing permissions and limitations
|
|
||||||
* under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
export * from './get_time_zone_from_settings';
|
|
||||||
export * from './get_index_pattern_from_filter';
|
|
||||||
export * from './get_display_value';
|
|
|
@ -22,19 +22,75 @@ export function plugin(initializerContext: PluginInitializerContext) {
|
||||||
return new DataPublicPlugin(initializerContext);
|
return new DataPublicPlugin(initializerContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
export * from '../common';
|
/**
|
||||||
|
* Types to be shared externally
|
||||||
|
* @public
|
||||||
|
*/
|
||||||
|
export { IRequestTypesMap, IResponseTypesMap } from './search';
|
||||||
|
export * from './types';
|
||||||
|
export {
|
||||||
|
// field formats
|
||||||
|
ContentType, // only used in agg_type
|
||||||
|
FIELD_FORMAT_IDS,
|
||||||
|
IFieldFormat,
|
||||||
|
IFieldFormatId,
|
||||||
|
IFieldFormatType,
|
||||||
|
// index patterns
|
||||||
|
IIndexPattern,
|
||||||
|
IFieldType,
|
||||||
|
IFieldSubType,
|
||||||
|
// kbn field types
|
||||||
|
ES_FIELD_TYPES,
|
||||||
|
KBN_FIELD_TYPES,
|
||||||
|
// query
|
||||||
|
Query,
|
||||||
|
// timefilter
|
||||||
|
RefreshInterval,
|
||||||
|
TimeRange,
|
||||||
|
} from '../common';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Static code to be shared externally
|
||||||
|
* @public
|
||||||
|
*/
|
||||||
export * from './autocomplete_provider';
|
export * from './autocomplete_provider';
|
||||||
export * from './field_formats_provider';
|
export * from './field_formats_provider';
|
||||||
export * from './index_patterns';
|
export * from './index_patterns';
|
||||||
|
|
||||||
export * from './types';
|
|
||||||
|
|
||||||
export { IRequestTypesMap, IResponseTypesMap } from './search';
|
|
||||||
export * from './search';
|
export * from './search';
|
||||||
export * from './query';
|
export * from './query';
|
||||||
|
|
||||||
export * from './ui';
|
export * from './ui';
|
||||||
|
export {
|
||||||
|
// es query
|
||||||
|
esFilters,
|
||||||
|
esKuery,
|
||||||
|
esQuery,
|
||||||
|
// field formats
|
||||||
|
BoolFormat,
|
||||||
|
BytesFormat,
|
||||||
|
ColorFormat,
|
||||||
|
DateFormat,
|
||||||
|
DateNanosFormat,
|
||||||
|
DEFAULT_CONVERTER_COLOR,
|
||||||
|
DurationFormat,
|
||||||
|
FieldFormat,
|
||||||
|
getHighlightRequest, // only used in search source
|
||||||
|
IpFormat,
|
||||||
|
NumberFormat,
|
||||||
|
PercentFormat,
|
||||||
|
RelativeDateFormat,
|
||||||
|
SourceFormat,
|
||||||
|
StaticLookupFormat,
|
||||||
|
StringFormat,
|
||||||
|
TEXT_CONTEXT_TYPE, // only used in agg_types
|
||||||
|
TruncateFormat,
|
||||||
|
UrlFormat,
|
||||||
|
// index patterns
|
||||||
|
isFilterable,
|
||||||
|
// kbn field types
|
||||||
|
castEsToKbnFieldTypeName,
|
||||||
|
getKbnFieldType,
|
||||||
|
getKbnTypeNames,
|
||||||
|
} from '../common';
|
||||||
|
|
||||||
// Export plugin after all other imports
|
// Export plugin after all other imports
|
||||||
import { DataPublicPlugin } from './plugin';
|
import { DataPublicPlugin } from './plugin';
|
||||||
|
|
|
@ -30,7 +30,7 @@ import {
|
||||||
} from '@elastic/eui';
|
} from '@elastic/eui';
|
||||||
import { FormattedMessage } from '@kbn/i18n/react';
|
import { FormattedMessage } from '@kbn/i18n/react';
|
||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import { mapAndFlattenFilters, esFilters, utils, IIndexPattern } from '../..';
|
import { mapAndFlattenFilters, esFilters, IIndexPattern } from '../..';
|
||||||
import { FilterLabel } from '../filter_bar';
|
import { FilterLabel } from '../filter_bar';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
|
@ -56,7 +56,7 @@ export class ApplyFiltersPopoverContent extends Component<Props, State> {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
private getLabel(filter: esFilters.Filter) {
|
private getLabel(filter: esFilters.Filter) {
|
||||||
const valueLabel = utils.getDisplayValueFromFilter(filter, this.props.indexPatterns);
|
const valueLabel = esFilters.getDisplayValueFromFilter(filter, this.props.indexPatterns);
|
||||||
return <FilterLabel filter={filter} valueLabel={valueLabel} />;
|
return <FilterLabel filter={filter} valueLabel={valueLabel} />;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -48,7 +48,7 @@ import { Operator } from './lib/filter_operators';
|
||||||
import { PhraseValueInput } from './phrase_value_input';
|
import { PhraseValueInput } from './phrase_value_input';
|
||||||
import { PhrasesValuesInput } from './phrases_values_input';
|
import { PhrasesValuesInput } from './phrases_values_input';
|
||||||
import { RangeValueInput } from './range_value_input';
|
import { RangeValueInput } from './range_value_input';
|
||||||
import { esFilters, utils, IIndexPattern, IFieldType } from '../../..';
|
import { esFilters, IIndexPattern, IFieldType } from '../../..';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
filter: esFilters.Filter;
|
filter: esFilters.Filter;
|
||||||
|
@ -371,7 +371,7 @@ class FilterEditorUI extends Component<Props, State> {
|
||||||
}
|
}
|
||||||
|
|
||||||
private getIndexPatternFromFilter() {
|
private getIndexPatternFromFilter() {
|
||||||
return utils.getIndexPatternFromFilter(this.props.filter, this.props.indexPatterns);
|
return esFilters.getIndexPatternFromFilter(this.props.filter, this.props.indexPatterns);
|
||||||
}
|
}
|
||||||
|
|
||||||
private getFieldFromFilter() {
|
private getFieldFromFilter() {
|
||||||
|
|
|
@ -24,7 +24,7 @@ import React, { Component, MouseEvent } from 'react';
|
||||||
import { IUiSettingsClient } from 'src/core/public';
|
import { IUiSettingsClient } from 'src/core/public';
|
||||||
import { FilterEditor } from './filter_editor';
|
import { FilterEditor } from './filter_editor';
|
||||||
import { FilterView } from './filter_view';
|
import { FilterView } from './filter_view';
|
||||||
import { esFilters, utils, IIndexPattern } from '../..';
|
import { esFilters, IIndexPattern } from '../..';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
id: string;
|
id: string;
|
||||||
|
@ -67,7 +67,7 @@ class FilterItemUI extends Component<Props, State> {
|
||||||
this.props.className
|
this.props.className
|
||||||
);
|
);
|
||||||
|
|
||||||
const valueLabel = utils.getDisplayValueFromFilter(filter, this.props.indexPatterns);
|
const valueLabel = esFilters.getDisplayValueFromFilter(filter, this.props.indexPatterns);
|
||||||
const dataTestSubjKey = filter.meta.key ? `filter-key-${filter.meta.key}` : '';
|
const dataTestSubjKey = filter.meta.key ? `filter-key-${filter.meta.key}` : '';
|
||||||
const dataTestSubjValue = filter.meta.value ? `filter-value-${valueLabel}` : '';
|
const dataTestSubjValue = filter.meta.value ? `filter-value-${valueLabel}` : '';
|
||||||
const dataTestSubjDisabled = `filter-${
|
const dataTestSubjDisabled = `filter-${
|
||||||
|
|
|
@ -24,14 +24,70 @@ export function plugin(initializerContext: PluginInitializerContext) {
|
||||||
return new DataServerPlugin(initializerContext);
|
return new DataServerPlugin(initializerContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
export { DataServerPlugin as Plugin };
|
/**
|
||||||
|
* Types to be shared externally
|
||||||
|
* @public
|
||||||
|
*/
|
||||||
|
export { IRequestTypesMap, IResponseTypesMap } from './search';
|
||||||
|
export {
|
||||||
|
// field formats
|
||||||
|
FIELD_FORMAT_IDS,
|
||||||
|
IFieldFormat,
|
||||||
|
IFieldFormatId,
|
||||||
|
IFieldFormatType,
|
||||||
|
// index patterns
|
||||||
|
IIndexPattern,
|
||||||
|
IFieldType,
|
||||||
|
IFieldSubType,
|
||||||
|
// kbn field types
|
||||||
|
ES_FIELD_TYPES,
|
||||||
|
KBN_FIELD_TYPES,
|
||||||
|
// query
|
||||||
|
Query,
|
||||||
|
// timefilter
|
||||||
|
RefreshInterval,
|
||||||
|
TimeRange,
|
||||||
|
} from '../common';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Static code to be shared externally
|
||||||
|
* @public
|
||||||
|
*/
|
||||||
export {
|
export {
|
||||||
IndexPatternsFetcher,
|
IndexPatternsFetcher,
|
||||||
FieldDescriptor,
|
FieldDescriptor,
|
||||||
shouldReadFieldFromDocValues,
|
shouldReadFieldFromDocValues,
|
||||||
} from './index_patterns';
|
} from './index_patterns';
|
||||||
|
|
||||||
export * from './search';
|
export * from './search';
|
||||||
export * from '../common';
|
export {
|
||||||
|
// es query
|
||||||
|
esFilters,
|
||||||
|
esKuery,
|
||||||
|
esQuery,
|
||||||
|
// field formats
|
||||||
|
BoolFormat,
|
||||||
|
BytesFormat,
|
||||||
|
ColorFormat,
|
||||||
|
DateFormat,
|
||||||
|
DateNanosFormat,
|
||||||
|
DEFAULT_CONVERTER_COLOR,
|
||||||
|
DurationFormat,
|
||||||
|
FieldFormat,
|
||||||
|
IpFormat,
|
||||||
|
NumberFormat,
|
||||||
|
PercentFormat,
|
||||||
|
RelativeDateFormat,
|
||||||
|
SourceFormat,
|
||||||
|
StaticLookupFormat,
|
||||||
|
StringFormat,
|
||||||
|
TruncateFormat,
|
||||||
|
UrlFormat,
|
||||||
|
// index patterns
|
||||||
|
isFilterable,
|
||||||
|
// kbn field types
|
||||||
|
castEsToKbnFieldTypeName,
|
||||||
|
getKbnFieldType,
|
||||||
|
getKbnTypeNames,
|
||||||
|
} from '../common';
|
||||||
|
|
||||||
export { IRequestTypesMap, IResponseTypesMap } from './search';
|
export { DataServerPlugin as Plugin };
|
||||||
|
|
|
@ -22,7 +22,6 @@ import {
|
||||||
IIndexPattern,
|
IIndexPattern,
|
||||||
esFilters,
|
esFilters,
|
||||||
Query,
|
Query,
|
||||||
utils,
|
|
||||||
} from '../../../../../../../../../../src/plugins/data/public';
|
} from '../../../../../../../../../../src/plugins/data/public';
|
||||||
|
|
||||||
import { FilterLabel } from './filter_label';
|
import { FilterLabel } from './filter_label';
|
||||||
|
@ -126,7 +125,7 @@ const getDescriptionItem = (
|
||||||
<EuiBadgeWrap color="hollow">
|
<EuiBadgeWrap color="hollow">
|
||||||
<FilterLabel
|
<FilterLabel
|
||||||
filter={filter}
|
filter={filter}
|
||||||
valueLabel={utils.getDisplayValueFromFilter(filter, [indexPatterns])}
|
valueLabel={esFilters.getDisplayValueFromFilter(filter, [indexPatterns])}
|
||||||
/>
|
/>
|
||||||
</EuiBadgeWrap>
|
</EuiBadgeWrap>
|
||||||
</EuiFlexItem>
|
</EuiFlexItem>
|
||||||
|
|
Loading…
Reference in a new issue