Skip to content

Commit

Permalink
Merge fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Liza K committed Feb 12, 2020
2 parents 03f5a90 + e1685ec commit d1a3d25
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 28 deletions.
28 changes: 21 additions & 7 deletions src/plugins/data/public/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,22 @@ export const esFilters = {
extractTimeFilter,
};

export {
RangeFilter,
RangeFilterMeta,
RangeFilterParams,
ExistsFilter,
PhrasesFilter,
PhraseFilter,
CustomFilter,
MatchAllFilter,
} from '../common';

/*
* esQuery and esKuery:
*/

import {
doesKueryExpressionHaveLuceneSyntaxError,
fromKueryExpression,
toElasticsearchQuery,
nodeTypes,
Expand All @@ -116,7 +126,6 @@ import {

export const esKuery = {
nodeTypes,
doesKueryExpressionHaveLuceneSyntaxError,
fromKueryExpression,
toElasticsearchQuery,
};
Expand Down Expand Up @@ -226,7 +235,7 @@ export const indexPatterns = {
validate: validateIndexPattern,
getFromSavedObject,
flattenHitWrapper,
// exported only in stub_index_pattern test. Move into data plugin and remove export.
// TODO: exported only in stub_index_pattern test. Move into data plugin and remove export.
getRoutes,
formatHitProvider,
};
Expand All @@ -237,7 +246,7 @@ export {
Field as IndexPatternField,
TypeMeta as IndexPatternTypeMeta,
AggregationRestrictions as IndexPatternAggRestrictions,
// exported only in stub_index_pattern test. Move into data plugin and remove export.
// TODO: exported only in stub_index_pattern test. Move into data plugin and remove export.
FieldList as IndexPatternFieldList,
} from './index_patterns';

Expand All @@ -262,14 +271,19 @@ export {
QuerySuggestionField,
} from './autocomplete';

/*
* Search:
*/

export { IRequestTypesMap, IResponseTypesMap } from './search';
export * from './search';

/**
* Types to be shared externally
* @public
*/
export { Filter, Query, RefreshInterval, TimeRange } from '../common';

export { IRequestTypesMap, IResponseTypesMap } from './search';
export * from './search';
export {
createSavedQueryService,
syncAppFilters,
Expand All @@ -289,10 +303,10 @@ export {
TimeHistoryContract,
} from './query';
export * from './ui';

export {
// kbn field types
castEsToKbnFieldTypeName,
getKbnFieldType,
getKbnTypeNames,
// utils
parseInterval,
Expand Down
16 changes: 9 additions & 7 deletions src/plugins/data/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,21 +145,21 @@ export {
KBN_FIELD_TYPES,
} from '../common';

export function plugin(initializerContext: PluginInitializerContext) {
return new DataServerPlugin(initializerContext);
}
/**
* Search
*/

export { IRequestTypesMap, IResponseTypesMap } from './search';
export * from './search';

/**
* Types to be shared externally
* @public
*/
export { IRequestTypesMap, IResponseTypesMap } from './search';

export {
// kbn field types
castEsToKbnFieldTypeName,
getKbnFieldType,
getKbnTypeNames,
// query
Filter,
Query,
Expand All @@ -175,7 +175,9 @@ export {
* @public
*/

export * from './search';
export function plugin(initializerContext: PluginInitializerContext) {
return new DataServerPlugin(initializerContext);
}

export {
DataServerPlugin as Plugin,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import sinon from 'sinon';
import * as shouldReadFieldFromDocValuesNS from './should_read_field_from_doc_values';
import { shouldReadFieldFromDocValues } from './should_read_field_from_doc_values';

import { getKbnFieldType } from '../../../../../../data/server';
import { getKbnFieldType } from '../../../../../common';
import { readFieldCapsResponse } from './field_caps_response';
import esResponse from './__fixtures__/es_field_caps_response.json';

Expand Down
4 changes: 2 additions & 2 deletions src/plugins/expressions/common/execution/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import { ExpressionType } from '../expression_types';
import { DataAdapter, RequestAdapter } from '../../../inspector/common';
import { TimeRange, Query, esFilters } from '../../../data/common';
import { TimeRange, Query, Filter } from '../../../data/common';

/**
* `ExecutionContext` is an object available to all functions during a single execution;
Expand Down Expand Up @@ -66,7 +66,7 @@ export interface DefaultInspectorAdapters {
}

export interface ExecutionContextSearch {
filters?: esFilters.Filter[];
filters?: Filter[];
query?: Query | Query[];
timeRange?: TimeRange;
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,7 @@ import {
ApplicationStart,
HttpStart,
} from 'src/core/public';
import {
IndexPatternsContract,
FieldFormatsStart,
DataPublicPluginStart,
} from 'src/plugins/data/public';
import { IndexPatternsContract, DataPublicPluginStart } from 'src/plugins/data/public';
import {
DocLinksStart,
ToastsStart,
Expand All @@ -34,7 +30,7 @@ export interface DependencyCache {
toastNotifications: ToastsStart | null;
overlays: OverlayStart | null;
recentlyAccessed: ChromeRecentlyAccessed | null;
fieldFormats: FieldFormatsStart | null;
fieldFormats: DataPublicPluginStart['fieldFormats'] | null;
autocomplete: DataPublicPluginStart['autocomplete'] | null;
basePath: IBasePath | null;
savedObjectsClient: SavedObjectsClientContract | null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

import { getHostDetailsEventsKqlQueryExpression, getHostDetailsPageFilters } from './helpers';
import { esFilters } from '../../../../../../../../src/plugins/data/common/es_query';
import { Filter } from '../../../../../../../../src/plugins/data/common/es_query';

describe('hosts page helpers', () => {
describe('getHostDetailsEventsKqlQueryExpression', () => {
Expand Down Expand Up @@ -39,7 +39,7 @@ describe('hosts page helpers', () => {

describe('getHostDetailsPageFilters', () => {
it('correctly constructs pageFilters for the given hostName', () => {
const expected: esFilters.Filter[] = [
const expected: Filter[] = [
{
meta: {
alias: null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

import { escapeQueryValue } from '../../../lib/keury';
import { esFilters } from '../../../../../../../../src/plugins/data/common/es_query';
import { Filter } from '../../../../../../../../src/plugins/data/public';

/** Returns the kqlQueryExpression for the `Events` widget on the `Host Details` page */
export const getHostDetailsEventsKqlQueryExpression = ({
Expand All @@ -24,7 +24,7 @@ export const getHostDetailsEventsKqlQueryExpression = ({
}
};

export const getHostDetailsPageFilters = (hostName: string): esFilters.Filter[] => [
export const getHostDetailsPageFilters = (hostName: string): Filter[] => [
{
meta: {
alias: null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export interface QueryTabBodyProps {
export type HostsComponentsQueryProps = QueryTabBodyProps & {
deleteQuery?: ({ id }: { id: string }) => void;
indexPattern: IIndexPattern;
pageFilters?: esFilters.Filter[];
pageFilters?: Filter[];
skip: boolean;
setQuery: SetQuery;
updateDateRange?: UpdateDateRange;
Expand Down

0 comments on commit d1a3d25

Please sign in to comment.