mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
* moved query bar to data plugin
This commit is contained in:
parent
15cad67b26
commit
8437811213
42 changed files with 172 additions and 71 deletions
|
@ -1,6 +1,7 @@
|
|||
{
|
||||
"paths": {
|
||||
"common.ui": "src/legacy/ui",
|
||||
"data": "src/legacy/core_plugins/data",
|
||||
"server": "src/legacy/server",
|
||||
"console": "src/legacy/core_plugins/console",
|
||||
"core": "src/core",
|
||||
|
|
|
@ -32,6 +32,10 @@ export default function DataPlugin(kibana: any) {
|
|||
}).default();
|
||||
},
|
||||
init: (server: Legacy.Server) => ({}),
|
||||
uiExports: {
|
||||
injectDefaultVars: () => ({}),
|
||||
styleSheetPaths: resolve(__dirname, 'public/index.scss'),
|
||||
},
|
||||
};
|
||||
|
||||
return new kibana.Plugin(config);
|
||||
|
|
4
src/legacy/core_plugins/data/public/index.scss
Normal file
4
src/legacy/core_plugins/data/public/index.scss
Normal file
|
@ -0,0 +1,4 @@
|
|||
@import 'src/legacy/ui/public/styles/styling_constants';
|
||||
|
||||
@import './query_bar/index';
|
||||
|
|
@ -17,33 +17,42 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
import { IndexPatternsService } from './index_patterns';
|
||||
import { QueryBarService } from './query_bar';
|
||||
import { IndexPatternsService, IndexPatternsSetup } from './index_patterns';
|
||||
|
||||
class DataService {
|
||||
class DataPlugin {
|
||||
private readonly indexPatterns: IndexPatternsService;
|
||||
private readonly queryBar: QueryBarService;
|
||||
|
||||
constructor() {
|
||||
this.indexPatterns = new IndexPatternsService();
|
||||
this.queryBar = new QueryBarService();
|
||||
}
|
||||
|
||||
public setup() {
|
||||
return {
|
||||
indexPatterns: this.indexPatterns.setup(),
|
||||
query: this.queryBar.setup(),
|
||||
};
|
||||
}
|
||||
|
||||
public stop() {
|
||||
this.indexPatterns.stop();
|
||||
this.queryBar.stop();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* We temporarily export default here so that users importing from 'plugins/data'
|
||||
* We export data here so that users importing from 'plugins/data'
|
||||
* will automatically receive the response value of the `setup` contract, mimicking
|
||||
* the data that will eventually be injected by the new platform.
|
||||
*/
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
export default new DataService().setup();
|
||||
export const data = new DataPlugin().setup();
|
||||
|
||||
/** @public */
|
||||
export type DataSetup = ReturnType<DataService['setup']>;
|
||||
export interface DataSetup {
|
||||
indexPatterns: IndexPatternsSetup;
|
||||
}
|
||||
|
||||
/** @public types */
|
||||
export { IndexPattern, StaticIndexPattern, StaticIndexPatternField, Field } from './index_patterns';
|
||||
|
|
|
@ -17,4 +17,12 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
export { IndexPatternsService, IndexPatternsSetup } from './index_patterns_service';
|
||||
export {
|
||||
IndexPatternsService,
|
||||
// types
|
||||
IndexPatternsSetup,
|
||||
IndexPattern,
|
||||
StaticIndexPattern,
|
||||
StaticIndexPatternField,
|
||||
Field,
|
||||
} from './index_patterns_service';
|
||||
|
|
|
@ -51,7 +51,8 @@ import setupRouteWithDefaultPattern from 'ui/index_patterns/route_setup/load_def
|
|||
import { getFromSavedObject, isFilterable } from 'ui/index_patterns/static_utils';
|
||||
|
||||
// IndexPattern, StaticIndexPattern, StaticIndexPatternField, Field
|
||||
import * as types from 'ui/index_patterns/index.d.ts';
|
||||
|
||||
import * as types from 'ui/index_patterns';
|
||||
|
||||
/**
|
||||
* Index Patterns Service
|
||||
|
@ -91,9 +92,6 @@ export class IndexPatternsService {
|
|||
mockFields,
|
||||
mockIndexPattern,
|
||||
},
|
||||
types: {
|
||||
...types,
|
||||
},
|
||||
ui: {
|
||||
IndexPatternSelect,
|
||||
},
|
||||
|
@ -107,3 +105,15 @@ export class IndexPatternsService {
|
|||
|
||||
/** @public */
|
||||
export type IndexPatternsSetup = ReturnType<IndexPatternsService['setup']>;
|
||||
|
||||
/** @public */
|
||||
export type IndexPattern = types.IndexPattern;
|
||||
|
||||
/** @public */
|
||||
export type StaticIndexPattern = types.StaticIndexPattern;
|
||||
|
||||
/** @public */
|
||||
export type StaticIndexPatternField = types.StaticIndexPatternField;
|
||||
|
||||
/** @public */
|
||||
export type Field = types.Field;
|
||||
|
|
|
@ -13,7 +13,7 @@ exports[`LanguageSwitcher should toggle off if language is lucene 1`] = `
|
|||
>
|
||||
<FormattedMessage
|
||||
defaultMessage="Lucene"
|
||||
id="common.ui.queryBar.luceneLanguageName"
|
||||
id="data.query.queryBar.luceneLanguageName"
|
||||
values={Object {}}
|
||||
/>
|
||||
</EuiButtonEmpty>
|
||||
|
@ -30,7 +30,7 @@ exports[`LanguageSwitcher should toggle off if language is lucene 1`] = `
|
|||
<EuiPopoverTitle>
|
||||
<FormattedMessage
|
||||
defaultMessage="Syntax options"
|
||||
id="common.ui.queryBar.syntaxOptionsTitle"
|
||||
id="data.query.queryBar.syntaxOptionsTitle"
|
||||
values={Object {}}
|
||||
/>
|
||||
</EuiPopoverTitle>
|
||||
|
@ -45,7 +45,7 @@ exports[`LanguageSwitcher should toggle off if language is lucene 1`] = `
|
|||
<p>
|
||||
<FormattedMessage
|
||||
defaultMessage="The {docsLink} (KQL) offers a simplified query syntax and support for scripted fields. KQL also provides autocomplete if you have a Basic license or above. If you turn off KQL, Kibana uses Lucene."
|
||||
id="common.ui.queryBar.syntaxOptionsDescription"
|
||||
id="data.query.queryBar.syntaxOptionsDescription"
|
||||
values={
|
||||
Object {
|
||||
"docsLink": <EuiLink
|
||||
|
@ -56,7 +56,7 @@ exports[`LanguageSwitcher should toggle off if language is lucene 1`] = `
|
|||
>
|
||||
<FormattedMessage
|
||||
defaultMessage="Kibana Query Language"
|
||||
id="common.ui.queryBar.kqlFullLanguageName"
|
||||
id="data.query.queryBar.kqlFullLanguageName"
|
||||
values={Object {}}
|
||||
/>
|
||||
</EuiLink>,
|
||||
|
@ -76,7 +76,7 @@ exports[`LanguageSwitcher should toggle off if language is lucene 1`] = `
|
|||
label={
|
||||
<FormattedMessage
|
||||
defaultMessage="Kibana Query Language"
|
||||
id="common.ui.queryBar.kqlFullLanguageName"
|
||||
id="data.query.queryBar.kqlFullLanguageName"
|
||||
values={Object {}}
|
||||
/>
|
||||
}
|
||||
|
@ -89,7 +89,7 @@ exports[`LanguageSwitcher should toggle off if language is lucene 1`] = `
|
|||
label={
|
||||
<FormattedMessage
|
||||
defaultMessage="Off"
|
||||
id="common.ui.queryBar.kqlOffLabel"
|
||||
id="data.query.queryBar.kqlOffLabel"
|
||||
values={Object {}}
|
||||
/>
|
||||
}
|
||||
|
@ -115,7 +115,7 @@ exports[`LanguageSwitcher should toggle on if language is kuery 1`] = `
|
|||
>
|
||||
<FormattedMessage
|
||||
defaultMessage="KQL"
|
||||
id="common.ui.queryBar.kqlLanguageName"
|
||||
id="data.query.queryBar.kqlLanguageName"
|
||||
values={Object {}}
|
||||
/>
|
||||
</EuiButtonEmpty>
|
||||
|
@ -132,7 +132,7 @@ exports[`LanguageSwitcher should toggle on if language is kuery 1`] = `
|
|||
<EuiPopoverTitle>
|
||||
<FormattedMessage
|
||||
defaultMessage="Syntax options"
|
||||
id="common.ui.queryBar.syntaxOptionsTitle"
|
||||
id="data.query.queryBar.syntaxOptionsTitle"
|
||||
values={Object {}}
|
||||
/>
|
||||
</EuiPopoverTitle>
|
||||
|
@ -147,7 +147,7 @@ exports[`LanguageSwitcher should toggle on if language is kuery 1`] = `
|
|||
<p>
|
||||
<FormattedMessage
|
||||
defaultMessage="The {docsLink} (KQL) offers a simplified query syntax and support for scripted fields. KQL also provides autocomplete if you have a Basic license or above. If you turn off KQL, Kibana uses Lucene."
|
||||
id="common.ui.queryBar.syntaxOptionsDescription"
|
||||
id="data.query.queryBar.syntaxOptionsDescription"
|
||||
values={
|
||||
Object {
|
||||
"docsLink": <EuiLink
|
||||
|
@ -158,7 +158,7 @@ exports[`LanguageSwitcher should toggle on if language is kuery 1`] = `
|
|||
>
|
||||
<FormattedMessage
|
||||
defaultMessage="Kibana Query Language"
|
||||
id="common.ui.queryBar.kqlFullLanguageName"
|
||||
id="data.query.queryBar.kqlFullLanguageName"
|
||||
values={Object {}}
|
||||
/>
|
||||
</EuiLink>,
|
||||
|
@ -178,7 +178,7 @@ exports[`LanguageSwitcher should toggle on if language is kuery 1`] = `
|
|||
label={
|
||||
<FormattedMessage
|
||||
defaultMessage="Kibana Query Language"
|
||||
id="common.ui.queryBar.kqlFullLanguageName"
|
||||
id="data.query.queryBar.kqlFullLanguageName"
|
||||
values={Object {}}
|
||||
/>
|
||||
}
|
||||
|
@ -191,7 +191,7 @@ exports[`LanguageSwitcher should toggle on if language is kuery 1`] = `
|
|||
label={
|
||||
<FormattedMessage
|
||||
defaultMessage="On"
|
||||
id="common.ui.queryBar.kqlOnLabel"
|
||||
id="data.query.queryBar.kqlOnLabel"
|
||||
values={Object {}}
|
||||
/>
|
||||
}
|
|
@ -17,7 +17,7 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
jest.mock('../../metadata', () => ({
|
||||
jest.mock('ui/metadata', () => ({
|
||||
metadata: {
|
||||
branch: 'foo',
|
||||
},
|
|
@ -30,7 +30,7 @@ import {
|
|||
} from '@elastic/eui';
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
import React, { Component } from 'react';
|
||||
import { documentationLinks } from '../../documentation_links/documentation_links';
|
||||
import { documentationLinks } from 'ui/documentation_links/documentation_links';
|
||||
|
||||
const kueryQuerySyntaxDocs = documentationLinks.query.kueryQuerySyntax;
|
||||
|
||||
|
@ -50,14 +50,14 @@ export class QueryLanguageSwitcher extends Component<Props, State> {
|
|||
|
||||
public render() {
|
||||
const luceneLabel = (
|
||||
<FormattedMessage id="common.ui.queryBar.luceneLanguageName" defaultMessage="Lucene" />
|
||||
<FormattedMessage id="data.query.queryBar.luceneLanguageName" defaultMessage="Lucene" />
|
||||
);
|
||||
const kqlLabel = (
|
||||
<FormattedMessage id="common.ui.queryBar.kqlLanguageName" defaultMessage="KQL" />
|
||||
<FormattedMessage id="data.query.queryBar.kqlLanguageName" defaultMessage="KQL" />
|
||||
);
|
||||
const kqlFullName = (
|
||||
<FormattedMessage
|
||||
id="common.ui.queryBar.kqlFullLanguageName"
|
||||
id="data.query.queryBar.kqlFullLanguageName"
|
||||
defaultMessage="Kibana Query Language"
|
||||
/>
|
||||
);
|
||||
|
@ -81,7 +81,7 @@ export class QueryLanguageSwitcher extends Component<Props, State> {
|
|||
>
|
||||
<EuiPopoverTitle>
|
||||
<FormattedMessage
|
||||
id="common.ui.queryBar.syntaxOptionsTitle"
|
||||
id="data.query.queryBar.syntaxOptionsTitle"
|
||||
defaultMessage="Syntax options"
|
||||
/>
|
||||
</EuiPopoverTitle>
|
||||
|
@ -89,7 +89,7 @@ export class QueryLanguageSwitcher extends Component<Props, State> {
|
|||
<EuiText>
|
||||
<p>
|
||||
<FormattedMessage
|
||||
id="common.ui.queryBar.syntaxOptionsDescription"
|
||||
id="data.query.queryBar.syntaxOptionsDescription"
|
||||
defaultMessage="The {docsLink} (KQL) offers a simplified query
|
||||
syntax and support for scripted fields. KQL also provides autocomplete if you have
|
||||
a Basic license or above. If you turn off KQL, Kibana uses Lucene."
|
||||
|
@ -113,9 +113,9 @@ export class QueryLanguageSwitcher extends Component<Props, State> {
|
|||
name="popswitch"
|
||||
label={
|
||||
this.props.language === 'kuery' ? (
|
||||
<FormattedMessage id="common.ui.queryBar.kqlOnLabel" defaultMessage="On" />
|
||||
<FormattedMessage id="data.query.queryBar.kqlOnLabel" defaultMessage="On" />
|
||||
) : (
|
||||
<FormattedMessage id="common.ui.queryBar.kqlOffLabel" defaultMessage="Off" />
|
||||
<FormattedMessage id="data.query.queryBar.kqlOffLabel" defaultMessage="Off" />
|
||||
)
|
||||
}
|
||||
checked={this.props.language === 'kuery'}
|
|
@ -49,16 +49,18 @@ const mockAutocompleteProvider = jest.fn(() => mockGetAutocompleteSuggestions);
|
|||
export const mockGetAutocompleteProvider = jest.fn(() => mockAutocompleteProvider);
|
||||
|
||||
jest.mock('ui/chrome', () => mockChromeFactory());
|
||||
jest.mock('../../chrome', () => mockChromeFactory());
|
||||
jest.mock('ui/kfetch', () => ({
|
||||
kfetch: () => {},
|
||||
}));
|
||||
jest.mock('ui/persisted_log', () => ({
|
||||
PersistedLog: mockPersistedLogFactory,
|
||||
}));
|
||||
jest.mock('../../metadata', () => ({
|
||||
jest.mock('ui/metadata', () => ({
|
||||
metadata: {
|
||||
branch: 'foo',
|
||||
},
|
||||
}));
|
||||
jest.mock('../../autocomplete_providers', () => ({
|
||||
jest.mock('ui/autocomplete_providers', () => ({
|
||||
getAutocompleteProvider: mockGetAutocompleteProvider,
|
||||
}));
|
||||
|
|
@ -22,13 +22,13 @@ import {
|
|||
mockGetAutocompleteSuggestions,
|
||||
mockPersistedLog,
|
||||
mockPersistedLogFactory,
|
||||
} from 'ui/query_bar/components/query_bar.test.mocks';
|
||||
} from './query_bar.test.mocks';
|
||||
|
||||
import { EuiFieldText } from '@elastic/eui';
|
||||
import React from 'react';
|
||||
import { mountWithIntl, shallowWithIntl } from 'test_utils/enzyme_helpers';
|
||||
import { QueryBar } from 'ui/query_bar';
|
||||
import { QueryLanguageSwitcher } from 'ui/query_bar/components/language_switcher';
|
||||
import { QueryBar } from './query_bar';
|
||||
import { QueryLanguageSwitcher } from './language_switcher';
|
||||
import { QueryBarUI } from './query_bar';
|
||||
|
||||
const noop = () => {
|
|
@ -45,13 +45,13 @@ import { EuiSuperUpdateButton } from '@elastic/eui';
|
|||
import { FormattedMessage, InjectedIntl, injectI18n } from '@kbn/i18n/react';
|
||||
import { documentationLinks } from 'ui/documentation_links';
|
||||
import { Toast, toastNotifications } from 'ui/notify';
|
||||
|
||||
import {
|
||||
AutocompleteSuggestion,
|
||||
AutocompleteSuggestionType,
|
||||
getAutocompleteProvider,
|
||||
} from '../../autocomplete_providers';
|
||||
import chrome from '../../chrome';
|
||||
} from 'ui/autocomplete_providers';
|
||||
import chrome from 'ui/chrome';
|
||||
|
||||
import { fromUser, matchPairs, toUser } from '../lib';
|
||||
import { QueryLanguageSwitcher } from './language_switcher';
|
||||
import { SuggestionsComponent } from './typeahead/suggestions_component';
|
||||
|
@ -585,7 +585,7 @@ export class QueryBarUI extends Component<Props, State> {
|
|||
<div className="kuiLocalSearchAssistedInput">
|
||||
<EuiFieldText
|
||||
placeholder={this.props.intl.formatMessage({
|
||||
id: 'common.ui.queryBar.searchInputPlaceholder',
|
||||
id: 'data.query.queryBar.searchInputPlaceholder',
|
||||
defaultMessage: 'Search',
|
||||
})}
|
||||
value={this.state.query.query}
|
||||
|
@ -604,7 +604,7 @@ export class QueryBarUI extends Component<Props, State> {
|
|||
spellCheck={false}
|
||||
aria-label={this.props.intl.formatMessage(
|
||||
{
|
||||
id: 'common.ui.queryBar.searchInputAriaLabel',
|
||||
id: 'data.query.queryBar.searchInputAriaLabel',
|
||||
defaultMessage:
|
||||
'You are on search box of {previouslyTranslatedPageTitle} page. Start typing to search and filter the {pageType}',
|
||||
},
|
||||
|
@ -726,21 +726,21 @@ export class QueryBarUI extends Component<Props, State> {
|
|||
) {
|
||||
const toast = toastNotifications.addWarning({
|
||||
title: intl.formatMessage({
|
||||
id: 'common.ui.queryBar.luceneSyntaxWarningTitle',
|
||||
id: 'data.query.queryBar.luceneSyntaxWarningTitle',
|
||||
defaultMessage: 'Lucene syntax warning',
|
||||
}),
|
||||
text: (
|
||||
<div>
|
||||
<p>
|
||||
<FormattedMessage
|
||||
id="common.ui.queryBar.luceneSyntaxWarningMessage"
|
||||
id="data.query.queryBar.luceneSyntaxWarningMessage"
|
||||
defaultMessage="It looks like you may be trying to use Lucene query syntax, although you
|
||||
have Kibana Query Language (KQL) selected. Please review the KQL docs {link}."
|
||||
values={{
|
||||
link: (
|
||||
<EuiLink href={documentationLinks.query.kueryQuerySyntax} target="_blank">
|
||||
<FormattedMessage
|
||||
id="common.ui.queryBar.syntaxOptionsDescription.docsLinkText"
|
||||
id="data.query.queryBar.syntaxOptionsDescription.docsLinkText"
|
||||
defaultMessage="here"
|
||||
/>
|
||||
</EuiLink>
|
|
@ -20,7 +20,7 @@
|
|||
import { mount, shallow } from 'enzyme';
|
||||
import React from 'react';
|
||||
import { AutocompleteSuggestion } from 'ui/autocomplete_providers';
|
||||
import { SuggestionComponent } from 'ui/query_bar/components/typeahead/suggestion_component';
|
||||
import { SuggestionComponent } from './suggestion_component';
|
||||
|
||||
const noop = () => {
|
||||
return;
|
|
@ -20,8 +20,8 @@
|
|||
import { mount, shallow } from 'enzyme';
|
||||
import React from 'react';
|
||||
import { AutocompleteSuggestion } from 'ui/autocomplete_providers';
|
||||
import { SuggestionComponent } from 'ui/query_bar/components/typeahead/suggestion_component';
|
||||
import { SuggestionsComponent } from 'ui/query_bar/components/typeahead/suggestions_component';
|
||||
import { SuggestionComponent } from './suggestion_component';
|
||||
import { SuggestionsComponent } from './suggestions_component';
|
||||
|
||||
const noop = () => {
|
||||
return;
|
|
@ -21,18 +21,20 @@
|
|||
|
||||
import 'ngreact';
|
||||
import { wrapInI18nContext } from 'ui/i18n';
|
||||
import { uiModules } from '../../modules';
|
||||
import { uiModules } from 'ui/modules';
|
||||
import { QueryBar } from '../components';
|
||||
|
||||
const app = uiModules.get('app/kibana', ['react']);
|
||||
const app = uiModules.get('app/data', ['react']);
|
||||
|
||||
app.directive('queryBar', (reactDirective, localStorage) => {
|
||||
return reactDirective(
|
||||
wrapInI18nContext(QueryBar),
|
||||
undefined,
|
||||
{},
|
||||
{
|
||||
store: localStorage,
|
||||
}
|
||||
);
|
||||
});
|
||||
export function setupDirective() {
|
||||
app.directive('queryBar', (reactDirective, localStorage) => {
|
||||
return reactDirective(
|
||||
wrapInI18nContext(QueryBar),
|
||||
undefined,
|
||||
{},
|
||||
{
|
||||
store: localStorage,
|
||||
}
|
||||
);
|
||||
});
|
||||
}
|
|
@ -17,4 +17,6 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
export { QueryBarService } from './query_bar_service';
|
||||
|
||||
export { QueryBar } from './components';
|
|
@ -0,0 +1,52 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
import { QueryBar } from './components/query_bar';
|
||||
import { fromUser } from './lib/from_user';
|
||||
import { toUser } from './lib/to_user';
|
||||
|
||||
// @ts-ignore
|
||||
import { setupDirective } from './directive';
|
||||
|
||||
/**
|
||||
* Query Bar Service
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
export class QueryBarService {
|
||||
public setup() {
|
||||
return {
|
||||
loadLegacyDirectives: _.once(setupDirective),
|
||||
helpers: {
|
||||
fromUser,
|
||||
toUser,
|
||||
},
|
||||
ui: {
|
||||
QueryBar,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
public stop() {
|
||||
// nothing to do here yet
|
||||
}
|
||||
}
|
||||
|
||||
/** @public */
|
||||
export type QueryBarSetup = ReturnType<QueryBarService['setup']>;
|
|
@ -23,7 +23,7 @@ import './visualization_editor';
|
|||
import 'ui/vis/editors/default/sidebar';
|
||||
import 'ui/visualize';
|
||||
import 'ui/collapsible_sidebar';
|
||||
import 'ui/query_bar';
|
||||
|
||||
import { capabilities } from 'ui/capabilities';
|
||||
import 'ui/search_bar';
|
||||
import 'ui/apply_filters';
|
||||
|
|
|
@ -21,6 +21,7 @@ import { Server } from '../../server/kbn_server';
|
|||
export type InitPluginFunction = (server: Server) => void;
|
||||
export interface UiExports {
|
||||
injectDefaultVars: (server: Server) => { [key: string]: any };
|
||||
styleSheetPaths?: string;
|
||||
}
|
||||
|
||||
export interface PluginSpecOptions {
|
||||
|
|
|
@ -19,10 +19,8 @@
|
|||
@import './field_editor/index';
|
||||
@import './inspector/index';
|
||||
@import './kbn_top_nav/index';
|
||||
// @import './timepicker/index';
|
||||
@import './markdown/index';
|
||||
@import './notify/index';
|
||||
@import './query_bar/index';
|
||||
@import './share/index';
|
||||
@import './filter_bar/index';
|
||||
@import './style_compile/index';
|
||||
|
|
|
@ -17,7 +17,8 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
import { toUser, fromUser } from '../../query_bar/lib';
|
||||
import { data } from 'plugins/data';
|
||||
const { toUser, fromUser } = data.query.helpers;
|
||||
import { uiModules } from '../../modules';
|
||||
|
||||
uiModules
|
||||
|
|
|
@ -26,9 +26,11 @@ import React, { Component } from 'react';
|
|||
import ResizeObserver from 'resize-observer-polyfill';
|
||||
import { FilterBar } from 'ui/filter_bar';
|
||||
import { IndexPattern } from 'ui/index_patterns';
|
||||
import { QueryBar } from 'ui/query_bar';
|
||||
import { Storage } from 'ui/storage';
|
||||
|
||||
import { data } from 'plugins/data';
|
||||
const { QueryBar } = data.query.ui;
|
||||
|
||||
interface Query {
|
||||
query: string;
|
||||
language: string;
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
"kibana": ["./kibana"],
|
||||
"kibana/public": ["src/core/public"],
|
||||
"kibana/server": ["src/core/server"],
|
||||
"plugins/*": ["src/legacy/core_plugins/*/public/"],
|
||||
"ui/*": [
|
||||
"src/legacy/ui/public/*"
|
||||
],
|
||||
|
|
|
@ -19,10 +19,12 @@ import {
|
|||
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { QueryBar } from 'ui/query_bar';
|
||||
import { indexPatternService } from '../../../kibana_services';
|
||||
import { Storage } from 'ui/storage';
|
||||
|
||||
import { data } from 'plugins/data';
|
||||
const { QueryBar } = data.query.ui;
|
||||
|
||||
const settings = chrome.getUiSettingsClient();
|
||||
const localStorage = new Storage(window.localStorage);
|
||||
|
||||
|
|
|
@ -18,7 +18,6 @@ import { capabilities } from 'ui/capabilities';
|
|||
import chrome from 'ui/chrome';
|
||||
import routes from 'ui/routes';
|
||||
import 'ui/kbn_top_nav';
|
||||
import 'ui/query_bar/directive';
|
||||
import { uiModules } from 'ui/modules';
|
||||
import { DocTitleProvider } from 'ui/doc_title';
|
||||
import 'ui/autoload/styles';
|
||||
|
@ -34,6 +33,9 @@ import mapTemplate from './angular/map.html';
|
|||
import { MapListing } from './shared/components/map_listing';
|
||||
import { recentlyAccessed } from 'ui/persisted_log';
|
||||
|
||||
import { data } from 'plugins/data';
|
||||
data.query.loadLegacyDirectives();
|
||||
|
||||
const app = uiModules.get('app/maps', ['ngRoute', 'react']);
|
||||
|
||||
app.directive('mapListing', function (reactDirective) {
|
||||
|
|
|
@ -516,9 +516,6 @@
|
|||
"common.ui.paginateSelectableList.sortByButtonLabelScreenReaderOnly": "排序依据",
|
||||
"common.ui.parseEsInterval.invalidEsCalendarIntervalErrorMessage": "无效的日历时间间隔:{interval},值必须为 1",
|
||||
"common.ui.parseEsInterval.invalidEsIntervalFormatErrorMessage": "无效的时间间隔格式:{interval}",
|
||||
"common.ui.queryBar.searchInputPlaceholder": "搜索……(例如,status:200 AND extension:PHP)",
|
||||
"common.ui.queryBar.syntaxOptionsDescription": "我们的实验性自动完成功能及简单语法功能可以帮助您创建自己的查询。只需开始键入,便会看到与您的数据相关的匹配。请参阅{docsLink}的文档。",
|
||||
"common.ui.queryBar.syntaxOptionsTitle": "语法选项",
|
||||
"common.ui.savedObjectFinder.addNewItemButtonLabel": "添加新的 {item}",
|
||||
"common.ui.savedObjectFinder.manageItemsButtonLabel": "管理 {items}",
|
||||
"common.ui.savedObjectFinder.noMatchesFoundDescription": "未找到任何匹配的 {items}。",
|
||||
|
@ -686,6 +683,9 @@
|
|||
"console.welcomePage.supportedRequestFormatDescription": "键入请求时,Console 将提供建议,您可以通过按 Enter/Tab 键来接受建议。这些建议基于请求结构{asWellAs}您的索引和类型做出。",
|
||||
"console.welcomePage.supportedRequestFormatDescription.asWellAsFragmentText": "以及",
|
||||
"console.welcomePage.supportedRequestFormatTitle": "Console 理解紧凑格式的请求,类似于 cURL:",
|
||||
"data.query.queryBar.searchInputPlaceholder": "搜索……(例如,status:200 AND extension:PHP)",
|
||||
"data.query.queryBar.syntaxOptionsDescription": "我们的实验性自动完成功能及简单语法功能可以帮助您创建自己的查询。只需开始键入,便会看到与您的数据相关的匹配。请参阅{docsLink}的文档。",
|
||||
"data.query.queryBar.syntaxOptionsTitle": "语法选项",
|
||||
"inputControl.control.noIndexPatternTooltip": "找不到索引模式 ID:{indexPatternId}。",
|
||||
"inputControl.control.notInitializedTooltip": "尚未初始化控件",
|
||||
"inputControl.control.noValuesDisableTooltip": "按 “{fieldName}” 字段进行了筛选,但 “{indexPatternName}” 索引模式的任何文档中都不存在该字段。选择不同的字段或索引包含此字段的值的文档。",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue