mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
This commit is contained in:
parent
9c402bac08
commit
e2d7e2cbdd
5 changed files with 17 additions and 12 deletions
|
@ -20,4 +20,3 @@
|
|||
export { SEARCH_EMBEDDABLE_TYPE } from './constants';
|
||||
export * from './types';
|
||||
export * from './search_embeddable_factory';
|
||||
export * from './search_embeddable';
|
||||
|
|
|
@ -38,7 +38,7 @@ import * as columnActions from '../angular/doc_table/actions/columns';
|
|||
import searchTemplate from './search_template.html';
|
||||
import { ISearchEmbeddable, SearchInput, SearchOutput } from './types';
|
||||
import { SortOrder } from '../angular/doc_table/components/table_header/helpers';
|
||||
import { getSortForSearchSource } from '../angular/doc_table/lib/get_sort_for_search_source';
|
||||
import { getSortForSearchSource } from '../angular/doc_table';
|
||||
import {
|
||||
getRequestInspectorStats,
|
||||
getResponseInspectorStats,
|
||||
|
|
|
@ -28,8 +28,8 @@ import {
|
|||
} from '../../../../embeddable/public';
|
||||
|
||||
import { TimeRange } from '../../../../data/public';
|
||||
import { SearchEmbeddable } from './search_embeddable';
|
||||
import { SearchInput, SearchOutput } from './types';
|
||||
|
||||
import { SearchInput, SearchOutput, SearchEmbeddable } from './types';
|
||||
import { SEARCH_EMBEDDABLE_TYPE } from './constants';
|
||||
|
||||
interface StartServices {
|
||||
|
@ -92,7 +92,8 @@ export class SearchEmbeddableFactory
|
|||
const savedObject = await getServices().getSavedSearchById(savedObjectId);
|
||||
const indexPattern = savedObject.searchSource.getField('index');
|
||||
const { executeTriggerActions } = await this.getStartServices();
|
||||
return new SearchEmbeddable(
|
||||
const { SearchEmbeddable: SearchEmbeddableClass } = await import('./search_embeddable');
|
||||
return new SearchEmbeddableClass(
|
||||
{
|
||||
savedSearch: savedObject,
|
||||
$rootScope,
|
||||
|
|
|
@ -17,7 +17,12 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
import { EmbeddableInput, EmbeddableOutput, IEmbeddable } from 'src/plugins/embeddable/public';
|
||||
import {
|
||||
Embeddable,
|
||||
EmbeddableInput,
|
||||
EmbeddableOutput,
|
||||
IEmbeddable,
|
||||
} from 'src/plugins/embeddable/public';
|
||||
import { SortOrder } from '../angular/doc_table/components/table_header/helpers';
|
||||
import { Filter, IIndexPattern, TimeRange, Query } from '../../../../data/public';
|
||||
import { SavedSearch } from '../..';
|
||||
|
@ -40,3 +45,7 @@ export interface SearchOutput extends EmbeddableOutput {
|
|||
export interface ISearchEmbeddable extends IEmbeddable<SearchInput, SearchOutput> {
|
||||
getSavedSearch(): SavedSearch;
|
||||
}
|
||||
|
||||
export interface SearchEmbeddable extends Embeddable<SearchInput, SearchOutput> {
|
||||
type: string;
|
||||
}
|
||||
|
|
|
@ -66,6 +66,7 @@ import {
|
|||
DISCOVER_APP_URL_GENERATOR,
|
||||
DiscoverUrlGenerator,
|
||||
} from './url_generator';
|
||||
import { SearchEmbeddableFactory } from './application/embeddable';
|
||||
|
||||
declare module '../../share/public' {
|
||||
export interface UrlGeneratorStateMapping {
|
||||
|
@ -345,12 +346,7 @@ export class DiscoverPlugin
|
|||
/**
|
||||
* register embeddable with a slimmer embeddable version of inner angular
|
||||
*/
|
||||
private async registerEmbeddable(
|
||||
core: CoreSetup<DiscoverStartPlugins>,
|
||||
plugins: DiscoverSetupPlugins
|
||||
) {
|
||||
const { SearchEmbeddableFactory } = await import('./application/embeddable');
|
||||
|
||||
private registerEmbeddable(core: CoreSetup<DiscoverStartPlugins>, plugins: DiscoverSetupPlugins) {
|
||||
if (!this.getEmbeddableInjector) {
|
||||
throw Error('Discover plugin method getEmbeddableInjector is undefined');
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue