From 0a69ce18a6b82a1e041c99c2d467f78b2631d6cb Mon Sep 17 00:00:00 2001 From: Liza Katz Date: Tue, 3 Dec 2019 16:20:48 +0200 Subject: [PATCH] =?UTF-8?q?Move=20QueryStringInput=20=20=E2=87=92=20NP=20(?= =?UTF-8?q?#51873)=20(#52063)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Move query string input and query bar top row to NP * Fix query string input imports * import * Remove duplicate implementation of getFromSavedObject * import getFromSavedObject * Fixed import * code review * Remove css color --- .../core_plugins/data/public/index.scss | 4 +--- src/legacy/core_plugins/data/public/index.ts | 1 - .../core_plugins/data/public/query/index.ts | 20 ------------------- .../data/public/query/query_bar/_index.scss | 4 ---- .../search_bar/components/search_bar.test.tsx | 11 ---------- .../search_bar/components/search_bar.tsx | 7 +++---- .../public/components/query_bar_wrapper.js | 2 +- .../vis/editors/default/controls/filter.tsx | 3 +-- src/plugins/data/public/_index.scss | 1 + .../data/public/index_patterns/index.ts | 3 ++- .../lib/get_from_saved_object.ts} | 15 ++++++++++++-- .../data/public/index_patterns/lib/index.ts | 1 + .../data/public/index_patterns/utils.ts | 14 +------------ src/plugins/data/public/ui/_index.scss | 2 ++ src/plugins/data/public/ui/index.ts | 4 +++- .../query_string_input.test.tsx.snap | 0 .../public/ui/query_string_input}/_index.scss | 0 .../ui/query_string_input}/_query_bar.scss | 0 .../fetch_index_patterns.ts | 4 ++-- .../query_bar_top_row.test.tsx | 8 ++------ .../query_string_input}/query_bar_top_row.tsx | 4 ++-- .../query_string_input.test.mocks.ts | 8 ++------ .../query_string_input.test.tsx | 9 +++------ .../query_string_input.tsx | 10 +++------- .../data/public/ui/typeahead/_index.scss | 2 +- .../data/public/ui/typeahead/_suggestion.scss | 2 +- .../public/components/search_bar.test.tsx | 13 ++++++------ .../graph/public/components/search_bar.tsx | 12 ++++++----- 28 files changed, 59 insertions(+), 105 deletions(-) delete mode 100644 src/legacy/core_plugins/data/public/query/index.ts delete mode 100644 src/legacy/core_plugins/data/public/query/query_bar/_index.scss create mode 100644 src/plugins/data/public/_index.scss rename src/{legacy/core_plugins/data/public/query/query_bar/index.ts => plugins/data/public/index_patterns/lib/get_from_saved_object.ts} (72%) rename src/{legacy/core_plugins/data/public/query/query_bar/components => plugins/data/public/ui/query_string_input}/__snapshots__/query_string_input.test.tsx.snap (100%) rename src/{legacy/core_plugins/data/public/query/query_bar/components => plugins/data/public/ui/query_string_input}/_index.scss (100%) rename src/{legacy/core_plugins/data/public/query/query_bar/components => plugins/data/public/ui/query_string_input}/_query_bar.scss (100%) rename src/{legacy/core_plugins/data/public/query/query_bar/components => plugins/data/public/ui/query_string_input}/fetch_index_patterns.ts (94%) rename src/{legacy/core_plugins/data/public/query/query_bar/components => plugins/data/public/ui/query_string_input}/query_bar_top_row.test.tsx (96%) rename src/{legacy/core_plugins/data/public/query/query_bar/components => plugins/data/public/ui/query_string_input}/query_bar_top_row.tsx (98%) rename src/{legacy/core_plugins/data/public/query/query_bar/components => plugins/data/public/ui/query_string_input}/query_string_input.test.mocks.ts (84%) rename src/{legacy/core_plugins/data/public/query/query_bar/components => plugins/data/public/ui/query_string_input}/query_string_input.test.tsx (95%) rename src/{legacy/core_plugins/data/public/query/query_bar/components => plugins/data/public/ui/query_string_input}/query_string_input.tsx (98%) diff --git a/src/legacy/core_plugins/data/public/index.scss b/src/legacy/core_plugins/data/public/index.scss index 78673525a5483..22877e217279f 100644 --- a/src/legacy/core_plugins/data/public/index.scss +++ b/src/legacy/core_plugins/data/public/index.scss @@ -1,5 +1,3 @@ @import 'src/legacy/ui/public/styles/styling_constants'; -@import './query/query_bar/index'; - -@import '../../../../plugins/data/public/ui/index' \ No newline at end of file +@import '../../../../plugins/data/public/index' diff --git a/src/legacy/core_plugins/data/public/index.ts b/src/legacy/core_plugins/data/public/index.ts index 4cefff8a6e2fc..9fdc41dfd58e5 100644 --- a/src/legacy/core_plugins/data/public/index.ts +++ b/src/legacy/core_plugins/data/public/index.ts @@ -36,7 +36,6 @@ export { IndexPattern, IndexPatterns, } from './index_patterns'; -export { QueryStringInput } from './query'; export { SearchBar, SearchBarProps } from './search'; export { SavedQueryAttributes, diff --git a/src/legacy/core_plugins/data/public/query/index.ts b/src/legacy/core_plugins/data/public/query/index.ts deleted file mode 100644 index c12133196046c..0000000000000 --- a/src/legacy/core_plugins/data/public/query/index.ts +++ /dev/null @@ -1,20 +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 './query_bar'; diff --git a/src/legacy/core_plugins/data/public/query/query_bar/_index.scss b/src/legacy/core_plugins/data/public/query/query_bar/_index.scss deleted file mode 100644 index b6634debbfa96..0000000000000 --- a/src/legacy/core_plugins/data/public/query/query_bar/_index.scss +++ /dev/null @@ -1,4 +0,0 @@ -// SASSTODO: Formalize this color in Kibana's styling constants -$typeaheadConjunctionColor: #7800A6; - -@import './components/index'; 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 b4fd3f4578544..5752d6a502225 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 @@ -38,17 +38,6 @@ const mockTimeHistory = { jest.mock('../../../../../../../plugins/data/public', () => { return { FilterBar: () =>
, - }; -}); - -jest.mock('../../../../../data/public', () => { - return { - QueryStringInput: () =>
, - }; -}); - -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 b24ea763ace75..f547fada4a3b1 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 @@ -24,9 +24,6 @@ import React, { Component } from 'react'; import ResizeObserver from 'resize-observer-polyfill'; import { get, isEqual } from 'lodash'; -import { IndexPattern } from '../../../../../data/public'; -import { QueryBarTopRow } from '../../../query'; - import { withKibana, KibanaReactContextValue, @@ -36,6 +33,7 @@ import { TimeRange, Query, esFilters, + IIndexPattern, TimeHistoryContract, FilterBar, SavedQuery, @@ -43,6 +41,7 @@ import { SavedQueryMeta, SaveQueryForm, SavedQueryManagementComponent, + QueryBarTopRow, } from '../../../../../../../plugins/data/public'; interface SearchBarInjectedDeps { @@ -62,7 +61,7 @@ interface SearchBarInjectedDeps { } export interface SearchBarOwnProps { - indexPatterns?: IndexPattern[]; + indexPatterns?: IIndexPattern[]; isLoading?: boolean; customSubmitButton?: React.ReactNode; screenTitle?: string; diff --git a/src/legacy/core_plugins/vis_type_timeseries/public/components/query_bar_wrapper.js b/src/legacy/core_plugins/vis_type_timeseries/public/components/query_bar_wrapper.js index dc976beeca0d1..3d11744355738 100644 --- a/src/legacy/core_plugins/vis_type_timeseries/public/components/query_bar_wrapper.js +++ b/src/legacy/core_plugins/vis_type_timeseries/public/components/query_bar_wrapper.js @@ -19,7 +19,7 @@ import React, { useContext } from 'react'; import { CoreStartContext } from '../contexts/query_input_bar_context'; -import { QueryStringInput } from 'plugins/data'; +import { QueryStringInput } from '../../../../../plugins/data/public'; export function QueryBarWrapper(props) { const coreStartContext = useContext(CoreStartContext); diff --git a/src/legacy/ui/public/vis/editors/default/controls/filter.tsx b/src/legacy/ui/public/vis/editors/default/controls/filter.tsx index 664a0b3e02a00..4f700229831a6 100644 --- a/src/legacy/ui/public/vis/editors/default/controls/filter.tsx +++ b/src/legacy/ui/public/vis/editors/default/controls/filter.tsx @@ -20,10 +20,9 @@ import React, { useState } from 'react'; import { EuiForm, EuiButtonIcon, EuiFieldText, EuiFormRow, EuiSpacer } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { QueryStringInput } from 'plugins/data'; -import { Query } from 'src/plugins/data/public'; import { AggConfig } from '../../..'; import { npStart } from '../../../../new_platform'; +import { Query, QueryStringInput } from '../../../../../../../plugins/data/public'; import { Storage } from '../../../../../../../plugins/kibana_utils/public'; import { KibanaContextProvider } from '../../../../../../../plugins/kibana_react/public'; const localStorage = new Storage(window.localStorage); diff --git a/src/plugins/data/public/_index.scss b/src/plugins/data/public/_index.scss new file mode 100644 index 0000000000000..a51fde079f10b --- /dev/null +++ b/src/plugins/data/public/_index.scss @@ -0,0 +1 @@ +@import './ui/index'; diff --git a/src/plugins/data/public/index_patterns/index.ts b/src/plugins/data/public/index_patterns/index.ts index a22a8b8d85813..e6978e6d3957d 100644 --- a/src/plugins/data/public/index_patterns/index.ts +++ b/src/plugins/data/public/index_patterns/index.ts @@ -24,8 +24,9 @@ import { ILLEGAL_CHARACTERS, IndexPatternMissingIndices, validateIndexPattern, + getFromSavedObject, } from './lib'; -import { getRoutes, getFromSavedObject } from './utils'; +import { getRoutes } from './utils'; import { flattenHitWrapper, formatHitProvider } from './index_patterns'; export const indexPatterns = { diff --git a/src/legacy/core_plugins/data/public/query/query_bar/index.ts b/src/plugins/data/public/index_patterns/lib/get_from_saved_object.ts similarity index 72% rename from src/legacy/core_plugins/data/public/query/query_bar/index.ts rename to src/plugins/data/public/index_patterns/lib/get_from_saved_object.ts index 47b0ca5eae1bf..0faf6f4a10346 100644 --- a/src/legacy/core_plugins/data/public/query/query_bar/index.ts +++ b/src/plugins/data/public/index_patterns/lib/get_from_saved_object.ts @@ -17,5 +17,16 @@ * under the License. */ -export { QueryBarTopRow } from './components/query_bar_top_row'; -export { QueryStringInput } from './components/query_string_input'; +import { get } from 'lodash'; + +export function getFromSavedObject(savedObject: any) { + if (get(savedObject, 'attributes.fields') === undefined) { + return; + } + + return { + id: savedObject.id, + fields: JSON.parse(savedObject.attributes.fields), + title: savedObject.attributes.title, + }; +} diff --git a/src/plugins/data/public/index_patterns/lib/index.ts b/src/plugins/data/public/index_patterns/lib/index.ts index 626881b721c33..c878eb9115427 100644 --- a/src/plugins/data/public/index_patterns/lib/index.ts +++ b/src/plugins/data/public/index_patterns/lib/index.ts @@ -21,3 +21,4 @@ export { getTitle } from './get_title'; export * from './types'; export { validateIndexPattern } from './validate_index_pattern'; export { IndexPatternMissingIndices } from './errors'; +export { getFromSavedObject } from './get_from_saved_object'; diff --git a/src/plugins/data/public/index_patterns/utils.ts b/src/plugins/data/public/index_patterns/utils.ts index 8edb62f16bfeb..0ecc87f3080fd 100644 --- a/src/plugins/data/public/index_patterns/utils.ts +++ b/src/plugins/data/public/index_patterns/utils.ts @@ -17,7 +17,7 @@ * under the License. */ -import { find, get } from 'lodash'; +import { find } from 'lodash'; import { SavedObjectsClientContract, SimpleSavedObject } from 'src/core/public'; /** @@ -49,18 +49,6 @@ export async function findByTitle( ); } -export function getFromSavedObject(savedObject: any) { - if (get(savedObject, 'attributes.fields') === undefined) { - return; - } - - return { - id: savedObject.id, - fields: JSON.parse(savedObject.attributes.fields), - title: savedObject.attributes.title, - }; -} - export function getRoutes() { return { edit: '/management/kibana/index_patterns/{{id}}', diff --git a/src/plugins/data/public/ui/_index.scss b/src/plugins/data/public/ui/_index.scss index 1fc673d5450c2..39f29ac777588 100644 --- a/src/plugins/data/public/ui/_index.scss +++ b/src/plugins/data/public/ui/_index.scss @@ -4,3 +4,5 @@ @import './typeahead/index'; @import './saved_query_management/index'; + +@import './query_string_input/index'; diff --git a/src/plugins/data/public/ui/index.ts b/src/plugins/data/public/ui/index.ts index d549ceabde86d..9a4bccc21db3e 100644 --- a/src/plugins/data/public/ui/index.ts +++ b/src/plugins/data/public/ui/index.ts @@ -21,7 +21,9 @@ export { SuggestionsComponent } from './typeahead/suggestions_component'; export { IndexPatternSelect } from './index_pattern_select'; export { FilterBar } from './filter_bar'; export { applyFiltersPopover } from './apply_filters'; +export { QueryStringInput } from './query_string_input/query_string_input'; + // temp export - will be removed as final components are migrated to NP -export { QueryLanguageSwitcher } from './query_string_input/language_switcher'; +export { QueryBarTopRow } from './query_string_input/query_bar_top_row'; export { SavedQueryManagementComponent } from './saved_query_management'; export { SaveQueryForm, SavedQueryMeta } from './saved_query_form'; diff --git a/src/legacy/core_plugins/data/public/query/query_bar/components/__snapshots__/query_string_input.test.tsx.snap b/src/plugins/data/public/ui/query_string_input/__snapshots__/query_string_input.test.tsx.snap similarity index 100% rename from src/legacy/core_plugins/data/public/query/query_bar/components/__snapshots__/query_string_input.test.tsx.snap rename to src/plugins/data/public/ui/query_string_input/__snapshots__/query_string_input.test.tsx.snap diff --git a/src/legacy/core_plugins/data/public/query/query_bar/components/_index.scss b/src/plugins/data/public/ui/query_string_input/_index.scss similarity index 100% rename from src/legacy/core_plugins/data/public/query/query_bar/components/_index.scss rename to src/plugins/data/public/ui/query_string_input/_index.scss diff --git a/src/legacy/core_plugins/data/public/query/query_bar/components/_query_bar.scss b/src/plugins/data/public/ui/query_string_input/_query_bar.scss similarity index 100% rename from src/legacy/core_plugins/data/public/query/query_bar/components/_query_bar.scss rename to src/plugins/data/public/ui/query_string_input/_query_bar.scss diff --git a/src/legacy/core_plugins/data/public/query/query_bar/components/fetch_index_patterns.ts b/src/plugins/data/public/ui/query_string_input/fetch_index_patterns.ts similarity index 94% rename from src/legacy/core_plugins/data/public/query/query_bar/components/fetch_index_patterns.ts rename to src/plugins/data/public/ui/query_string_input/fetch_index_patterns.ts index 7a4c9f139c887..6bef11e4fc46c 100644 --- a/src/legacy/core_plugins/data/public/query/query_bar/components/fetch_index_patterns.ts +++ b/src/plugins/data/public/ui/query_string_input/fetch_index_patterns.ts @@ -18,7 +18,7 @@ */ import { isEmpty } from 'lodash'; import { IUiSettingsClient, SavedObjectsClientContract } from 'src/core/public'; -import { getFromSavedObject } from '../../../'; +import { indexPatterns } from '../..'; export async function fetchIndexPatterns( savedObjectsClient: SavedObjectsClientContract, @@ -48,5 +48,5 @@ export async function fetchIndexPatterns( ? exactMatches : [...exactMatches, await savedObjectsClient.get('index-pattern', defaultIndex)]; - return allMatches.map(getFromSavedObject); + return allMatches.map(indexPatterns.getFromSavedObject); } diff --git a/src/legacy/core_plugins/data/public/query/query_bar/components/query_bar_top_row.test.tsx b/src/plugins/data/public/ui/query_string_input/query_bar_top_row.test.tsx similarity index 96% rename from src/legacy/core_plugins/data/public/query/query_bar/components/query_bar_top_row.test.tsx rename to src/plugins/data/public/ui/query_string_input/query_bar_top_row.test.tsx index ea01347e38865..51f0abbd102cc 100644 --- a/src/legacy/core_plugins/data/public/query/query_bar/components/query_bar_top_row.test.tsx +++ b/src/plugins/data/public/ui/query_string_input/query_bar_top_row.test.tsx @@ -23,14 +23,10 @@ import React from 'react'; import { mount } from 'enzyme'; import { QueryBarTopRow } from './query_bar_top_row'; -/* eslint-disable @kbn/eslint/no-restricted-paths */ - -import { stubIndexPatternWithFields } from '../../../../../../../plugins/data/public/stubs'; -/* eslint-enable @kbn/eslint/no-restricted-paths */ - -import { coreMock } from '../../../../../../../core/public/mocks'; +import { coreMock } from '../../../../../core/public/mocks'; import { KibanaContextProvider } from 'src/plugins/kibana_react/public'; import { I18nProvider } from '@kbn/i18n/react'; +import { stubIndexPatternWithFields } from '../../stubs'; const startMock = coreMock.createStart(); const mockTimeHistory = { diff --git a/src/legacy/core_plugins/data/public/query/query_bar/components/query_bar_top_row.tsx b/src/plugins/data/public/ui/query_string_input/query_bar_top_row.tsx similarity index 98% rename from src/legacy/core_plugins/data/public/query/query_bar/components/query_bar_top_row.tsx rename to src/plugins/data/public/ui/query_string_input/query_bar_top_row.tsx index 824e8cf1e2a7c..aa32ebc9a56cc 100644 --- a/src/legacy/core_plugins/data/public/query/query_bar/components/query_bar_top_row.tsx +++ b/src/plugins/data/public/ui/query_string_input/query_bar_top_row.tsx @@ -41,8 +41,8 @@ import { PersistedLog, getQueryLog, esKuery, -} from '../../../../../../../plugins/data/public'; -import { useKibana, toMountPoint } from '../../../../../../../plugins/kibana_react/public'; +} from '../..'; +import { useKibana, toMountPoint } from '../../../../kibana_react/public'; import { QueryStringInput } from './query_string_input'; interface Props { diff --git a/src/legacy/core_plugins/data/public/query/query_bar/components/query_string_input.test.mocks.ts b/src/plugins/data/public/ui/query_string_input/query_string_input.test.mocks.ts similarity index 84% rename from src/legacy/core_plugins/data/public/query/query_bar/components/query_string_input.test.mocks.ts rename to src/plugins/data/public/ui/query_string_input/query_string_input.test.mocks.ts index 0c8d799653295..12222ee7ad267 100644 --- a/src/legacy/core_plugins/data/public/query/query_bar/components/query_string_input.test.mocks.ts +++ b/src/plugins/data/public/ui/query_string_input/query_string_input.test.mocks.ts @@ -16,11 +16,7 @@ * specific language governing permissions and limitations * under the License. */ - -/* eslint-disable @kbn/eslint/no-restricted-paths */ - -import { stubIndexPatternWithFields } from '../../../../../../../plugins/data/public/stubs'; -/* eslint-enable @kbn/eslint/no-restricted-paths */ +import { stubIndexPatternWithFields } from '../../stubs'; export const mockPersistedLog = { add: jest.fn(), @@ -35,7 +31,7 @@ export const mockFetchIndexPatterns = jest .fn() .mockReturnValue(Promise.resolve([stubIndexPatternWithFields])); -jest.mock('../../../../../../../plugins/data/public/query/persisted_log', () => ({ +jest.mock('../../query/persisted_log', () => ({ PersistedLog: mockPersistedLogFactory, })); diff --git a/src/legacy/core_plugins/data/public/query/query_bar/components/query_string_input.test.tsx b/src/plugins/data/public/ui/query_string_input/query_string_input.test.tsx similarity index 95% rename from src/legacy/core_plugins/data/public/query/query_bar/components/query_string_input.test.tsx rename to src/plugins/data/public/ui/query_string_input/query_string_input.test.tsx index 04347773ff293..3c98ee948c7d8 100644 --- a/src/legacy/core_plugins/data/public/query/query_bar/components/query_string_input.test.tsx +++ b/src/plugins/data/public/ui/query_string_input/query_string_input.test.tsx @@ -25,14 +25,11 @@ import { import { EuiFieldText } from '@elastic/eui'; import React from 'react'; -import { QueryLanguageSwitcher } from '../../../../../../../plugins/data/public'; +import { QueryLanguageSwitcher } from './language_switcher'; import { QueryStringInput, QueryStringInputUI } from './query_string_input'; -import { coreMock } from '../../../../../../../core/public/mocks'; +import { coreMock } from '../../../../../core/public/mocks'; const startMock = coreMock.createStart(); -/* eslint-disable @kbn/eslint/no-restricted-paths */ - -import { stubIndexPatternWithFields } from '../../../../../../../plugins/data/public/stubs'; -/* eslint-enable @kbn/eslint/no-restricted-paths */ +import { stubIndexPatternWithFields } from '../../stubs'; import { KibanaContextProvider } from 'src/plugins/kibana_react/public'; import { I18nProvider } from '@kbn/i18n/react'; diff --git a/src/legacy/core_plugins/data/public/query/query_bar/components/query_string_input.tsx b/src/plugins/data/public/ui/query_string_input/query_string_input.tsx similarity index 98% rename from src/legacy/core_plugins/data/public/query/query_bar/components/query_string_input.tsx rename to src/plugins/data/public/ui/query_string_input/query_string_input.tsx index c51bfb705c9f0..dcc07f4fd43c5 100644 --- a/src/legacy/core_plugins/data/public/query/query_bar/components/query_string_input.tsx +++ b/src/plugins/data/public/ui/query_string_input/query_string_input.tsx @@ -46,14 +46,10 @@ import { matchPairs, getQueryLog, Query, - QueryLanguageSwitcher, -} from '../../../../../../../plugins/data/public'; -import { - withKibana, - KibanaReactContextValue, - toMountPoint, -} from '../../../../../../../plugins/kibana_react/public'; +} from '../..'; +import { withKibana, KibanaReactContextValue, toMountPoint } from '../../../../kibana_react/public'; import { fetchIndexPatterns } from './fetch_index_patterns'; +import { QueryLanguageSwitcher } from './language_switcher'; interface Props { kibana: KibanaReactContextValue; diff --git a/src/plugins/data/public/ui/typeahead/_index.scss b/src/plugins/data/public/ui/typeahead/_index.scss index 8ff2965158ad9..c0ba5f05f589c 100644 --- a/src/plugins/data/public/ui/typeahead/_index.scss +++ b/src/plugins/data/public/ui/typeahead/_index.scss @@ -1 +1 @@ -@import 'suggestion'; \ No newline at end of file +@import 'suggestion'; diff --git a/src/plugins/data/public/ui/typeahead/_suggestion.scss b/src/plugins/data/public/ui/typeahead/_suggestion.scss index e1daf118d9706..3a215ceddcd00 100644 --- a/src/plugins/data/public/ui/typeahead/_suggestion.scss +++ b/src/plugins/data/public/ui/typeahead/_suggestion.scss @@ -3,7 +3,7 @@ $kbnTypeaheadTypes: ( field: $euiColorWarning, value: $euiColorSecondary, operator: $euiColorPrimary, - conjunction: $typeaheadConjunctionColor, + conjunction: $euiColorVis3, ); .kbnTypeahead { diff --git a/x-pack/legacy/plugins/graph/public/components/search_bar.test.tsx b/x-pack/legacy/plugins/graph/public/components/search_bar.test.tsx index a91e91258e240..a0514576877d1 100644 --- a/x-pack/legacy/plugins/graph/public/components/search_bar.test.tsx +++ b/x-pack/legacy/plugins/graph/public/components/search_bar.test.tsx @@ -9,13 +9,12 @@ import { SearchBar, OuterSearchBarProps } from './search_bar'; import React, { ReactElement } from 'react'; import { CoreStart } from 'src/core/public'; import { act } from 'react-dom/test-utils'; -import { QueryStringInput, IndexPattern } from 'src/legacy/core_plugins/data/public'; +import { IndexPattern } from 'src/legacy/core_plugins/data/public'; +import { QueryStringInput } from '../../../../../../src/plugins/data/public'; import { KibanaContextProvider } from '../../../../../../src/plugins/kibana_react/public'; import { I18nProvider } from '@kbn/i18n/react'; -jest.mock('ui/new_platform'); - import { openSourceModal } from '../services/source_modal'; import { GraphStore, setDatasource } from '../state_management'; @@ -24,9 +23,6 @@ import { createMockGraphStore } from '../state_management/mocks'; import { Provider } from 'react-redux'; jest.mock('../services/source_modal', () => ({ openSourceModal: jest.fn() })); -jest.mock('../../../../../../src/legacy/core_plugins/data/public', () => ({ - QueryStringInput: () => null, -})); const waitForIndexPatternFetch = () => new Promise(r => setTimeout(r)); @@ -51,6 +47,11 @@ function wrapSearchBarInContext(testProps: OuterSearchBarProps) { storage: { get: () => {}, }, + data: { + query: { + savedQueries: {}, + }, + }, }; return ( diff --git a/x-pack/legacy/plugins/graph/public/components/search_bar.tsx b/x-pack/legacy/plugins/graph/public/components/search_bar.tsx index 79ffad26cf981..c637b6ba2b1d9 100644 --- a/x-pack/legacy/plugins/graph/public/components/search_bar.tsx +++ b/x-pack/legacy/plugins/graph/public/components/search_bar.tsx @@ -10,10 +10,7 @@ import React, { useState, useEffect } from 'react'; import { i18n } from '@kbn/i18n'; import { connect } from 'react-redux'; import { IndexPatternSavedObject, IndexPatternProvider } from '../types'; -import { - QueryStringInput, - IndexPattern, -} from '../../../../../../src/legacy/core_plugins/data/public'; +import { IndexPattern } from '../../../../../../src/legacy/core_plugins/data/public'; import { openSourceModal } from '../services/source_modal'; import { GraphState, @@ -23,7 +20,12 @@ import { } from '../state_management'; import { useKibana } from '../../../../../../src/plugins/kibana_react/public'; -import { IDataPluginServices, Query, esKuery } from '../../../../../../src/plugins/data/public'; +import { + QueryStringInput, + IDataPluginServices, + Query, + esKuery, +} from '../../../../../../src/plugins/data/public'; export interface OuterSearchBarProps { isLoading: boolean;