diff --git a/src/legacy/core_plugins/kbn_doc_views/index.js b/src/legacy/core_plugins/kbn_doc_views/index.js deleted file mode 100644 index 9078a82d6338..000000000000 --- a/src/legacy/core_plugins/kbn_doc_views/index.js +++ /dev/null @@ -1,26 +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 default function(kibana) { - return new kibana.Plugin({ - uiExports: { - docViews: ['plugins/kbn_doc_views/kbn_doc_views'], - }, - }); -} diff --git a/src/legacy/core_plugins/kbn_doc_views/package.json b/src/legacy/core_plugins/kbn_doc_views/package.json deleted file mode 100644 index efad9ec42f1f..000000000000 --- a/src/legacy/core_plugins/kbn_doc_views/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "kbn_doc_views", - "version": "kibana" -} diff --git a/src/legacy/core_plugins/kbn_doc_views/public/kbn_doc_views.js b/src/legacy/core_plugins/kbn_doc_views/public/kbn_doc_views.js deleted file mode 100644 index 2608e60e7074..000000000000 --- a/src/legacy/core_plugins/kbn_doc_views/public/kbn_doc_views.js +++ /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. - */ - -import './views/table'; -import './views/json'; diff --git a/src/legacy/core_plugins/kbn_doc_views/public/views/json.tsx b/src/legacy/core_plugins/kbn_doc_views/public/views/json.tsx deleted file mode 100644 index 73167b56bdde..000000000000 --- a/src/legacy/core_plugins/kbn_doc_views/public/views/json.tsx +++ /dev/null @@ -1,33 +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. - */ -import { addDocView } from 'ui/registry/doc_views'; -import { i18n } from '@kbn/i18n'; -import { JsonCodeBlock } from './json_code_block'; - -/* - * Registration of the the doc view: json - * - used to display an ES hit as pretty printed JSON at Discover - */ -addDocView({ - title: i18n.translate('kbnDocViews.json.jsonTitle', { - defaultMessage: 'JSON', - }), - order: 20, - component: JsonCodeBlock, -}); diff --git a/src/legacy/core_plugins/kbn_doc_views/public/views/table.ts b/src/legacy/core_plugins/kbn_doc_views/public/views/table.ts deleted file mode 100644 index f90840f19500..000000000000 --- a/src/legacy/core_plugins/kbn_doc_views/public/views/table.ts +++ /dev/null @@ -1,31 +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. - */ - -import _ from 'lodash'; -import { addDocView } from 'ui/registry/doc_views'; -import { i18n } from '@kbn/i18n'; -import { DocViewTable } from './table/table'; - -addDocView({ - title: i18n.translate('kbnDocViews.table.tableTitle', { - defaultMessage: 'Table', - }), - order: 10, - component: DocViewTable, -}); diff --git a/src/legacy/core_plugins/kibana/public/discover/build_services.ts b/src/legacy/core_plugins/kibana/public/discover/build_services.ts index aaacde7e4060..1fb8b4abb21c 100644 --- a/src/legacy/core_plugins/kibana/public/discover/build_services.ts +++ b/src/legacy/core_plugins/kibana/public/discover/build_services.ts @@ -24,24 +24,27 @@ import { ToastsStart, IUiSettingsClient, } from 'kibana/public'; -import * as docViewsRegistry from 'ui/registry/doc_views'; -import { FilterManager, TimefilterContract, IndexPatternsContract } from 'src/plugins/data/public'; +import { + FilterManager, + TimefilterContract, + IndexPatternsContract, + DataPublicPluginStart, +} from 'src/plugins/data/public'; import { createSavedSearchesService } from './saved_searches'; -// @ts-ignore import { DiscoverStartPlugins } from './plugin'; -import { DataStart } from '../../../data/public'; import { EuiUtilsStart } from '../../../../../plugins/eui_utils/public'; import { SharePluginStart } from '../../../../../plugins/share/public'; import { SavedSearch } from './np_ready/types'; +import { DocViewsRegistry } from './np_ready/doc_views/doc_views_registry'; export interface DiscoverServices { addBasePath: (path: string) => string; capabilities: Capabilities; chrome: ChromeStart; core: CoreStart; - data: DataStart; + data: DataPublicPluginStart; docLinks: DocLinksStart; - docViewsRegistry: docViewsRegistry.DocViewsRegistry; + docViewsRegistry: DocViewsRegistry; eui_utils: EuiUtilsStart; filterManager: FilterManager; indexPatterns: IndexPatternsContract; @@ -54,7 +57,11 @@ export interface DiscoverServices { getSavedSearchUrlById: (id: string) => Promise; uiSettings: IUiSettingsClient; } -export async function buildServices(core: CoreStart, plugins: DiscoverStartPlugins) { +export async function buildServices( + core: CoreStart, + plugins: DiscoverStartPlugins, + docViewsRegistry: DocViewsRegistry +): Promise { const services = { savedObjectsClient: core.savedObjects.client, indexPatterns: plugins.data.indexPatterns, diff --git a/src/legacy/core_plugins/kibana/public/discover/index.ts b/src/legacy/core_plugins/kibana/public/discover/index.ts index 347f545dea4c..7bde30e0d0f0 100644 --- a/src/legacy/core_plugins/kibana/public/discover/index.ts +++ b/src/legacy/core_plugins/kibana/public/discover/index.ts @@ -16,20 +16,24 @@ * specific language governing permissions and limitations * under the License. */ -import { PluginInitializer, PluginInitializerContext } from 'kibana/public'; +import chrome from 'ui/chrome'; +import { PluginInitializerContext } from 'kibana/public'; import { npSetup, npStart } from 'ui/new_platform'; -import { DiscoverPlugin, DiscoverSetup, DiscoverStart } from './plugin'; +import { DiscoverPlugin } from './plugin'; // Core will be looking for this when loading our plugin in the new platform -export const plugin: PluginInitializer = () => { +export const plugin = (context: PluginInitializerContext) => { return new DiscoverPlugin(); }; // Legacy compatiblity part - to be removed at cutover, replaced by a kibana.json file export const pluginInstance = plugin({} as PluginInitializerContext); -(async () => { - pluginInstance.setup(npSetup.core, npSetup.plugins); - pluginInstance.start(npStart.core, npStart.plugins); -})(); +export const setup = pluginInstance.setup(npSetup.core, { + ...npSetup.plugins, + __LEGACY: { + chrome, + }, +}); +export const start = pluginInstance.start(npStart.core, npStart.plugins); export { createSavedSearchesService } from './saved_searches/saved_searches'; diff --git a/src/legacy/core_plugins/kibana/public/discover/kibana_services.ts b/src/legacy/core_plugins/kibana/public/discover/kibana_services.ts index ca169e5f803a..d2eefba2cecd 100644 --- a/src/legacy/core_plugins/kibana/public/discover/kibana_services.ts +++ b/src/legacy/core_plugins/kibana/public/discover/kibana_services.ts @@ -94,11 +94,11 @@ export { IndexPatternsContract, IIndexPattern, IndexPattern, + indexPatterns, IFieldType, } from '../../../../../plugins/data/public'; -export { ElasticSearchHit } from 'ui/registry/doc_views_types'; -export { DocViewRenderProps, DocViewRenderFn } from 'ui/registry/doc_views'; +export { ElasticSearchHit } from './np_ready/doc_views/doc_views_types'; export { Adapters } from 'ui/inspector/types'; -export { DocView, DocViewInput } from 'ui/registry/doc_views_types'; +export { Chrome, IInjector } from 'ui/chrome'; export { registerTimefilterWithGlobalStateFactory } from 'ui/timefilter/setup_router'; -export { IInjector } from 'ui/chrome'; +export { FieldName } from 'ui/directives/field_name/field_name'; diff --git a/src/legacy/core_plugins/kibana/public/discover/np_ready/components/doc/doc.test.tsx b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/doc/doc.test.tsx index 656e8598aa12..e09f26311e4e 100644 --- a/src/legacy/core_plugins/kibana/public/discover/np_ready/components/doc/doc.test.tsx +++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/doc/doc.test.tsx @@ -25,7 +25,7 @@ import { findTestSubject } from '@elastic/eui/lib/test'; import { Doc, DocProps } from './doc'; jest.mock('../doc_viewer/doc_viewer', () => ({ - DocViewer: 'test', + DocViewer: () => null, })); jest.mock('../../../kibana_services', () => { @@ -67,7 +67,7 @@ async function mountDoc(search: () => void, update = false, indexPatternGetter: indexPatternService, } as DocProps; let comp!: ReactWrapper; - act(() => { + await act(async () => { comp = mountWithIntl(); if (update) comp.update(); }); diff --git a/src/legacy/core_plugins/kibana/public/discover/np_ready/components/doc/use_es_doc_search.test.tsx b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/doc/use_es_doc_search.test.tsx index 2420eb2cd22b..a8fe8de83331 100644 --- a/src/legacy/core_plugins/kibana/public/discover/np_ready/components/doc/use_es_doc_search.test.tsx +++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/doc/use_es_doc_search.test.tsx @@ -43,7 +43,7 @@ describe('Test of helper / hook', () => { `); }); - test('useEsDocSearch', () => { + test('useEsDocSearch', async () => { const indexPattern = { getComputedFields: () => [], }; @@ -53,16 +53,16 @@ describe('Test of helper / hook', () => { const props = { id: '1', index: 'index1', - esClient: { search: jest.fn() }, + esClient: { search: jest.fn(() => new Promise(() => {})) }, indexPatternId: 'xyz', indexPatternService, } as DocProps; let hook; - act(() => { + await act(async () => { hook = renderHook((p: DocProps) => useEsDocSearch(p), { initialProps: props }); }); // @ts-ignore - expect(hook.result.current).toEqual([ElasticRequestState.Loading, null, null]); + expect(hook.result.current).toEqual([ElasticRequestState.Loading, null, indexPattern]); expect(indexPatternService.get).toHaveBeenCalled(); }); }); diff --git a/src/legacy/core_plugins/kibana/public/discover/np_ready/components/doc_viewer/doc_viewer.test.tsx b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/doc_viewer/doc_viewer.test.tsx index c0644a645869..15f0f40700ab 100644 --- a/src/legacy/core_plugins/kibana/public/discover/np_ready/components/doc_viewer/doc_viewer.test.tsx +++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/doc_viewer/doc_viewer.test.tsx @@ -21,23 +21,23 @@ import { mount, shallow } from 'enzyme'; import { DocViewer } from './doc_viewer'; // @ts-ignore import { findTestSubject } from '@elastic/eui/lib/test'; -import { DocViewRenderProps, DocViewInput, getServices } from '../../../kibana_services'; +import { getServices } from '../../../kibana_services'; +import { DocViewRenderProps } from '../../doc_views/doc_views_types'; jest.mock('../../../kibana_services', () => { - const docViews: DocViewInput[] = []; - - function addDocView(docView: DocViewInput) { - docViews.push(docView); - } - + let registry: any[] = []; return { getServices: () => ({ docViewsRegistry: { - getDocViewsSorted: () => { - return docViews; + addDocView(view: any) { + registry.push(view); + }, + getDocViewsSorted() { + return registry; }, - addDocView, - docViews, + }, + resetRegistry: () => { + registry = []; }, }), formatMsg: (x: any) => String(x), @@ -45,23 +45,16 @@ jest.mock('../../../kibana_services', () => { }; }); -const { - docViewsRegistry: { docViews, addDocView }, -} = getServices(); - -function emptyDocViews() { - docViews.length = 0; -} - beforeEach(() => { - emptyDocViews(); + (getServices() as any).resetRegistry(); jest.clearAllMocks(); }); test('Render with 3 different tabs', () => { - addDocView({ order: 10, title: 'Render function', render: jest.fn() }); - addDocView({ order: 20, title: 'React component', component: () =>
test
}); - addDocView({ order: 30, title: 'Invalid doc view' }); + const registry = getServices().docViewsRegistry; + registry.addDocView({ order: 10, title: 'Render function', render: jest.fn() }); + registry.addDocView({ order: 20, title: 'React component', component: () =>
test
}); + registry.addDocView({ order: 30, title: 'Invalid doc view' }); const renderProps = { hit: {} } as DocViewRenderProps; @@ -76,7 +69,8 @@ test('Render with 1 tab displaying error message', () => { return null; } - addDocView({ + const registry = getServices().docViewsRegistry; + registry.addDocView({ order: 10, title: 'React component', component: SomeComponent, diff --git a/src/legacy/core_plugins/kibana/public/discover/np_ready/components/doc_viewer/doc_viewer.tsx b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/doc_viewer/doc_viewer.tsx index 00926d70db25..a177d8c29304 100644 --- a/src/legacy/core_plugins/kibana/public/discover/np_ready/components/doc_viewer/doc_viewer.tsx +++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/doc_viewer/doc_viewer.tsx @@ -18,8 +18,9 @@ */ import React from 'react'; import { EuiTabbedContent } from '@elastic/eui'; -import { getServices, DocViewRenderProps, DocView } from '../../../kibana_services'; +import { getServices } from '../../../kibana_services'; import { DocViewerTab } from './doc_viewer_tab'; +import { DocView, DocViewRenderProps } from '../../doc_views/doc_views_types'; /** * Rendering tabs with different views of 1 Elasticsearch hit in Discover. diff --git a/src/legacy/core_plugins/kibana/public/discover/np_ready/components/doc_viewer/doc_viewer_render_tab.test.tsx b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/doc_viewer/doc_viewer_render_tab.test.tsx index c100e71b5f2b..79f185452164 100644 --- a/src/legacy/core_plugins/kibana/public/discover/np_ready/components/doc_viewer/doc_viewer_render_tab.test.tsx +++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/doc_viewer/doc_viewer_render_tab.test.tsx @@ -19,7 +19,7 @@ import React from 'react'; import { mount } from 'enzyme'; import { DocViewRenderTab } from './doc_viewer_render_tab'; -import { DocViewRenderProps } from '../../../kibana_services'; +import { DocViewRenderProps } from '../../doc_views/doc_views_types'; test('Mounting and unmounting DocViewerRenderTab', () => { const unmountFn = jest.fn(); diff --git a/src/legacy/core_plugins/kibana/public/discover/np_ready/components/doc_viewer/doc_viewer_render_tab.tsx b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/doc_viewer/doc_viewer_render_tab.tsx index 31a8808a3a1c..0b1a02f1987c 100644 --- a/src/legacy/core_plugins/kibana/public/discover/np_ready/components/doc_viewer/doc_viewer_render_tab.tsx +++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/doc_viewer/doc_viewer_render_tab.tsx @@ -17,7 +17,7 @@ * under the License. */ import React, { useRef, useEffect } from 'react'; -import { DocViewRenderFn, DocViewRenderProps } from '../../../kibana_services'; +import { DocViewRenderFn, DocViewRenderProps } from '../../doc_views/doc_views_types'; interface Props { render: DocViewRenderFn; diff --git a/src/legacy/core_plugins/kibana/public/discover/np_ready/components/doc_viewer/doc_viewer_tab.tsx b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/doc_viewer/doc_viewer_tab.tsx index e08b0b2323d8..0c21fafc91d6 100644 --- a/src/legacy/core_plugins/kibana/public/discover/np_ready/components/doc_viewer/doc_viewer_tab.tsx +++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/doc_viewer/doc_viewer_tab.tsx @@ -18,9 +18,9 @@ */ import React from 'react'; import { I18nProvider } from '@kbn/i18n/react'; -import { DocViewRenderProps, DocViewRenderFn } from '../../../kibana_services'; import { DocViewRenderTab } from './doc_viewer_render_tab'; import { DocViewerError } from './doc_viewer_render_error'; +import { DocViewRenderFn, DocViewRenderProps } from '../../doc_views/doc_views_types'; interface Props { component?: React.ComponentType; diff --git a/src/legacy/core_plugins/kbn_doc_views/public/views/__snapshots__/json_code_block.test.tsx.snap b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/json_code_block/__snapshots__/json_code_block.test.tsx.snap similarity index 100% rename from src/legacy/core_plugins/kbn_doc_views/public/views/__snapshots__/json_code_block.test.tsx.snap rename to src/legacy/core_plugins/kibana/public/discover/np_ready/components/json_code_block/__snapshots__/json_code_block.test.tsx.snap diff --git a/src/legacy/core_plugins/kbn_doc_views/public/views/json_code_block.test.tsx b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/json_code_block/json_code_block.test.tsx similarity index 94% rename from src/legacy/core_plugins/kbn_doc_views/public/views/json_code_block.test.tsx rename to src/legacy/core_plugins/kibana/public/discover/np_ready/components/json_code_block/json_code_block.test.tsx index ea11ea7b7df1..9cab7974c9eb 100644 --- a/src/legacy/core_plugins/kbn_doc_views/public/views/json_code_block.test.tsx +++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/json_code_block/json_code_block.test.tsx @@ -19,7 +19,7 @@ import React from 'react'; import { shallow } from 'enzyme'; import { JsonCodeBlock } from './json_code_block'; -import { IndexPattern } from '../../../../../plugins/data/public'; +import { IndexPattern } from '../../../kibana_services'; it('returns the `JsonCodeEditor` component', () => { const props = { diff --git a/src/legacy/core_plugins/kbn_doc_views/public/views/json_code_block.tsx b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/json_code_block/json_code_block.tsx similarity index 88% rename from src/legacy/core_plugins/kbn_doc_views/public/views/json_code_block.tsx rename to src/legacy/core_plugins/kibana/public/discover/np_ready/components/json_code_block/json_code_block.tsx index 3f412b050052..3331969e351a 100644 --- a/src/legacy/core_plugins/kbn_doc_views/public/views/json_code_block.tsx +++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/json_code_block/json_code_block.tsx @@ -19,10 +19,10 @@ import React from 'react'; import { EuiCodeBlock } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { DocViewRenderProps } from 'ui/registry/doc_views'; +import { DocViewRenderProps } from '../../doc_views/doc_views_types'; export function JsonCodeBlock({ hit }: DocViewRenderProps) { - const label = i18n.translate('kbnDocViews.json.codeEditorAriaLabel', { + const label = i18n.translate('kbn.discover.docViews.json.codeEditorAriaLabel', { defaultMessage: 'Read only JSON view of an elasticsearch document', }); return ( diff --git a/src/legacy/core_plugins/kbn_doc_views/public/views/table/table.test.tsx b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/table/table.test.tsx similarity index 98% rename from src/legacy/core_plugins/kbn_doc_views/public/views/table/table.test.tsx rename to src/legacy/core_plugins/kibana/public/discover/np_ready/components/table/table.test.tsx index 91b98865a020..f816b33bcd0a 100644 --- a/src/legacy/core_plugins/kbn_doc_views/public/views/table/table.test.tsx +++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/table/table.test.tsx @@ -22,7 +22,7 @@ import { mount } from 'enzyme'; import { findTestSubject } from '@elastic/eui/lib/test'; import { DocViewTable } from './table'; -import { IndexPattern, indexPatterns } from '../../../../../../plugins/data/public'; +import { IndexPattern, indexPatterns } from '../../../kibana_services'; jest.mock('ui/new_platform'); diff --git a/src/legacy/core_plugins/kbn_doc_views/public/views/table/table.tsx b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/table/table.tsx similarity index 97% rename from src/legacy/core_plugins/kbn_doc_views/public/views/table/table.tsx rename to src/legacy/core_plugins/kibana/public/discover/np_ready/components/table/table.tsx index 7158739e5d43..4bb2f83016c2 100644 --- a/src/legacy/core_plugins/kbn_doc_views/public/views/table/table.tsx +++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/table/table.tsx @@ -17,9 +17,9 @@ * under the License. */ import React, { useState } from 'react'; -import { DocViewRenderProps } from 'ui/registry/doc_views'; import { DocViewTableRow } from './table_row'; import { arrayContainsObjects, trimAngularSpan } from './table_helper'; +import { DocViewRenderProps } from '../../doc_views/doc_views_types'; const COLLAPSE_LINE_LENGTH = 350; diff --git a/src/legacy/core_plugins/kbn_doc_views/public/views/table/table_helper.test.ts b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/table/table_helper.test.ts similarity index 100% rename from src/legacy/core_plugins/kbn_doc_views/public/views/table/table_helper.test.ts rename to src/legacy/core_plugins/kibana/public/discover/np_ready/components/table/table_helper.test.ts diff --git a/src/legacy/core_plugins/kbn_doc_views/public/views/table/table_helper.tsx b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/table/table_helper.tsx similarity index 100% rename from src/legacy/core_plugins/kbn_doc_views/public/views/table/table_helper.tsx rename to src/legacy/core_plugins/kibana/public/discover/np_ready/components/table/table_helper.tsx diff --git a/src/legacy/core_plugins/kbn_doc_views/public/views/table/table_row.tsx b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/table/table_row.tsx similarity index 96% rename from src/legacy/core_plugins/kbn_doc_views/public/views/table/table_row.tsx rename to src/legacy/core_plugins/kibana/public/discover/np_ready/components/table/table_row.tsx index 045e8093124a..ffcb20f07673 100644 --- a/src/legacy/core_plugins/kbn_doc_views/public/views/table/table_row.tsx +++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/table/table_row.tsx @@ -16,10 +16,10 @@ * specific language governing permissions and limitations * under the License. */ -import React, { ReactNode } from 'react'; -import { FieldName } from 'ui/directives/field_name/field_name'; -import { FieldMapping, DocViewFilterFn } from 'ui/registry/doc_views_types'; import classNames from 'classnames'; +import React, { ReactNode } from 'react'; +import { FieldName } from '../../../kibana_services'; +import { FieldMapping, DocViewFilterFn } from '../../doc_views/doc_views_types'; import { DocViewTableRowBtnFilterAdd } from './table_row_btn_filter_add'; import { DocViewTableRowBtnFilterRemove } from './table_row_btn_filter_remove'; import { DocViewTableRowBtnToggleColumn } from './table_row_btn_toggle_column'; diff --git a/src/legacy/core_plugins/kbn_doc_views/public/views/table/table_row_btn_collapse.tsx b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/table/table_row_btn_collapse.tsx similarity index 94% rename from src/legacy/core_plugins/kbn_doc_views/public/views/table/table_row_btn_collapse.tsx rename to src/legacy/core_plugins/kibana/public/discover/np_ready/components/table/table_row_btn_collapse.tsx index cb6b522ba955..e59f607329d4 100644 --- a/src/legacy/core_plugins/kbn_doc_views/public/views/table/table_row_btn_collapse.tsx +++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/table/table_row_btn_collapse.tsx @@ -26,7 +26,7 @@ export interface Props { } export function DocViewTableRowBtnCollapse({ onClick, isCollapsed }: Props) { - const label = i18n.translate('kbnDocViews.table.toggleFieldDetails', { + const label = i18n.translate('kbn.discover.docViews.table.toggleFieldDetails', { defaultMessage: 'Toggle field details', }); return ( diff --git a/src/legacy/core_plugins/kbn_doc_views/public/views/table/table_row_btn_filter_add.tsx b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/table/table_row_btn_filter_add.tsx similarity index 87% rename from src/legacy/core_plugins/kbn_doc_views/public/views/table/table_row_btn_filter_add.tsx rename to src/legacy/core_plugins/kibana/public/discover/np_ready/components/table/table_row_btn_filter_add.tsx index df4572c5bb53..8e2668e26cf0 100644 --- a/src/legacy/core_plugins/kbn_doc_views/public/views/table/table_row_btn_filter_add.tsx +++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/table/table_row_btn_filter_add.tsx @@ -29,12 +29,12 @@ export interface Props { export function DocViewTableRowBtnFilterAdd({ onClick, disabled = false }: Props) { const tooltipContent = disabled ? ( ) : ( ); @@ -42,7 +42,7 @@ export function DocViewTableRowBtnFilterAdd({ onClick, disabled = false }: Props return ( ) : ( ) ) : ( ); @@ -54,9 +54,12 @@ export function DocViewTableRowBtnFilterExists({ return ( ) : ( ); @@ -42,7 +42,7 @@ export function DocViewTableRowBtnFilterRemove({ onClick, disabled = false }: Pr return ( } > Index Patterns page', - }); + const ariaLabel = i18n.translate( + 'kbn.discover.docViews.table.noCachedMappingForThisFieldAriaLabel', + { + defaultMessage: 'Warning', + } + ); + const tooltipContent = i18n.translate( + 'kbn.discover.docViews.table.noCachedMappingForThisFieldTooltip', + { + defaultMessage: + 'No cached mapping for this field. Refresh field list from the Management > Index Patterns page', + } + ); return ( void> { const $injector = await chrome.dangerouslyGetActiveInjector(); const rootScope: AngularScope = $injector.get('$rootScope'); @@ -68,7 +69,7 @@ export async function injectAngularElement( * Converts a given legacy angular directive to a render function * for usage in a react component. Note that the rendering is async */ -export function convertDirectiveToRenderFn(directive: AngularDirective) { +export function convertDirectiveToRenderFn(directive: AngularDirective, chrome: Chrome) { return (domNode: Element, props: DocViewRenderProps) => { let rejected = false; @@ -76,7 +77,8 @@ export function convertDirectiveToRenderFn(directive: AngularDirective) { domNode, directive.template, props, - directive.controller + directive.controller, + chrome ); cleanupFnPromise.catch(e => { rejected = true; diff --git a/src/legacy/core_plugins/kibana/public/discover/np_ready/doc_views/doc_views_registry.ts b/src/legacy/core_plugins/kibana/public/discover/np_ready/doc_views/doc_views_registry.ts new file mode 100644 index 000000000000..1952ec3af2f6 --- /dev/null +++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/doc_views/doc_views_registry.ts @@ -0,0 +1,50 @@ +/* + * 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 { convertDirectiveToRenderFn } from './doc_views_helpers'; +import { DocView, DocViewInput, ElasticSearchHit, DocViewInputFn } from './doc_views_types'; +import { Chrome } from '../../kibana_services'; + +export class DocViewsRegistry { + private docViews: DocView[] = []; + + constructor(private legacyChrome: Chrome) {} + + /** + * Extends and adds the given doc view to the registry array + */ + addDocView(docViewRaw: DocViewInput | DocViewInputFn) { + const docView = typeof docViewRaw === 'function' ? docViewRaw() : docViewRaw; + if (docView.directive) { + // convert angular directive to render function for backwards compatibility + docView.render = convertDirectiveToRenderFn(docView.directive, this.legacyChrome); + } + if (typeof docView.shouldShow !== 'function') { + docView.shouldShow = () => true; + } + this.docViews.push(docView as DocView); + } + /** + * Returns a sorted array of doc_views for rendering tabs + */ + getDocViewsSorted(hit: ElasticSearchHit) { + return this.docViews + .filter(docView => docView.shouldShow(hit)) + .sort((a, b) => (Number(a.order) > Number(b.order) ? 1 : -1)); + } +} diff --git a/src/legacy/ui/public/registry/doc_views_types.ts b/src/legacy/core_plugins/kibana/public/discover/np_ready/doc_views/doc_views_types.ts similarity index 97% rename from src/legacy/ui/public/registry/doc_views_types.ts rename to src/legacy/core_plugins/kibana/public/discover/np_ready/doc_views/doc_views_types.ts index eb2a5bdc4b3b..92e18e7ea7b8 100644 --- a/src/legacy/ui/public/registry/doc_views_types.ts +++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/doc_views/doc_views_types.ts @@ -18,7 +18,7 @@ */ import { ComponentType } from 'react'; import { IScope } from 'angular'; -import { IndexPattern } from '../../../../plugins/data/public'; +import { IndexPattern } from '../../kibana_services'; export interface AngularDirective { controller: (scope: AngularScope) => void; diff --git a/src/legacy/core_plugins/kibana/public/discover/plugin.ts b/src/legacy/core_plugins/kibana/public/discover/plugin.ts index 0cff1e66f363..8f1eb7ef7555 100644 --- a/src/legacy/core_plugins/kibana/public/discover/plugin.ts +++ b/src/legacy/core_plugins/kibana/public/discover/plugin.ts @@ -16,20 +16,25 @@ * specific language governing permissions and limitations * under the License. */ +import { i18n } from '@kbn/i18n'; import { AppMountParameters, CoreSetup, CoreStart, Plugin } from 'kibana/public'; import angular from 'angular'; -import { IUiActionsStart } from 'src/plugins/ui_actions/public'; +import { IUiActionsSetup, IUiActionsStart } from 'src/plugins/ui_actions/public'; import { DataPublicPluginStart } from 'src/plugins/data/public'; import { registerFeature } from './np_ready/register_feature'; import './kibana_services'; import { IEmbeddableStart, IEmbeddableSetup } from '../../../../../plugins/embeddable/public'; import { getInnerAngularModule, getInnerAngularModuleEmbeddable } from './get_inner_angular'; -import { setAngularModule, setServices } from './kibana_services'; +import { Chrome, setAngularModule, setServices } from './kibana_services'; import { NavigationPublicPluginStart as NavigationStart } from '../../../../../plugins/navigation/public'; import { EuiUtilsStart } from '../../../../../plugins/eui_utils/public'; import { buildServices } from './build_services'; import { SharePluginStart } from '../../../../../plugins/share/public'; import { KibanaLegacySetup } from '../../../../../plugins/kibana_legacy/public'; +import { DocViewsRegistry } from './np_ready/doc_views/doc_views_registry'; +import { DocViewInput, DocViewInputFn } from './np_ready/doc_views/doc_views_types'; +import { DocViewTable } from './np_ready/components/table/table'; +import { JsonCodeBlock } from './np_ready/components/json_code_block/json_code_block'; import { HomePublicPluginSetup } from '../../../../../plugins/home/public'; /** @@ -37,12 +42,17 @@ import { HomePublicPluginSetup } from '../../../../../plugins/home/public'; * for other plugins to use in _their_ `SetupDeps`/`StartDeps` interfaces. * @public */ -export type DiscoverSetup = void; +export interface DiscoverSetup { + addDocView(docViewRaw: DocViewInput | DocViewInputFn): void; +} export type DiscoverStart = void; export interface DiscoverSetupPlugins { - uiActions: IUiActionsStart; + uiActions: IUiActionsSetup; embeddable: IEmbeddableSetup; kibana_legacy: KibanaLegacySetup; + __LEGACY: { + chrome: Chrome; + }; home: HomePublicPluginSetup; } export interface DiscoverStartPlugins { @@ -65,13 +75,30 @@ const embeddableAngularName = 'app/discoverEmbeddable'; export class DiscoverPlugin implements Plugin { private servicesInitialized: boolean = false; private innerAngularInitialized: boolean = false; + private docViewsRegistry: DocViewsRegistry | null = null; /** * why are those functions public? they are needed for some mocha tests * can be removed once all is Jest */ public initializeInnerAngular?: () => void; public initializeServices?: () => void; + setup(core: CoreSetup, plugins: DiscoverSetupPlugins): DiscoverSetup { + this.docViewsRegistry = new DocViewsRegistry(plugins.__LEGACY.chrome); + this.docViewsRegistry.addDocView({ + title: i18n.translate('kbn.discover.docViews.table.tableTitle', { + defaultMessage: 'Table', + }), + order: 10, + component: DocViewTable, + }); + this.docViewsRegistry.addDocView({ + title: i18n.translate('kbn.discover.docViews.json.jsonTitle', { + defaultMessage: 'JSON', + }), + order: 20, + component: JsonCodeBlock, + }); plugins.kibana_legacy.registerLegacyApp({ id: 'discover', title: 'Discover', @@ -91,6 +118,10 @@ export class DiscoverPlugin implements Plugin { }, }); registerFeature(plugins.home); + + return { + addDocView: this.docViewsRegistry.addDocView.bind(this.docViewsRegistry), + }; } start(core: CoreStart, plugins: DiscoverStartPlugins): DiscoverStart { @@ -112,7 +143,7 @@ export class DiscoverPlugin implements Plugin { if (this.servicesInitialized) { return; } - const services = await buildServices(core, plugins); + const services = await buildServices(core, plugins, this.docViewsRegistry!); setServices(services); this.servicesInitialized = true; }; diff --git a/src/legacy/ui/public/registry/doc_views.ts b/src/legacy/ui/public/registry/doc_views.ts deleted file mode 100644 index bf1e8416ae66..000000000000 --- a/src/legacy/ui/public/registry/doc_views.ts +++ /dev/null @@ -1,69 +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. - */ -import { convertDirectiveToRenderFn } from './doc_views_helpers'; -import { DocView, DocViewInput, ElasticSearchHit, DocViewInputFn } from './doc_views_types'; - -export { DocViewRenderProps, DocView, DocViewRenderFn } from './doc_views_types'; - -export interface DocViewsRegistry { - docViews: DocView[]; - addDocView: (docView: DocViewInput) => void; - getDocViewsSorted: (hit: ElasticSearchHit) => DocView[]; -} - -export const docViews: DocView[] = []; - -/** - * Extends and adds the given doc view to the registry array - */ -export function addDocView(docView: DocViewInput) { - if (docView.directive) { - // convert angular directive to render function for backwards compatibility - docView.render = convertDirectiveToRenderFn(docView.directive); - } - if (typeof docView.shouldShow !== 'function') { - docView.shouldShow = () => true; - } - docViews.push(docView as DocView); -} - -/** - * Empty array of doc views for testing - */ -export function emptyDocViews() { - docViews.length = 0; -} - -/** - * Returns a sorted array of doc_views for rendering tabs - */ -export function getDocViewsSorted(hit: ElasticSearchHit): DocView[] { - return docViews - .filter(docView => docView.shouldShow(hit)) - .sort((a, b) => (Number(a.order) > Number(b.order) ? 1 : -1)); -} -/** - * Provider for compatibility with 3rd Party plugins - */ -export const DocViewsRegistryProvider = { - register: (docViewRaw: DocViewInput | DocViewInputFn) => { - const docView = typeof docViewRaw === 'function' ? docViewRaw() : docViewRaw; - addDocView(docView); - }, -}; diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json index af43110a8ba5..09d71814e5bf 100644 --- a/x-pack/plugins/translations/translations/ja-JP.json +++ b/x-pack/plugins/translations/translations/ja-JP.json @@ -1850,6 +1850,25 @@ "kbn.discover.discoverDescription": "ドキュメントにクエリをかけたりフィルターを適用することで、データをインタラクティブに閲覧できます。", "kbn.discover.discoverTitle": "ディスカバー", "kbn.discover.documentsAriaLabel": "ドキュメント", + "kbn.discover.docViews.table.fieldNamesBeginningWithUnderscoreUnsupportedTooltip": "{underscoreSign} で始まるフィールド名はサポートされていません", + "kbn.discover.docViews.table.filterForFieldPresentButtonAriaLabel": "現在のフィールドのフィルター", + "kbn.discover.docViews.table.filterForFieldPresentButtonTooltip": "現在のフィールドのフィルター", + "kbn.discover.docViews.table.filterForValueButtonAriaLabel": "値でフィルタリング", + "kbn.discover.docViews.table.filterForValueButtonTooltip": "値でフィルタリング", + "kbn.discover.docViews.table.filterOutValueButtonAriaLabel": "値を除外", + "kbn.discover.docViews.table.filterOutValueButtonTooltip": "値を除外します", + "kbn.discover.docViews.table.noCachedMappingForThisFieldTooltip": "このフィールドのキャッシュされたマッピングがありません。管理 > インデックスパターンページからフィールドリストを更新してください", + "kbn.discover.docViews.table.tableTitle": "表", + "kbn.discover.docViews.table.toggleColumnInTableButtonAriaLabel": "表の列を切り替える", + "kbn.discover.docViews.table.toggleColumnInTableButtonTooltip": "表の列を切り替える", + "kbn.discover.docViews.table.unableToFilterForPresenceOfMetaFieldsTooltip": "メタフィールドの有無でフィルタリングできません", + "kbn.discover.docViews.table.unableToFilterForPresenceOfScriptedFieldsTooltip": "スクリプトフィールドの有無でフィルタリングできません", + "kbn.discover.docViews.table.unindexedFieldsCanNotBeSearchedTooltip": "インデックスされていないフィールドは検索できません", + "kbn.discover.docViews.json.codeEditorAriaLabel": "Elasticsearch ドキュメントの JSON ビューのみを読み込む", + "kbn.discover.docViews.json.jsonTitle": "JSON", + "kbn.discover.docViews.table.fieldNamesBeginningWithUnderscoreUnsupportedAriaLabel": "警告", + "kbn.discover.docViews.table.noCachedMappingForThisFieldAriaLabel": "警告", + "kbn.discover.docViews.table.toggleFieldDetails": "フィールド詳細を切り替える", "kbn.discover.errorLoadingData": "データの読み込み中にエラーが発生", "kbn.discover.fetchError.howToAddressErrorDescription": "このエラーは、{scriptedFields} タブにある {managementLink} の {fetchErrorScript} フィールドを編集することで解決できます。", "kbn.discover.fetchError.managmentLinkText": "管理 > インデックスパターン", @@ -2834,25 +2853,6 @@ "kbn.advancedSettings.courier.batchSearchesText": "無効の場合、ダッシュボードパネルは個々に読み込まれ、検索リクエストはユーザーが移動するか\n クエリを更新すると停止します。有効の場合、ダッシュボードパネルはすべてのデータが読み込まれると同時に読み込まれ、\n 検索は停止しません。", "kbn.doc.couldNotFindDocumentsDescription": "その ID に一致するドキュメントがありません。", "kbn.doc.somethingWentWrongDescription": "{indexName} が欠けています。", - "kbnDocViews.table.fieldNamesBeginningWithUnderscoreUnsupportedTooltip": "{underscoreSign} で始まるフィールド名はサポートされていません", - "kbnDocViews.table.filterForFieldPresentButtonAriaLabel": "現在のフィールドのフィルター", - "kbnDocViews.table.filterForFieldPresentButtonTooltip": "現在のフィールドのフィルター", - "kbnDocViews.table.filterForValueButtonAriaLabel": "値でフィルタリング", - "kbnDocViews.table.filterForValueButtonTooltip": "値でフィルタリング", - "kbnDocViews.table.filterOutValueButtonAriaLabel": "値を除外", - "kbnDocViews.table.filterOutValueButtonTooltip": "値を除外します", - "kbnDocViews.table.noCachedMappingForThisFieldTooltip": "このフィールドのキャッシュされたマッピングがありません。管理 > インデックスパターンページからフィールドリストを更新してください", - "kbnDocViews.table.tableTitle": "表", - "kbnDocViews.table.toggleColumnInTableButtonAriaLabel": "表の列を切り替える", - "kbnDocViews.table.toggleColumnInTableButtonTooltip": "表の列を切り替える", - "kbnDocViews.table.unableToFilterForPresenceOfMetaFieldsTooltip": "メタフィールドの有無でフィルタリングできません", - "kbnDocViews.table.unableToFilterForPresenceOfScriptedFieldsTooltip": "スクリプトフィールドの有無でフィルタリングできません", - "kbnDocViews.table.unindexedFieldsCanNotBeSearchedTooltip": "インデックスされていないフィールドは検索できません", - "kbnDocViews.json.codeEditorAriaLabel": "Elasticsearch ドキュメントの JSON ビューのみを読み込む", - "kbnDocViews.json.jsonTitle": "JSON", - "kbnDocViews.table.fieldNamesBeginningWithUnderscoreUnsupportedAriaLabel": "警告", - "kbnDocViews.table.noCachedMappingForThisFieldAriaLabel": "警告", - "kbnDocViews.table.toggleFieldDetails": "フィールド詳細を切り替える", "kbnVislibVisTypes.area.areaDescription": "折れ線グラフの下の数量を強調します。", "kbnVislibVisTypes.area.areaTitle": "エリア", "kbnVislibVisTypes.area.groupTitle": "系列を分割", @@ -12702,4 +12702,4 @@ "xpack.licensing.welcomeBanner.licenseIsExpiredDescription.updateYourLicenseLinkText": "ライセンスを更新", "xpack.licensing.welcomeBanner.licenseIsExpiredTitle": "ご使用の {licenseType} ライセンスは期限切れです" } -} \ No newline at end of file +} diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index 0306edcabd67..e221cba874bc 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -1851,6 +1851,25 @@ "kbn.discover.discoverDescription": "通过查询和筛选原始文档来以交互方式浏览您的数据。", "kbn.discover.discoverTitle": "Discover", "kbn.discover.documentsAriaLabel": "文档", + "kbn.discover.docViews.table.fieldNamesBeginningWithUnderscoreUnsupportedTooltip": "不支持以 {underscoreSign} 开头的字段名称", + "kbn.discover.docViews.table.filterForFieldPresentButtonAriaLabel": "筛留存在的字段", + "kbn.discover.docViews.table.filterForFieldPresentButtonTooltip": "筛留存在的字段", + "kbn.discover.docViews.table.filterForValueButtonAriaLabel": "筛留值", + "kbn.discover.docViews.table.filterForValueButtonTooltip": "筛留值", + "kbn.discover.docViews.table.filterOutValueButtonAriaLabel": "筛除值", + "kbn.discover.docViews.table.filterOutValueButtonTooltip": "筛除值", + "kbn.discover.docViews.table.noCachedMappingForThisFieldTooltip": "此字段没有任何已缓存映射。从“管理”>“索引模式”页面刷新字段列表", + "kbn.discover.docViews.table.tableTitle": "表", + "kbn.discover.docViews.table.toggleColumnInTableButtonAriaLabel": "在表中切换列", + "kbn.discover.docViews.table.toggleColumnInTableButtonTooltip": "在表中切换列", + "kbn.discover.docViews.table.unableToFilterForPresenceOfMetaFieldsTooltip": "无法筛留元数据字段", + "kbn.discover.docViews.table.unableToFilterForPresenceOfScriptedFieldsTooltip": "无法筛留脚本字段", + "kbn.discover.docViews.table.unindexedFieldsCanNotBeSearchedTooltip": "无法搜索未索引字段", + "kbn.discover.docViews.json.codeEditorAriaLabel": "Elasticsearch 文档的只读 JSON 视图", + "kbn.discover.docViews.json.jsonTitle": "JSON", + "kbn.discover.docViews.table.fieldNamesBeginningWithUnderscoreUnsupportedAriaLabel": "警告", + "kbn.discover.docViews.table.noCachedMappingForThisFieldAriaLabel": "警告", + "kbn.discover.docViews.table.toggleFieldDetails": "切换字段详细信息", "kbn.discover.errorLoadingData": "加载数据时出错", "kbn.discover.fetchError.howToAddressErrorDescription": "您可以通过编辑 “{scriptedFields}” 选项卡下 “{managementLink}” 中的 “{fetchErrorScript}” 字段来解决此错误。", "kbn.discover.fetchError.managmentLinkText": "管理 > 索引模式", @@ -2835,25 +2854,6 @@ "kbn.advancedSettings.courier.batchSearchesText": "禁用时,仪表板面板将分别加载,用户离开时或更新查询时,\n 搜索请求将终止。启用时,仪表板面板将一起加载并加载所有数据,\n 搜索将不会终止。", "kbn.doc.couldNotFindDocumentsDescription": "无文档匹配该 ID。", "kbn.doc.somethingWentWrongDescription": "{indexName} 缺失。", - "kbnDocViews.table.fieldNamesBeginningWithUnderscoreUnsupportedTooltip": "不支持以 {underscoreSign} 开头的字段名称", - "kbnDocViews.table.filterForFieldPresentButtonAriaLabel": "筛留存在的字段", - "kbnDocViews.table.filterForFieldPresentButtonTooltip": "筛留存在的字段", - "kbnDocViews.table.filterForValueButtonAriaLabel": "筛留值", - "kbnDocViews.table.filterForValueButtonTooltip": "筛留值", - "kbnDocViews.table.filterOutValueButtonAriaLabel": "筛除值", - "kbnDocViews.table.filterOutValueButtonTooltip": "筛除值", - "kbnDocViews.table.noCachedMappingForThisFieldTooltip": "此字段没有任何已缓存映射。从“管理”>“索引模式”页面刷新字段列表", - "kbnDocViews.table.tableTitle": "表", - "kbnDocViews.table.toggleColumnInTableButtonAriaLabel": "在表中切换列", - "kbnDocViews.table.toggleColumnInTableButtonTooltip": "在表中切换列", - "kbnDocViews.table.unableToFilterForPresenceOfMetaFieldsTooltip": "无法筛留元数据字段", - "kbnDocViews.table.unableToFilterForPresenceOfScriptedFieldsTooltip": "无法筛留脚本字段", - "kbnDocViews.table.unindexedFieldsCanNotBeSearchedTooltip": "无法搜索未索引字段", - "kbnDocViews.json.codeEditorAriaLabel": "Elasticsearch 文档的只读 JSON 视图", - "kbnDocViews.json.jsonTitle": "JSON", - "kbnDocViews.table.fieldNamesBeginningWithUnderscoreUnsupportedAriaLabel": "警告", - "kbnDocViews.table.noCachedMappingForThisFieldAriaLabel": "警告", - "kbnDocViews.table.toggleFieldDetails": "切换字段详细信息", "kbnVislibVisTypes.area.areaDescription": "突出折线图下方的数量", "kbnVislibVisTypes.area.areaTitle": "面积图", "kbnVislibVisTypes.area.groupTitle": "拆分序列", @@ -12791,4 +12791,4 @@ "xpack.licensing.welcomeBanner.licenseIsExpiredDescription.updateYourLicenseLinkText": "更新您的许可", "xpack.licensing.welcomeBanner.licenseIsExpiredTitle": "您的{licenseType}许可已过期" } -} \ No newline at end of file +}