Restored an empty service for Saved Queries to use
This commit is contained in:
parent
2c8efa49ac
commit
27a04dcb46
|
@ -39,6 +39,7 @@ export {
|
||||||
} from './index_patterns';
|
} from './index_patterns';
|
||||||
export { Query, QueryBar, QueryBarInput } from './query';
|
export { Query, QueryBar, QueryBarInput } from './query';
|
||||||
export { FilterBar, ApplyFiltersPopover } from './filter';
|
export { FilterBar, ApplyFiltersPopover } from './filter';
|
||||||
|
export { SearchBar, SearchBarProps } from './search';
|
||||||
export {
|
export {
|
||||||
FilterManager,
|
FilterManager,
|
||||||
FilterStateManager,
|
FilterStateManager,
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
|
|
||||||
import { CoreSetup, CoreStart, Plugin } from '../../../../core/public';
|
import { CoreSetup, CoreStart, Plugin } from '../../../../core/public';
|
||||||
import { ExpressionsService, ExpressionsSetup } from './expressions';
|
import { ExpressionsService, ExpressionsSetup } from './expressions';
|
||||||
|
import { SearchService, SearchSetup } from './search';
|
||||||
import { QueryService, QuerySetup } from './query';
|
import { QueryService, QuerySetup } from './query';
|
||||||
import { FilterService, FilterSetup } from './filter';
|
import { FilterService, FilterSetup } from './filter';
|
||||||
import { IndexPatternsService, IndexPatternsSetup } from './index_patterns';
|
import { IndexPatternsService, IndexPatternsSetup } from './index_patterns';
|
||||||
|
@ -44,6 +45,7 @@ export interface DataSetup {
|
||||||
indexPatterns: IndexPatternsSetup;
|
indexPatterns: IndexPatternsSetup;
|
||||||
filter: FilterSetup;
|
filter: FilterSetup;
|
||||||
query: QuerySetup;
|
query: QuerySetup;
|
||||||
|
search: SearchSetup;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -63,6 +65,7 @@ export class DataPlugin implements Plugin<DataSetup, void, DataPluginSetupDepend
|
||||||
private readonly filter: FilterService = new FilterService();
|
private readonly filter: FilterService = new FilterService();
|
||||||
private readonly indexPatterns: IndexPatternsService = new IndexPatternsService();
|
private readonly indexPatterns: IndexPatternsService = new IndexPatternsService();
|
||||||
private readonly query: QueryService = new QueryService();
|
private readonly query: QueryService = new QueryService();
|
||||||
|
private readonly search: SearchService = new SearchService();
|
||||||
|
|
||||||
public setup(core: CoreSetup, { __LEGACY, interpreter }: DataPluginSetupDependencies): DataSetup {
|
public setup(core: CoreSetup, { __LEGACY, interpreter }: DataPluginSetupDependencies): DataSetup {
|
||||||
const indexPatternsService = this.indexPatterns.setup();
|
const indexPatternsService = this.indexPatterns.setup();
|
||||||
|
@ -75,6 +78,7 @@ export class DataPlugin implements Plugin<DataSetup, void, DataPluginSetupDepend
|
||||||
indexPatterns: indexPatternsService.indexPatterns,
|
indexPatterns: indexPatternsService.indexPatterns,
|
||||||
}),
|
}),
|
||||||
query: this.query.setup(),
|
query: this.query.setup(),
|
||||||
|
search: this.search.setup(),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -85,5 +89,6 @@ export class DataPlugin implements Plugin<DataSetup, void, DataPluginSetupDepend
|
||||||
this.indexPatterns.stop();
|
this.indexPatterns.stop();
|
||||||
this.filter.stop();
|
this.filter.stop();
|
||||||
this.query.stop();
|
this.query.stop();
|
||||||
|
this.search.stop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
22
src/legacy/core_plugins/data/public/search/index.ts
Normal file
22
src/legacy/core_plugins/data/public/search/index.ts
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
/*
|
||||||
|
* 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 { SearchService, SearchSetup } from './search_service';
|
||||||
|
|
||||||
|
export * from './search_bar';
|
|
@ -21,7 +21,7 @@ import React from 'react';
|
||||||
import { mountWithIntl } from 'test_utils/enzyme_helpers';
|
import { mountWithIntl } from 'test_utils/enzyme_helpers';
|
||||||
import { SearchBar } from './search_bar';
|
import { SearchBar } from './search_bar';
|
||||||
|
|
||||||
jest.mock('../../../../data/public', () => {
|
jest.mock('../../../../../data/public', () => {
|
||||||
return {
|
return {
|
||||||
FilterBar: () => <div className="filterBar"></div>,
|
FilterBar: () => <div className="filterBar"></div>,
|
||||||
QueryBar: () => <div className="queryBar"></div>,
|
QueryBar: () => <div className="queryBar"></div>,
|
|
@ -27,7 +27,7 @@ import React, { Component } from 'react';
|
||||||
import ResizeObserver from 'resize-observer-polyfill';
|
import ResizeObserver from 'resize-observer-polyfill';
|
||||||
import { Storage } from 'ui/storage';
|
import { Storage } from 'ui/storage';
|
||||||
|
|
||||||
import { IndexPattern, Query, QueryBar, FilterBar } from '../../../../data/public';
|
import { IndexPattern, Query, QueryBar, FilterBar } from '../../../../../data/public';
|
||||||
|
|
||||||
interface DateRange {
|
interface DateRange {
|
||||||
from: string;
|
from: string;
|
||||||
|
@ -111,7 +111,7 @@ class SearchBarUI extends Component<SearchBarProps, State> {
|
||||||
const filterCount = this.getFilterLength();
|
const filterCount = this.getFilterLength();
|
||||||
const filtersAppliedText = this.props.intl.formatMessage(
|
const filtersAppliedText = this.props.intl.formatMessage(
|
||||||
{
|
{
|
||||||
id: 'kibana_react.search.searchBar.filtersButtonFiltersAppliedTitle',
|
id: 'data.search.searchBar.searchBar.filtersButtonFiltersAppliedTitle',
|
||||||
defaultMessage:
|
defaultMessage:
|
||||||
'{filterCount} {filterCount, plural, one {filter} other {filters}} applied.',
|
'{filterCount} {filterCount, plural, one {filter} other {filters}} applied.',
|
||||||
},
|
},
|
||||||
|
@ -121,11 +121,11 @@ class SearchBarUI extends Component<SearchBarProps, State> {
|
||||||
);
|
);
|
||||||
const clickToShowOrHideText = this.state.isFiltersVisible
|
const clickToShowOrHideText = this.state.isFiltersVisible
|
||||||
? this.props.intl.formatMessage({
|
? this.props.intl.formatMessage({
|
||||||
id: 'kibana_react.search.searchBar.filtersButtonClickToShowTitle',
|
id: 'data.search.searchBar.searchBar.filtersButtonClickToShowTitle',
|
||||||
defaultMessage: 'Select to hide',
|
defaultMessage: 'Select to hide',
|
||||||
})
|
})
|
||||||
: this.props.intl.formatMessage({
|
: this.props.intl.formatMessage({
|
||||||
id: 'kibana_react.search.searchBar.filtersButtonClickToHideTitle',
|
id: 'data.search.searchBar.searchBar.filtersButtonClickToHideTitle',
|
||||||
defaultMessage: 'Select to show',
|
defaultMessage: 'Select to show',
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -139,7 +139,7 @@ class SearchBarUI extends Component<SearchBarProps, State> {
|
||||||
aria-expanded={!!this.state.isFiltersVisible}
|
aria-expanded={!!this.state.isFiltersVisible}
|
||||||
title={`${filterCount ? filtersAppliedText : ''} ${clickToShowOrHideText}`}
|
title={`${filterCount ? filtersAppliedText : ''} ${clickToShowOrHideText}`}
|
||||||
>
|
>
|
||||||
{i18n.translate('kibana_react.search.searchBar.filtersButtonLabel', {
|
{i18n.translate('data.search.searchBar.searchBar.filtersButtonLabel', {
|
||||||
defaultMessage: 'Filters',
|
defaultMessage: 'Filters',
|
||||||
description: 'The noun "filter" in plural.',
|
description: 'The noun "filter" in plural.',
|
||||||
})}
|
})}
|
35
src/legacy/core_plugins/data/public/search/search_service.ts
Normal file
35
src/legacy/core_plugins/data/public/search/search_service.ts
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Search Service
|
||||||
|
* @internal
|
||||||
|
*/
|
||||||
|
|
||||||
|
export class SearchService {
|
||||||
|
public setup() {
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
|
public stop() {}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @public */
|
||||||
|
|
||||||
|
export type SearchSetup = ReturnType<SearchService['setup']>;
|
|
@ -24,4 +24,3 @@
|
||||||
|
|
||||||
/** @public types */
|
/** @public types */
|
||||||
export { TopNavMenu, TopNavMenuData } from './top_nav_menu';
|
export { TopNavMenu, TopNavMenuData } from './top_nav_menu';
|
||||||
export { SearchBar, SearchBarProps } from './search_bar';
|
|
||||||
|
|
|
@ -22,7 +22,7 @@ import { TopNavMenu } from './top_nav_menu';
|
||||||
import { TopNavMenuData } from './top_nav_menu_data';
|
import { TopNavMenuData } from './top_nav_menu_data';
|
||||||
import { shallowWithIntl } from 'test_utils/enzyme_helpers';
|
import { shallowWithIntl } from 'test_utils/enzyme_helpers';
|
||||||
|
|
||||||
jest.mock('../search_bar', () => {
|
jest.mock('../../../../core_plugins/data/public', () => {
|
||||||
return {
|
return {
|
||||||
SearchBar: () => <div className="searchBar"></div>,
|
SearchBar: () => <div className="searchBar"></div>,
|
||||||
SearchBarProps: {},
|
SearchBarProps: {},
|
||||||
|
|
|
@ -23,7 +23,7 @@ import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui';
|
||||||
import { I18nProvider } from '@kbn/i18n/react';
|
import { I18nProvider } from '@kbn/i18n/react';
|
||||||
import { TopNavMenuData } from './top_nav_menu_data';
|
import { TopNavMenuData } from './top_nav_menu_data';
|
||||||
import { TopNavMenuItem } from './top_nav_menu_item';
|
import { TopNavMenuItem } from './top_nav_menu_item';
|
||||||
import { SearchBar, SearchBarProps } from '../search_bar';
|
import { SearchBar, SearchBarProps } from '../../../../core_plugins/data/public';
|
||||||
|
|
||||||
type Props = Partial<SearchBarProps> & {
|
type Props = Partial<SearchBarProps> & {
|
||||||
name: string;
|
name: string;
|
||||||
|
|
|
@ -813,8 +813,8 @@
|
||||||
"data.query.queryBar.syntaxOptionsDescription": "{docsLink} (KQL) は、シンプルなクエリ構文とスクリプトフィールドのサポートを提供します。また、KQL はベーシックライセンス以上をご利用の場合、自動入力も提供します。KQL をオフにすると、Kibana は Lucene を使用します。",
|
"data.query.queryBar.syntaxOptionsDescription": "{docsLink} (KQL) は、シンプルなクエリ構文とスクリプトフィールドのサポートを提供します。また、KQL はベーシックライセンス以上をご利用の場合、自動入力も提供します。KQL をオフにすると、Kibana は Lucene を使用します。",
|
||||||
"data.query.queryBar.syntaxOptionsDescription.docsLinkText": "こちら",
|
"data.query.queryBar.syntaxOptionsDescription.docsLinkText": "こちら",
|
||||||
"data.query.queryBar.syntaxOptionsTitle": "構文オプション",
|
"data.query.queryBar.syntaxOptionsTitle": "構文オプション",
|
||||||
"kibana_react.search.searchBar.filtersButtonClickToHideTitle": "選択して表示",
|
"data.search.searchBar.searchBar.filtersButtonClickToHideTitle": "選択して表示",
|
||||||
"kibana_react.search.searchBar.filtersButtonClickToShowTitle": "選択して非表示",
|
"data.search.searchBar.searchBar.filtersButtonClickToShowTitle": "選択して非表示",
|
||||||
"embeddableApi.actionPanel.title": "オプション",
|
"embeddableApi.actionPanel.title": "オプション",
|
||||||
"embeddableApi.actions.applyFilterActionTitle": "現在のビューにフィルターを適用",
|
"embeddableApi.actions.applyFilterActionTitle": "現在のビューにフィルターを適用",
|
||||||
"embeddableApi.addPanel.createNew": "新規 {factoryName} を作成",
|
"embeddableApi.addPanel.createNew": "新規 {factoryName} を作成",
|
||||||
|
|
|
@ -814,8 +814,8 @@
|
||||||
"data.query.queryBar.syntaxOptionsDescription": "{docsLink} (KQL) 提供简化查询语法并支持脚本字段。如果您具有基本许可或更高级别的许可,KQL 还提供自动填充功能。如果关闭 KQL,Kibana 将使用 Lucene。",
|
"data.query.queryBar.syntaxOptionsDescription": "{docsLink} (KQL) 提供简化查询语法并支持脚本字段。如果您具有基本许可或更高级别的许可,KQL 还提供自动填充功能。如果关闭 KQL,Kibana 将使用 Lucene。",
|
||||||
"data.query.queryBar.syntaxOptionsDescription.docsLinkText": "此处",
|
"data.query.queryBar.syntaxOptionsDescription.docsLinkText": "此处",
|
||||||
"data.query.queryBar.syntaxOptionsTitle": "语法选项",
|
"data.query.queryBar.syntaxOptionsTitle": "语法选项",
|
||||||
"kibana_react.search.searchBar.filtersButtonClickToHideTitle": "选择以显示",
|
"data.search.searchBar.searchBar.filtersButtonClickToHideTitle": "选择以显示",
|
||||||
"kibana_react.search.searchBar.filtersButtonClickToShowTitle": "选择以隐藏",
|
"data.search.searchBar.searchBar.filtersButtonClickToShowTitle": "选择以隐藏",
|
||||||
"embeddableApi.actionPanel.title": "选项",
|
"embeddableApi.actionPanel.title": "选项",
|
||||||
"embeddableApi.actions.applyFilterActionTitle": "将筛选应用于当前视图",
|
"embeddableApi.actions.applyFilterActionTitle": "将筛选应用于当前视图",
|
||||||
"embeddableApi.addPanel.createNew": "创建新的{factoryName}",
|
"embeddableApi.addPanel.createNew": "创建新的{factoryName}",
|
||||||
|
|
Loading…
Reference in a new issue