diff --git a/src/legacy/core_plugins/data/public/index.ts b/src/legacy/core_plugins/data/public/index.ts index 8837c125e2ab2..7f745e1646284 100644 --- a/src/legacy/core_plugins/data/public/index.ts +++ b/src/legacy/core_plugins/data/public/index.ts @@ -37,7 +37,7 @@ export { IndexPatterns, StaticIndexPattern, } from './index_patterns'; -export { Query, QueryBar, QueryBarInput } from './query'; +export { Query, QueryBarInput } from './query'; export { SearchBar, SearchBarProps, SavedQueryAttributes, SavedQuery } from './search'; /** @public static code */ diff --git a/src/legacy/core_plugins/data/public/query/query_bar/components/index.ts b/src/legacy/core_plugins/data/public/query/query_bar/components/index.ts deleted file mode 100644 index 12b1f254895c3..0000000000000 --- a/src/legacy/core_plugins/data/public/query/query_bar/components/index.ts +++ /dev/null @@ -1,21 +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 { QueryBar } from './query_bar'; -export { QueryBarInput } from './query_bar_input'; diff --git a/src/legacy/core_plugins/data/public/query/query_bar/components/query_bar.test.mocks.tsx b/src/legacy/core_plugins/data/public/query/query_bar/components/query_bar_top_row.test.mocks.tsx similarity index 100% rename from src/legacy/core_plugins/data/public/query/query_bar/components/query_bar.test.mocks.tsx rename to src/legacy/core_plugins/data/public/query/query_bar/components/query_bar_top_row.test.mocks.tsx diff --git a/src/legacy/core_plugins/data/public/query/query_bar/components/query_bar.test.tsx b/src/legacy/core_plugins/data/public/query/query_bar/components/query_bar_top_row.test.tsx similarity index 94% rename from src/legacy/core_plugins/data/public/query/query_bar/components/query_bar.test.tsx rename to src/legacy/core_plugins/data/public/query/query_bar/components/query_bar_top_row.test.tsx index 18733737c6c54..cab3c06781390 100644 --- a/src/legacy/core_plugins/data/public/query/query_bar/components/query_bar.test.tsx +++ b/src/legacy/core_plugins/data/public/query/query_bar/components/query_bar_top_row.test.tsx @@ -21,8 +21,8 @@ import { mockPersistedLogFactory } from './query_bar_input.test.mocks'; import React from 'react'; import { shallowWithIntl } from 'test_utils/enzyme_helpers'; -import './query_bar.test.mocks'; -import { QueryBar } from './query_bar'; +import './query_bar_top_row.test.mocks'; +import { QueryBarTopRow } from './query_bar_top_row'; import { IndexPattern } from '../../../index'; import { coreMock } from '../../../../../../../core/public/mocks'; @@ -88,7 +88,7 @@ const mockIndexPattern = { ], } as IndexPattern; -describe('QueryBar', () => { +describe('QueryBarTopRowTopRow', () => { const QUERY_INPUT_SELECTOR = 'InjectIntl(QueryBarInputUI)'; const TIMEPICKER_SELECTOR = 'EuiSuperDatePicker'; beforeEach(() => { @@ -97,7 +97,7 @@ describe('QueryBar', () => { it('Should render the given query', () => { const component = shallowWithIntl( - { it('Should create a unique PersistedLog based on the appName and query language', () => { shallowWithIntl( - { it('Should render only timepicker when no options provided', () => { const component = shallowWithIntl( - { it('Should not show timepicker when asked', () => { const component = shallowWithIntl( - { it('Should render timepicker with options', () => { const component = shallowWithIntl( - { it('Should render only query input bar', () => { const component = shallowWithIntl( - { it('Should NOT render query input bar if disabled', () => { const component = shallowWithIntl( - { it('Should NOT render query input bar if missing options', () => { const component = shallowWithIntl( - { +export class QueryBarTopRowUI extends Component { public static defaultProps = { showQueryInput: true, showDatePicker: true, @@ -354,4 +354,4 @@ export class QueryBarUI extends Component { } // @ts-ignore -export const QueryBar = injectI18n(QueryBarUI); +export const QueryBarTopRow = injectI18n(QueryBarTopRowUI); diff --git a/src/legacy/core_plugins/data/public/query/query_bar/index.ts b/src/legacy/core_plugins/data/public/query/query_bar/index.ts index 59cb739345138..ece45c5bbd5da 100644 --- a/src/legacy/core_plugins/data/public/query/query_bar/index.ts +++ b/src/legacy/core_plugins/data/public/query/query_bar/index.ts @@ -17,7 +17,9 @@ * under the License. */ -export { QueryBar, QueryBarInput } from './components'; +export { QueryBarTopRow } from './components/query_bar_top_row'; +export { QueryBarInput } from './components/query_bar_input'; + export { fromUser } from './lib/from_user'; export { toUser } from './lib/to_user'; export { getQueryLog } from './lib/get_query_log'; diff --git a/src/legacy/core_plugins/data/public/query/query_service.ts b/src/legacy/core_plugins/data/public/query/query_service.ts index 114d8fdfd3878..f6f229496f49d 100644 --- a/src/legacy/core_plugins/data/public/query/query_service.ts +++ b/src/legacy/core_plugins/data/public/query/query_service.ts @@ -47,4 +47,4 @@ export class QueryService { /** @public */ export type QuerySetup = ReturnType; -export { Query, QueryBar, QueryBarInput } from './query_bar'; +export * from './query_bar'; diff --git a/src/legacy/core_plugins/data/public/search/search_bar/components/search_bar.test.tsx b/src/legacy/core_plugins/data/public/search/search_bar/components/search_bar.test.tsx index 373cd7239dc02..342388740a99c 100644 --- a/src/legacy/core_plugins/data/public/search/search_bar/components/search_bar.test.tsx +++ b/src/legacy/core_plugins/data/public/search/search_bar/components/search_bar.test.tsx @@ -28,7 +28,13 @@ const startMock = coreMock.createStart(); jest.mock('../../../../../data/public', () => { return { FilterBar: () =>
, - QueryBar: () =>
, + QueryBarInput: () =>
, + }; +}); + +jest.mock('../../../query/query_bar', () => { + return { + QueryBarTopRow: () =>
, }; }); diff --git a/src/legacy/core_plugins/data/public/search/search_bar/components/search_bar.tsx b/src/legacy/core_plugins/data/public/search/search_bar/components/search_bar.tsx index d3fcbde47e04f..b41200e7a2f39 100644 --- a/src/legacy/core_plugins/data/public/search/search_bar/components/search_bar.tsx +++ b/src/legacy/core_plugins/data/public/search/search_bar/components/search_bar.tsx @@ -27,7 +27,8 @@ import { get, isEqual } from 'lodash'; import { toastNotifications } from 'ui/notify'; import { UiSettingsClientContract, SavedObjectsClientContract } from 'src/core/public'; -import { IndexPattern, Query, QueryBar, FilterBar } from '../../../../../data/public'; +import { IndexPattern, Query, FilterBar } from '../../../../../data/public'; +import { QueryBarTopRow } from '../../../query'; import { SavedQuery, SavedQueryAttributes } from '../index'; import { SavedQueryMeta, SaveQueryForm } from './saved_query_management/save_query_form'; import { SavedQueryManagementComponent } from './saved_query_management/saved_query_management_component'; @@ -366,7 +367,7 @@ class SearchBarUI extends Component { let queryBar; if (this.shouldRenderQueryBar()) { queryBar = ( -