[Discover] Deangularization of search embeddable (#100552) (#102027)

* [Discover] Render empty embeddable

* First version of grid embeddable

* More search embeddable

* Almost stable version

* Fixing typescript errors

* Fixing filtering and sorting

* Add data-shared-item to DiscoverGridEmbeddable

* Trigger rerender when title changes

* Fixing incorrectly touched files

* Remove search_embeddable

* Remove lodash

* Fixing imports

* Minor fixes

* Removing unnecessary files

* Minor fix

* Remove unused import

* Applying PR comments

* Applying PR comments

* Removing search embeddable

* Fix missing import

* Addressing PR comments

* Do not memoize saved search component

* Applying Matthias's suggestion

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
# Conflicts:
#	api_docs/deprecations.mdx

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
Maja Grubic 2021-06-14 13:30:53 +01:00 committed by GitHub
parent 4f3041de79
commit df392554c3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 420 additions and 329 deletions

View file

@ -111,6 +111,8 @@ warning: This document is auto-generated and is meant to be viewed inside our ex
| <DocLink id="kibSavedObjectsPluginApi" section="def-public.SavedObject" text="SavedObject"/> | [clone_panel_action.tsx#L14](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/actions/clone_panel_action.tsx#L14) | - |
| <DocLink id="kibSavedObjectsPluginApi" section="def-public.SavedObject" text="SavedObject"/> | [clone_panel_action.tsx#L98](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/actions/clone_panel_action.tsx#L98) | - |
| <DocLink id="kibSavedObjectsPluginApi" section="def-public.SavedObject" text="SavedObject"/> | [clone_panel_action.tsx#L126](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/actions/clone_panel_action.tsx#L126) | - |
| <DocLink id="kibSavedObjectsPluginApi" section="def-public.SavedObject" text="SavedObject"/> | [use_dashboard_state_manager.ts#L23](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/hooks/use_dashboard_state_manager.ts#L23) | - |
| <DocLink id="kibSavedObjectsPluginApi" section="def-public.SavedObject" text="SavedObject"/> | [use_dashboard_state_manager.ts#L35](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/hooks/use_dashboard_state_manager.ts#L35) | - |
@ -127,8 +129,6 @@ warning: This document is auto-generated and is meant to be viewed inside our ex
| <DocLink id="kibDataPluginApi" section="def-public.IFieldType" text="IFieldType"/> | [search_embeddable.ts#L23](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/embeddable/search_embeddable.ts#L23) | - |
| <DocLink id="kibDataPluginApi" section="def-public.IFieldType" text="IFieldType"/> | [search_embeddable.ts#L59](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/embeddable/search_embeddable.ts#L59) | - |
| <DocLink id="kibDataPluginApi" section="def-common.IFieldType" text="IFieldType"/> | [kibana_services.ts#L104](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/kibana_services.ts#L104) | - |
| <DocLink id="kibDataPluginApi" section="def-common.IFieldType" text="IFieldType"/> | [search_embeddable.ts#L23](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/embeddable/search_embeddable.ts#L23) | - |
| <DocLink id="kibDataPluginApi" section="def-common.IFieldType" text="IFieldType"/> | [search_embeddable.ts#L59](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/embeddable/search_embeddable.ts#L59) | - |
| <DocLink id="kibDataPluginApi" section="def-common.IIndexPattern" text="IIndexPattern"/> | [kibana_services.ts#L101](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/kibana_services.ts#L101) | - |
| <DocLink id="kibDataPluginApi" section="def-common.IIndexPattern" text="IIndexPattern"/> | [create_doc_table_react.tsx#L15](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/angular/doc_table/create_doc_table_react.tsx#L15) | - |
| <DocLink id="kibDataPluginApi" section="def-common.IIndexPattern" text="IIndexPattern"/> | [create_doc_table_react.tsx#L25](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/angular/doc_table/create_doc_table_react.tsx#L25) | - |
@ -153,7 +153,7 @@ warning: This document is auto-generated and is meant to be viewed inside our ex
| Deprecated API | Reference location | Remove By |
| ---------------|-----------|-----------|
| <DocLink id="kibSavedObjectsPluginApi" section="def-public.SavedObjectSaveModal" text="SavedObjectSaveModal"/> | [attribute_service.tsx#L13](https://github.com/elastic/kibana/tree/master/src/plugins/embeddable/public/lib/attribute_service/attribute_service.tsx#L13) | - |
| <DocLink id="kibSavedObjectsPluginApi" section="def-public.SavedObjectSaveModal" text="SavedObjectSaveModal"/> | [attribute_service.tsx#L165](https://github.com/elastic/kibana/tree/master/src/plugins/embeddable/public/lib/attribute_service/attribute_service.tsx#L165) | - |
| <DocLink id="kibSavedObjectsPluginApi" section="def-public.SavedObjectSaveModal" text="SavedObjectSaveModal"/> | [attribute_service.tsx#L167](https://github.com/elastic/kibana/tree/master/src/plugins/embeddable/public/lib/attribute_service/attribute_service.tsx#L167) | - |
@ -189,7 +189,7 @@ warning: This document is auto-generated and is meant to be viewed inside our ex
| <DocLink id="kibDataPluginApi" section="def-server.IFieldType" text="IFieldType"/> | [query_bar.tsx#L30](https://github.com/elastic/kibana/tree/master/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/query_bar.tsx#L30) | - |
| <DocLink id="kibDataPluginApi" section="def-server.IFieldType" text="IFieldType"/> | [query_bar.tsx#L38](https://github.com/elastic/kibana/tree/master/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/query_bar.tsx#L38) | - |
| <DocLink id="kibCorePluginApi" section="def-server.AsyncPlugin" text="AsyncPlugin"/> | [plugin.ts#L14](https://github.com/elastic/kibana/tree/master/x-pack/plugins/fleet/server/plugin.ts#L14) | - |
| <DocLink id="kibCorePluginApi" section="def-server.AsyncPlugin" text="AsyncPlugin"/> | [plugin.ts#L190](https://github.com/elastic/kibana/tree/master/x-pack/plugins/fleet/server/plugin.ts#L190) | - |
| <DocLink id="kibCorePluginApi" section="def-server.AsyncPlugin" text="AsyncPlugin"/> | [plugin.ts#L189](https://github.com/elastic/kibana/tree/master/x-pack/plugins/fleet/server/plugin.ts#L189) | - |
| <DocLink id="kibCorePluginApi" section="def-server.AsyncPlugin" text="AsyncPlugin"/> | [plugin.d.ts#L2](https://github.com/elastic/kibana/tree/master/x-pack/plugins/fleet/target/types/server/plugin.d.ts#L2) | - |
| <DocLink id="kibCorePluginApi" section="def-server.AsyncPlugin" text="AsyncPlugin"/> | [plugin.d.ts#L84](https://github.com/elastic/kibana/tree/master/x-pack/plugins/fleet/target/types/server/plugin.d.ts#L84) | - |
@ -228,18 +228,18 @@ warning: This document is auto-generated and is meant to be viewed inside our ex
| Deprecated API | Reference location | Remove By |
| ---------------|-----------|-----------|
| <DocLink id="kibCorePluginApi" section="def-server.ILegacyCustomClusterClient" text="ILegacyCustomClusterClient"/> | [plugin.ts#L12](https://github.com/elastic/kibana/tree/master/x-pack/plugins/index_management/server/plugin.ts#L12) | 7.16 |
| <DocLink id="kibCorePluginApi" section="def-server.ILegacyCustomClusterClient" text="ILegacyCustomClusterClient"/> | [plugin.ts#L38](https://github.com/elastic/kibana/tree/master/x-pack/plugins/index_management/server/plugin.ts#L38) | 7.16 |
| <DocLink id="kibCorePluginApi" section="def-server.ILegacyCustomClusterClient" text="ILegacyCustomClusterClient"/> | [plugin.ts#L14](https://github.com/elastic/kibana/tree/master/x-pack/plugins/index_management/server/plugin.ts#L14) | 7.16 |
| <DocLink id="kibCorePluginApi" section="def-server.ILegacyCustomClusterClient" text="ILegacyCustomClusterClient"/> | [plugin.ts#L42](https://github.com/elastic/kibana/tree/master/x-pack/plugins/index_management/server/plugin.ts#L42) | 7.16 |
| <DocLink id="kibCorePluginApi" section="def-server.LegacyScopedClusterClient" text="LegacyScopedClusterClient"/> | [types.ts#L9](https://github.com/elastic/kibana/tree/master/x-pack/plugins/index_management/server/types.ts#L9) | 7.16 |
| <DocLink id="kibCorePluginApi" section="def-server.LegacyScopedClusterClient" text="LegacyScopedClusterClient"/> | [types.ts#L39](https://github.com/elastic/kibana/tree/master/x-pack/plugins/index_management/server/types.ts#L39) | 7.16 |
| <DocLink id="kibCorePluginApi" section="def-server.LegacyScopedClusterClient" text="LegacyScopedClusterClient"/> | [types.ts#L40](https://github.com/elastic/kibana/tree/master/x-pack/plugins/index_management/server/types.ts#L40) | 7.16 |
| <DocLink id="kibCorePluginApi" section="def-server.LegacyScopedClusterClient" text="LegacyScopedClusterClient"/> | [types.d.ts#L1](https://github.com/elastic/kibana/tree/master/x-pack/plugins/index_management/target/types/server/types.d.ts#L1) | 7.16 |
| <DocLink id="kibCorePluginApi" section="def-server.LegacyScopedClusterClient" text="LegacyScopedClusterClient"/> | [types.d.ts#L24](https://github.com/elastic/kibana/tree/master/x-pack/plugins/index_management/target/types/server/types.d.ts#L24) | 7.16 |
| <DocLink id="kibCorePluginApi" section="def-server.LegacyScopedClusterClient" text="LegacyScopedClusterClient"/> | [types.d.ts#L25](https://github.com/elastic/kibana/tree/master/x-pack/plugins/index_management/target/types/server/types.d.ts#L25) | 7.16 |
| <DocLink id="kibCorePluginApi" section="def-server.ILegacyScopedClusterClient" text="ILegacyScopedClusterClient"/> | [types.ts#L10](https://github.com/elastic/kibana/tree/master/x-pack/plugins/index_management/server/types.ts#L10) | 7.16 |
| <DocLink id="kibCorePluginApi" section="def-server.ILegacyScopedClusterClient" text="ILegacyScopedClusterClient"/> | [types.ts#L42](https://github.com/elastic/kibana/tree/master/x-pack/plugins/index_management/server/types.ts#L42) | 7.16 |
| <DocLink id="kibCorePluginApi" section="def-server.ILegacyScopedClusterClient" text="ILegacyScopedClusterClient"/> | [types.ts#L49](https://github.com/elastic/kibana/tree/master/x-pack/plugins/index_management/server/types.ts#L49) | 7.16 |
| <DocLink id="kibCorePluginApi" section="def-server.ILegacyScopedClusterClient" text="ILegacyScopedClusterClient"/> | [types.ts#L43](https://github.com/elastic/kibana/tree/master/x-pack/plugins/index_management/server/types.ts#L43) | 7.16 |
| <DocLink id="kibCorePluginApi" section="def-server.ILegacyScopedClusterClient" text="ILegacyScopedClusterClient"/> | [types.ts#L50](https://github.com/elastic/kibana/tree/master/x-pack/plugins/index_management/server/types.ts#L50) | 7.16 |
| <DocLink id="kibCorePluginApi" section="def-server.ILegacyScopedClusterClient" text="ILegacyScopedClusterClient"/> | [types.d.ts#L1](https://github.com/elastic/kibana/tree/master/x-pack/plugins/index_management/target/types/server/types.d.ts#L1) | 7.16 |
| <DocLink id="kibCorePluginApi" section="def-server.ILegacyScopedClusterClient" text="ILegacyScopedClusterClient"/> | [types.d.ts#L26](https://github.com/elastic/kibana/tree/master/x-pack/plugins/index_management/target/types/server/types.d.ts#L26) | 7.16 |
| <DocLink id="kibCorePluginApi" section="def-server.ILegacyScopedClusterClient" text="ILegacyScopedClusterClient"/> | [types.d.ts#L32](https://github.com/elastic/kibana/tree/master/x-pack/plugins/index_management/target/types/server/types.d.ts#L32) | 7.16 |
| <DocLink id="kibCorePluginApi" section="def-server.ILegacyScopedClusterClient" text="ILegacyScopedClusterClient"/> | [types.d.ts#L27](https://github.com/elastic/kibana/tree/master/x-pack/plugins/index_management/target/types/server/types.d.ts#L27) | 7.16 |
| <DocLink id="kibCorePluginApi" section="def-server.ILegacyScopedClusterClient" text="ILegacyScopedClusterClient"/> | [types.d.ts#L33](https://github.com/elastic/kibana/tree/master/x-pack/plugins/index_management/target/types/server/types.d.ts#L33) | 7.16 |
@ -578,6 +578,11 @@ warning: This document is auto-generated and is meant to be viewed inside our ex
| <DocLink id="kibDataPluginApi" section="def-server.IFieldType" text="IFieldType"/> | [custom_metric_form.d.ts#L8](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/target/types/public/pages/metrics/inventory_view/components/waffle/metric_control/custom_metric_form.d.ts#L8) | - |
| <DocLink id="kibDataPluginApi" section="def-server.IFieldType" text="IFieldType"/> | [index.d.ts#L1](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/target/types/public/pages/metrics/inventory_view/components/waffle/metric_control/index.d.ts#L1) | - |
| <DocLink id="kibDataPluginApi" section="def-server.IFieldType" text="IFieldType"/> | [index.d.ts#L9](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/target/types/public/pages/metrics/inventory_view/components/waffle/metric_control/index.d.ts#L9) | - |
| <DocLink id="kibCorePluginApi" section="def-server.ILegacyScopedClusterClient" text="ILegacyScopedClusterClient"/> | [log_entry_categories_analysis.ts#L9](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/server/lib/log_analysis/log_entry_categories_analysis.ts#L9) | 7.16 |
| <DocLink id="kibCorePluginApi" section="def-server.ILegacyScopedClusterClient" text="ILegacyScopedClusterClient"/> | [log_entry_categories_analysis.ts#L139](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/server/lib/log_analysis/log_entry_categories_analysis.ts#L139) | 7.16 |
| <DocLink id="kibCorePluginApi" section="def-server.ILegacyScopedClusterClient" text="ILegacyScopedClusterClient"/> | [log_entry_categories_analysis.ts#L405](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/server/lib/log_analysis/log_entry_categories_analysis.ts#L405) | 7.16 |
| <DocLink id="kibCorePluginApi" section="def-server.ILegacyScopedClusterClient" text="ILegacyScopedClusterClient"/> | [log_entry_categories_analysis.d.ts#L1](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/target/types/server/lib/log_analysis/log_entry_categories_analysis.d.ts#L1) | 7.16 |
| <DocLink id="kibCorePluginApi" section="def-server.ILegacyScopedClusterClient" text="ILegacyScopedClusterClient"/> | [log_entry_categories_analysis.d.ts#L58](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/target/types/server/lib/log_analysis/log_entry_categories_analysis.d.ts#L58) | 7.16 |
@ -587,8 +592,6 @@ warning: This document is auto-generated and is meant to be viewed inside our ex
| ---------------|-----------|-----------|
| <DocLink id="kibDataPluginApi" section="def-public.IIndexPattern" text="IIndexPattern"/> | [embeddable.tsx#L14](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/editor_frame_service/embeddable/embeddable.tsx#L14) | - |
| <DocLink id="kibDataPluginApi" section="def-public.IIndexPattern" text="IIndexPattern"/> | [embeddable.tsx#L85](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/editor_frame_service/embeddable/embeddable.tsx#L85) | - |
| <DocLink id="kibDataPluginApi" section="def-public.IIndexPattern" text="IIndexPattern"/> | [index.tsx#L25](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/terms/index.tsx#L25) | - |
| <DocLink id="kibDataPluginApi" section="def-public.IIndexPattern" text="IIndexPattern"/> | [index.tsx#L102](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/terms/index.tsx#L102) | - |
| <DocLink id="kibDataPluginApi" section="def-public.IIndexPattern" text="IIndexPattern"/> | [field_item.tsx#L47](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/field_item.tsx#L47) | - |
| <DocLink id="kibDataPluginApi" section="def-public.IIndexPattern" text="IIndexPattern"/> | [field_item.tsx#L172](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/field_item.tsx#L172) | - |
| <DocLink id="kibDataPluginApi" section="def-public.IIndexPattern" text="IIndexPattern"/> | [datapanel.tsx#L42](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/datapanel.tsx#L42) | - |
@ -603,10 +606,10 @@ warning: This document is auto-generated and is meant to be viewed inside our ex
| <DocLink id="kibDataPluginApi" section="def-public.IFieldType" text="IFieldType"/> | [types.ts#L8](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/types.ts#L8) | - |
| <DocLink id="kibDataPluginApi" section="def-public.IFieldType" text="IFieldType"/> | [types.ts#L57](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/types.ts#L57) | - |
| <DocLink id="kibDataPluginApi" section="def-public.IFieldType" text="IFieldType"/> | [field_stats.ts#L11](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#L11) | - |
| <DocLink id="kibDataPluginApi" section="def-public.IFieldType" text="IFieldType"/> | [field_stats.ts#L141](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#L141) | - |
| <DocLink id="kibDataPluginApi" section="def-public.IFieldType" text="IFieldType"/> | [field_stats.ts#L250](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#L250) | - |
| <DocLink id="kibDataPluginApi" section="def-public.IFieldType" text="IFieldType"/> | [field_stats.ts#L290](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#L290) | - |
| <DocLink id="kibDataPluginApi" section="def-public.IFieldType" text="IFieldType"/> | [field_stats.ts#L332](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#L332) | - |
| <DocLink id="kibDataPluginApi" section="def-public.IFieldType" text="IFieldType"/> | [field_stats.ts#L139](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#L139) | - |
| <DocLink id="kibDataPluginApi" section="def-public.IFieldType" text="IFieldType"/> | [field_stats.ts#L248](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#L248) | - |
| <DocLink id="kibDataPluginApi" section="def-public.IFieldType" text="IFieldType"/> | [field_stats.ts#L287](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#L287) | - |
| <DocLink id="kibDataPluginApi" section="def-public.IFieldType" text="IFieldType"/> | [field_stats.ts#L329](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#L329) | - |
| <DocLink id="kibDataPluginApi" section="def-public.IFieldType" text="IFieldType"/> | [types.d.ts#L1](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/target/types/public/indexpattern_datasource/types.d.ts#L1) | - |
| <DocLink id="kibDataPluginApi" section="def-public.IFieldType" text="IFieldType"/> | [types.d.ts#L22](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/target/types/public/indexpattern_datasource/types.d.ts#L22) | - |
| <DocLink id="kibDataPluginApi" section="def-public.IFieldType" text="IFieldType"/> | [field_stats.d.ts#L3](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/target/types/server/routes/field_stats.d.ts#L3) | - |
@ -618,10 +621,10 @@ warning: This document is auto-generated and is meant to be viewed inside our ex
| <DocLink id="kibDataPluginApi" section="def-common.IFieldType" text="IFieldType"/> | [types.ts#L8](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/types.ts#L8) | - |
| <DocLink id="kibDataPluginApi" section="def-common.IFieldType" text="IFieldType"/> | [types.ts#L57](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/types.ts#L57) | - |
| <DocLink id="kibDataPluginApi" section="def-common.IFieldType" text="IFieldType"/> | [field_stats.ts#L11](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#L11) | - |
| <DocLink id="kibDataPluginApi" section="def-common.IFieldType" text="IFieldType"/> | [field_stats.ts#L141](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#L141) | - |
| <DocLink id="kibDataPluginApi" section="def-common.IFieldType" text="IFieldType"/> | [field_stats.ts#L250](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#L250) | - |
| <DocLink id="kibDataPluginApi" section="def-common.IFieldType" text="IFieldType"/> | [field_stats.ts#L290](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#L290) | - |
| <DocLink id="kibDataPluginApi" section="def-common.IFieldType" text="IFieldType"/> | [field_stats.ts#L332](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#L332) | - |
| <DocLink id="kibDataPluginApi" section="def-common.IFieldType" text="IFieldType"/> | [field_stats.ts#L139](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#L139) | - |
| <DocLink id="kibDataPluginApi" section="def-common.IFieldType" text="IFieldType"/> | [field_stats.ts#L248](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#L248) | - |
| <DocLink id="kibDataPluginApi" section="def-common.IFieldType" text="IFieldType"/> | [field_stats.ts#L287](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#L287) | - |
| <DocLink id="kibDataPluginApi" section="def-common.IFieldType" text="IFieldType"/> | [field_stats.ts#L329](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#L329) | - |
| <DocLink id="kibDataPluginApi" section="def-common.IFieldType" text="IFieldType"/> | [types.d.ts#L1](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/target/types/public/indexpattern_datasource/types.d.ts#L1) | - |
| <DocLink id="kibDataPluginApi" section="def-common.IFieldType" text="IFieldType"/> | [types.d.ts#L22](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/target/types/public/indexpattern_datasource/types.d.ts#L22) | - |
| <DocLink id="kibDataPluginApi" section="def-common.IFieldType" text="IFieldType"/> | [field_stats.d.ts#L3](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/target/types/server/routes/field_stats.d.ts#L3) | - |
@ -630,8 +633,6 @@ warning: This document is auto-generated and is meant to be viewed inside our ex
| <DocLink id="kibDataPluginApi" section="def-common.IFieldType" text="IFieldType"/> | [field_stats.d.ts#L9](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/target/types/server/routes/field_stats.d.ts#L9) | - |
| <DocLink id="kibDataPluginApi" section="def-common.IIndexPattern" text="IIndexPattern"/> | [embeddable.tsx#L14](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/editor_frame_service/embeddable/embeddable.tsx#L14) | - |
| <DocLink id="kibDataPluginApi" section="def-common.IIndexPattern" text="IIndexPattern"/> | [embeddable.tsx#L85](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/editor_frame_service/embeddable/embeddable.tsx#L85) | - |
| <DocLink id="kibDataPluginApi" section="def-common.IIndexPattern" text="IIndexPattern"/> | [index.tsx#L25](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/terms/index.tsx#L25) | - |
| <DocLink id="kibDataPluginApi" section="def-common.IIndexPattern" text="IIndexPattern"/> | [index.tsx#L102](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/terms/index.tsx#L102) | - |
| <DocLink id="kibDataPluginApi" section="def-common.IIndexPattern" text="IIndexPattern"/> | [field_item.tsx#L47](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/field_item.tsx#L47) | - |
| <DocLink id="kibDataPluginApi" section="def-common.IIndexPattern" text="IIndexPattern"/> | [field_item.tsx#L172](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/field_item.tsx#L172) | - |
| <DocLink id="kibDataPluginApi" section="def-common.IIndexPattern" text="IIndexPattern"/> | [datapanel.tsx#L42](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/datapanel.tsx#L42) | - |
@ -646,10 +647,10 @@ warning: This document is auto-generated and is meant to be viewed inside our ex
| <DocLink id="kibDataPluginApi" section="def-server.IFieldType" text="IFieldType"/> | [types.ts#L8](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/types.ts#L8) | - |
| <DocLink id="kibDataPluginApi" section="def-server.IFieldType" text="IFieldType"/> | [types.ts#L57](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/types.ts#L57) | - |
| <DocLink id="kibDataPluginApi" section="def-server.IFieldType" text="IFieldType"/> | [field_stats.ts#L11](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#L11) | - |
| <DocLink id="kibDataPluginApi" section="def-server.IFieldType" text="IFieldType"/> | [field_stats.ts#L141](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#L141) | - |
| <DocLink id="kibDataPluginApi" section="def-server.IFieldType" text="IFieldType"/> | [field_stats.ts#L250](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#L250) | - |
| <DocLink id="kibDataPluginApi" section="def-server.IFieldType" text="IFieldType"/> | [field_stats.ts#L290](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#L290) | - |
| <DocLink id="kibDataPluginApi" section="def-server.IFieldType" text="IFieldType"/> | [field_stats.ts#L332](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#L332) | - |
| <DocLink id="kibDataPluginApi" section="def-server.IFieldType" text="IFieldType"/> | [field_stats.ts#L139](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#L139) | - |
| <DocLink id="kibDataPluginApi" section="def-server.IFieldType" text="IFieldType"/> | [field_stats.ts#L248](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#L248) | - |
| <DocLink id="kibDataPluginApi" section="def-server.IFieldType" text="IFieldType"/> | [field_stats.ts#L287](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#L287) | - |
| <DocLink id="kibDataPluginApi" section="def-server.IFieldType" text="IFieldType"/> | [field_stats.ts#L329](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#L329) | - |
| <DocLink id="kibDataPluginApi" section="def-server.IFieldType" text="IFieldType"/> | [types.d.ts#L1](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/target/types/public/indexpattern_datasource/types.d.ts#L1) | - |
| <DocLink id="kibDataPluginApi" section="def-server.IFieldType" text="IFieldType"/> | [types.d.ts#L22](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/target/types/public/indexpattern_datasource/types.d.ts#L22) | - |
| <DocLink id="kibDataPluginApi" section="def-server.IFieldType" text="IFieldType"/> | [field_stats.d.ts#L3](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/target/types/server/routes/field_stats.d.ts#L3) | - |
@ -935,7 +936,7 @@ warning: This document is auto-generated and is meant to be viewed inside our ex
| Deprecated API | Reference location | Remove By |
| ---------------|-----------|-----------|
| <DocLink id="kibDataPluginApi" section="def-public.IIndexPattern" text="IIndexPattern"/> | [types.ts#L8](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/embeddable/types.ts#L8) | - |
| <DocLink id="kibDataPluginApi" section="def-public.IIndexPattern" text="IIndexPattern"/> | [types.ts#L44](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/embeddable/types.ts#L44) | - |
| <DocLink id="kibDataPluginApi" section="def-public.IIndexPattern" text="IIndexPattern"/> | [types.ts#L45](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/embeddable/types.ts#L45) | - |
| <DocLink id="kibDataPluginApi" section="def-public.IFieldType" text="IFieldType"/> | [es_doc_field.ts#L12](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/fields/es_doc_field.ts#L12) | - |
| <DocLink id="kibDataPluginApi" section="def-public.IFieldType" text="IFieldType"/> | [es_doc_field.ts#L45](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/fields/es_doc_field.ts#L45) | - |
| <DocLink id="kibDataPluginApi" section="def-public.IFieldType" text="IFieldType"/> | [es_source.ts#L10](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_source/es_source.ts#L10) | - |
@ -1125,7 +1126,7 @@ warning: This document is auto-generated and is meant to be viewed inside our ex
| <DocLink id="kibDataPluginApi" section="def-common.IFieldType" text="IFieldType"/> | [get_docvalue_source_fields.test.ts#L10](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_search_source/get_docvalue_source_fields.test.ts#L10) | - |
| <DocLink id="kibDataPluginApi" section="def-common.IFieldType" text="IFieldType"/> | [get_docvalue_source_fields.test.ts#L12](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_search_source/get_docvalue_source_fields.test.ts#L12) | - |
| <DocLink id="kibDataPluginApi" section="def-common.IIndexPattern" text="IIndexPattern"/> | [types.ts#L8](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/embeddable/types.ts#L8) | - |
| <DocLink id="kibDataPluginApi" section="def-common.IIndexPattern" text="IIndexPattern"/> | [types.ts#L44](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/embeddable/types.ts#L44) | - |
| <DocLink id="kibDataPluginApi" section="def-common.IIndexPattern" text="IIndexPattern"/> | [types.ts#L45](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/embeddable/types.ts#L45) | - |
| <DocLink id="kibDataPluginApi" section="def-server.IFieldType" text="IFieldType"/> | [es_doc_field.ts#L12](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/fields/es_doc_field.ts#L12) | - |
| <DocLink id="kibDataPluginApi" section="def-server.IFieldType" text="IFieldType"/> | [es_doc_field.ts#L45](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/fields/es_doc_field.ts#L45) | - |
| <DocLink id="kibDataPluginApi" section="def-server.IFieldType" text="IFieldType"/> | [es_source.ts#L10](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_source/es_source.ts#L10) | - |
@ -1359,8 +1360,8 @@ warning: This document is auto-generated and is meant to be viewed inside our ex
| <DocLink id="kibCorePluginApi" section="def-server.ILegacyCustomClusterClient" text="ILegacyCustomClusterClient"/> | [static_globals.ts#L18](https://github.com/elastic/kibana/tree/master/x-pack/plugins/monitoring/server/static_globals.ts#L18) | 7.16 |
| <DocLink id="kibCorePluginApi" section="def-server.ILegacyCustomClusterClient" text="ILegacyCustomClusterClient"/> | [static_globals.ts#L43](https://github.com/elastic/kibana/tree/master/x-pack/plugins/monitoring/server/static_globals.ts#L43) | 7.16 |
| <DocLink id="kibCorePluginApi" section="def-server.ILegacyCustomClusterClient" text="ILegacyCustomClusterClient"/> | [plugin.ts#L18](https://github.com/elastic/kibana/tree/master/x-pack/plugins/monitoring/server/plugin.ts#L18) | 7.16 |
| <DocLink id="kibCorePluginApi" section="def-server.ILegacyCustomClusterClient" text="ILegacyCustomClusterClient"/> | [plugin.ts#L75](https://github.com/elastic/kibana/tree/master/x-pack/plugins/monitoring/server/plugin.ts#L75) | 7.16 |
| <DocLink id="kibCorePluginApi" section="def-server.ILegacyCustomClusterClient" text="ILegacyCustomClusterClient"/> | [plugin.ts#L288](https://github.com/elastic/kibana/tree/master/x-pack/plugins/monitoring/server/plugin.ts#L288) | 7.16 |
| <DocLink id="kibCorePluginApi" section="def-server.ILegacyCustomClusterClient" text="ILegacyCustomClusterClient"/> | [plugin.ts#L74](https://github.com/elastic/kibana/tree/master/x-pack/plugins/monitoring/server/plugin.ts#L74) | 7.16 |
| <DocLink id="kibCorePluginApi" section="def-server.ILegacyCustomClusterClient" text="ILegacyCustomClusterClient"/> | [plugin.ts#L279](https://github.com/elastic/kibana/tree/master/x-pack/plugins/monitoring/server/plugin.ts#L279) | 7.16 |
| <DocLink id="kibCorePluginApi" section="def-server.ILegacyCustomClusterClient" text="ILegacyCustomClusterClient"/> | [types.d.ts#L2](https://github.com/elastic/kibana/tree/master/x-pack/plugins/monitoring/target/types/server/types.d.ts#L2) | 7.16 |
| <DocLink id="kibCorePluginApi" section="def-server.ILegacyCustomClusterClient" text="ILegacyCustomClusterClient"/> | [types.d.ts#L47](https://github.com/elastic/kibana/tree/master/x-pack/plugins/monitoring/target/types/server/types.d.ts#L47) | 7.16 |
| <DocLink id="kibCorePluginApi" section="def-server.ILegacyCustomClusterClient" text="ILegacyCustomClusterClient"/> | [plugin.d.ts#L1](https://github.com/elastic/kibana/tree/master/x-pack/plugins/monitoring/target/types/server/plugin.d.ts#L1) | 7.16 |
@ -1449,22 +1450,22 @@ warning: This document is auto-generated and is meant to be viewed inside our ex
| Deprecated API | Reference location | Remove By |
| ---------------|-----------|-----------|
| <DocLink id="kibDataPluginApi" section="def-public.IIndexPattern" text="IIndexPattern"/> | [types.ts#L19](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/types.ts#L19) | - |
| <DocLink id="kibDataPluginApi" section="def-public.IIndexPattern" text="IIndexPattern"/> | [types.ts#L104](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/types.ts#L104) | - |
| <DocLink id="kibDataPluginApi" section="def-public.IIndexPattern" text="IIndexPattern"/> | [types.ts#L18](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/types.ts#L18) | - |
| <DocLink id="kibDataPluginApi" section="def-public.IIndexPattern" text="IIndexPattern"/> | [types.ts#L95](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/types.ts#L95) | - |
| <DocLink id="kibDataPluginApi" section="def-public.IIndexPattern" text="IIndexPattern"/> | [utils.ts#L10](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts#L10) | - |
| <DocLink id="kibDataPluginApi" section="def-public.IIndexPattern" text="IIndexPattern"/> | [utils.ts#L53](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts#L53) | - |
| <DocLink id="kibDataPluginApi" section="def-public.IIndexPattern" text="IIndexPattern"/> | [utils.ts#L61](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts#L61) | - |
| <DocLink id="kibDataPluginApi" section="def-public.IIndexPattern" text="IIndexPattern"/> | [utils.ts#L69](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts#L69) | - |
| <DocLink id="kibDataPluginApi" section="def-public.IIndexPattern" text="IIndexPattern"/> | [default_configs.ts#L19](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/default_configs.ts#L19) | - |
| <DocLink id="kibDataPluginApi" section="def-public.IIndexPattern" text="IIndexPattern"/> | [default_configs.ts#L25](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/default_configs.ts#L25) | - |
| <DocLink id="kibDataPluginApi" section="def-common.IIndexPattern" text="IIndexPattern"/> | [types.ts#L19](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/types.ts#L19) | - |
| <DocLink id="kibDataPluginApi" section="def-common.IIndexPattern" text="IIndexPattern"/> | [types.ts#L104](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/types.ts#L104) | - |
| <DocLink id="kibDataPluginApi" section="def-public.IIndexPattern" text="IIndexPattern"/> | [default_configs.ts#L24](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/default_configs.ts#L24) | - |
| <DocLink id="kibDataPluginApi" section="def-common.IIndexPattern" text="IIndexPattern"/> | [types.ts#L18](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/types.ts#L18) | - |
| <DocLink id="kibDataPluginApi" section="def-common.IIndexPattern" text="IIndexPattern"/> | [types.ts#L95](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/types.ts#L95) | - |
| <DocLink id="kibDataPluginApi" section="def-common.IIndexPattern" text="IIndexPattern"/> | [utils.ts#L10](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts#L10) | - |
| <DocLink id="kibDataPluginApi" section="def-common.IIndexPattern" text="IIndexPattern"/> | [utils.ts#L53](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts#L53) | - |
| <DocLink id="kibDataPluginApi" section="def-common.IIndexPattern" text="IIndexPattern"/> | [utils.ts#L61](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts#L61) | - |
| <DocLink id="kibDataPluginApi" section="def-common.IIndexPattern" text="IIndexPattern"/> | [utils.ts#L69](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts#L69) | - |
| <DocLink id="kibDataPluginApi" section="def-common.IIndexPattern" text="IIndexPattern"/> | [default_configs.ts#L19](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/default_configs.ts#L19) | - |
| <DocLink id="kibDataPluginApi" section="def-common.IIndexPattern" text="IIndexPattern"/> | [default_configs.ts#L25](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/default_configs.ts#L25) | - |
| <DocLink id="kibDataPluginApi" section="def-common.IIndexPattern" text="IIndexPattern"/> | [default_configs.ts#L24](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/default_configs.ts#L24) | - |
@ -1540,9 +1541,9 @@ warning: This document is auto-generated and is meant to be viewed inside our ex
| Deprecated API | Reference location | Remove By |
| ---------------|-----------|-----------|
| <DocLink id="kibDataPluginApi" section="def-public.IIndexPattern" text="IIndexPattern"/> | [types.ts#L22](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/types.ts#L22) | - |
| <DocLink id="kibDataPluginApi" section="def-public.IIndexPattern" text="IIndexPattern"/> | [types.ts#L72](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/types.ts#L72) | - |
| <DocLink id="kibDataPluginApi" section="def-public.IIndexPattern" text="IIndexPattern"/> | [action.ts#L20](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/action.ts#L20) | - |
| <DocLink id="kibDataPluginApi" section="def-public.IIndexPattern" text="IIndexPattern"/> | [types.ts#L21](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/types.ts#L21) | - |
| <DocLink id="kibDataPluginApi" section="def-public.IIndexPattern" text="IIndexPattern"/> | [types.ts#L66](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/types.ts#L66) | - |
| <DocLink id="kibDataPluginApi" section="def-public.IIndexPattern" text="IIndexPattern"/> | [action.ts#L19](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/action.ts#L19) | - |
| <DocLink id="kibDataPluginApi" section="def-public.IIndexPattern" text="IIndexPattern"/> | [action.ts#L100](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/action.ts#L100) | - |
| <DocLink id="kibDataPluginApi" section="def-public.IIndexPattern" text="IIndexPattern"/> | [index.ts#L8](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/common/search_strategy/index_fields/index.ts#L8) | - |
| <DocLink id="kibDataPluginApi" section="def-public.IIndexPattern" text="IIndexPattern"/> | [index.ts#L86](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/common/search_strategy/index_fields/index.ts#L86) | - |
@ -1579,9 +1580,9 @@ warning: This document is auto-generated and is meant to be viewed inside our ex
| <DocLink id="kibDataPluginApi" section="def-public.IIndexPattern" text="IIndexPattern"/> | [types.ts#L41](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/network/pages/details/types.ts#L41) | - |
| <DocLink id="kibDataPluginApi" section="def-public.IIndexPattern" text="IIndexPattern"/> | [index.tsx#L12](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/network/components/network_top_countries_table/index.tsx#L12) | - |
| <DocLink id="kibDataPluginApi" section="def-public.IIndexPattern" text="IIndexPattern"/> | [index.tsx#L34](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/network/components/network_top_countries_table/index.tsx#L34) | - |
| <DocLink id="kibDataPluginApi" section="def-public.IIndexPattern" text="IIndexPattern"/> | [middleware.ts#L48](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts#L48) | - |
| <DocLink id="kibDataPluginApi" section="def-public.IIndexPattern" text="IIndexPattern"/> | [middleware.ts#L64](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts#L64) | - |
| <DocLink id="kibDataPluginApi" section="def-public.IIndexPattern" text="IIndexPattern"/> | [middleware.ts#L69](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts#L69) | - |
| <DocLink id="kibDataPluginApi" section="def-public.IIndexPattern" text="IIndexPattern"/> | [middleware.ts#L44](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts#L44) | - |
| <DocLink id="kibDataPluginApi" section="def-public.IIndexPattern" text="IIndexPattern"/> | [middleware.ts#L60](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts#L60) | - |
| <DocLink id="kibDataPluginApi" section="def-public.IIndexPattern" text="IIndexPattern"/> | [middleware.ts#L65](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts#L65) | - |
| <DocLink id="kibDataPluginApi" section="def-public.IIndexPattern" text="IIndexPattern"/> | [types.ts#L12](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/detections/components/rules/description_step/types.ts#L12) | - |
| <DocLink id="kibDataPluginApi" section="def-public.IIndexPattern" text="IIndexPattern"/> | [types.ts#L28](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/detections/components/rules/description_step/types.ts#L28) | - |
| <DocLink id="kibDataPluginApi" section="def-public.IIndexPattern" text="IIndexPattern"/> | [index.tsx#L15](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/detections/components/rules/description_step/index.tsx#L15) | - |
@ -1636,8 +1637,6 @@ warning: This document is auto-generated and is meant to be viewed inside our ex
| <DocLink id="kibDataPluginApi" section="def-public.IIndexPattern" text="IIndexPattern"/> | [use_field_value_autocomplete.ts#L31](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/autocomplete/hooks/use_field_value_autocomplete.ts#L31) | - |
| <DocLink id="kibDataPluginApi" section="def-public.IIndexPattern" text="IIndexPattern"/> | [field_value_match.tsx#L19](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/autocomplete/field_value_match.tsx#L19) | - |
| <DocLink id="kibDataPluginApi" section="def-public.IIndexPattern" text="IIndexPattern"/> | [field_value_match.tsx#L30](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/autocomplete/field_value_match.tsx#L30) | - |
| <DocLink id="kibDataPluginApi" section="def-public.IIndexPattern" text="IIndexPattern"/> | [query.ts#L13](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/lib/detection_engine/reference_rules/query.ts#L13) | - |
| <DocLink id="kibDataPluginApi" section="def-public.IIndexPattern" text="IIndexPattern"/> | [query.ts#L52](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/lib/detection_engine/reference_rules/query.ts#L52) | - |
| <DocLink id="kibDataPluginApi" section="def-public.IIndexPattern" text="IIndexPattern"/> | [model.ts#L8](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/store/sourcerer/model.ts#L8) | - |
| <DocLink id="kibDataPluginApi" section="def-public.IIndexPattern" text="IIndexPattern"/> | [model.ts#L30](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/store/sourcerer/model.ts#L30) | - |
| <DocLink id="kibDataPluginApi" section="def-public.IIndexPattern" text="IIndexPattern"/> | [index.tsx#L33](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/detections/components/rules/severity_mapping/index.tsx#L33) | - |
@ -1754,9 +1753,9 @@ warning: This document is auto-generated and is meant to be viewed inside our ex
| <DocLink id="kibDataPluginApi" section="def-common.IFieldType" text="IFieldType"/> | [index.tsx#L242](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/detections/components/rules/risk_score_mapping/index.tsx#L242) | - |
| <DocLink id="kibDataPluginApi" section="def-common.IFieldType" text="IFieldType"/> | [index.tsx#L12](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/detections/components/rules/autocomplete_field/index.tsx#L12) | - |
| <DocLink id="kibDataPluginApi" section="def-common.IFieldType" text="IFieldType"/> | [index.tsx#L35](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/detections/components/rules/autocomplete_field/index.tsx#L35) | - |
| <DocLink id="kibDataPluginApi" section="def-common.IIndexPattern" text="IIndexPattern"/> | [types.ts#L22](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/types.ts#L22) | - |
| <DocLink id="kibDataPluginApi" section="def-common.IIndexPattern" text="IIndexPattern"/> | [types.ts#L72](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/types.ts#L72) | - |
| <DocLink id="kibDataPluginApi" section="def-common.IIndexPattern" text="IIndexPattern"/> | [action.ts#L20](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/action.ts#L20) | - |
| <DocLink id="kibDataPluginApi" section="def-common.IIndexPattern" text="IIndexPattern"/> | [types.ts#L21](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/types.ts#L21) | - |
| <DocLink id="kibDataPluginApi" section="def-common.IIndexPattern" text="IIndexPattern"/> | [types.ts#L66](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/types.ts#L66) | - |
| <DocLink id="kibDataPluginApi" section="def-common.IIndexPattern" text="IIndexPattern"/> | [action.ts#L19](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/action.ts#L19) | - |
| <DocLink id="kibDataPluginApi" section="def-common.IIndexPattern" text="IIndexPattern"/> | [action.ts#L100](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/action.ts#L100) | - |
| <DocLink id="kibDataPluginApi" section="def-common.IIndexPattern" text="IIndexPattern"/> | [index.ts#L8](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/common/search_strategy/index_fields/index.ts#L8) | - |
| <DocLink id="kibDataPluginApi" section="def-common.IIndexPattern" text="IIndexPattern"/> | [index.ts#L86](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/common/search_strategy/index_fields/index.ts#L86) | - |
@ -1793,9 +1792,9 @@ warning: This document is auto-generated and is meant to be viewed inside our ex
| <DocLink id="kibDataPluginApi" section="def-common.IIndexPattern" text="IIndexPattern"/> | [types.ts#L41](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/network/pages/details/types.ts#L41) | - |
| <DocLink id="kibDataPluginApi" section="def-common.IIndexPattern" text="IIndexPattern"/> | [index.tsx#L12](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/network/components/network_top_countries_table/index.tsx#L12) | - |
| <DocLink id="kibDataPluginApi" section="def-common.IIndexPattern" text="IIndexPattern"/> | [index.tsx#L34](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/network/components/network_top_countries_table/index.tsx#L34) | - |
| <DocLink id="kibDataPluginApi" section="def-common.IIndexPattern" text="IIndexPattern"/> | [middleware.ts#L48](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts#L48) | - |
| <DocLink id="kibDataPluginApi" section="def-common.IIndexPattern" text="IIndexPattern"/> | [middleware.ts#L64](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts#L64) | - |
| <DocLink id="kibDataPluginApi" section="def-common.IIndexPattern" text="IIndexPattern"/> | [middleware.ts#L69](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts#L69) | - |
| <DocLink id="kibDataPluginApi" section="def-common.IIndexPattern" text="IIndexPattern"/> | [middleware.ts#L44](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts#L44) | - |
| <DocLink id="kibDataPluginApi" section="def-common.IIndexPattern" text="IIndexPattern"/> | [middleware.ts#L60](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts#L60) | - |
| <DocLink id="kibDataPluginApi" section="def-common.IIndexPattern" text="IIndexPattern"/> | [middleware.ts#L65](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts#L65) | - |
| <DocLink id="kibDataPluginApi" section="def-common.IIndexPattern" text="IIndexPattern"/> | [types.ts#L12](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/detections/components/rules/description_step/types.ts#L12) | - |
| <DocLink id="kibDataPluginApi" section="def-common.IIndexPattern" text="IIndexPattern"/> | [types.ts#L28](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/detections/components/rules/description_step/types.ts#L28) | - |
| <DocLink id="kibDataPluginApi" section="def-common.IIndexPattern" text="IIndexPattern"/> | [index.tsx#L15](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/detections/components/rules/description_step/index.tsx#L15) | - |
@ -1850,8 +1849,6 @@ warning: This document is auto-generated and is meant to be viewed inside our ex
| <DocLink id="kibDataPluginApi" section="def-common.IIndexPattern" text="IIndexPattern"/> | [use_field_value_autocomplete.ts#L31](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/autocomplete/hooks/use_field_value_autocomplete.ts#L31) | - |
| <DocLink id="kibDataPluginApi" section="def-common.IIndexPattern" text="IIndexPattern"/> | [field_value_match.tsx#L19](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/autocomplete/field_value_match.tsx#L19) | - |
| <DocLink id="kibDataPluginApi" section="def-common.IIndexPattern" text="IIndexPattern"/> | [field_value_match.tsx#L30](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/autocomplete/field_value_match.tsx#L30) | - |
| <DocLink id="kibDataPluginApi" section="def-common.IIndexPattern" text="IIndexPattern"/> | [query.ts#L13](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/lib/detection_engine/reference_rules/query.ts#L13) | - |
| <DocLink id="kibDataPluginApi" section="def-common.IIndexPattern" text="IIndexPattern"/> | [query.ts#L52](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/lib/detection_engine/reference_rules/query.ts#L52) | - |
| <DocLink id="kibDataPluginApi" section="def-common.IIndexPattern" text="IIndexPattern"/> | [model.ts#L8](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/store/sourcerer/model.ts#L8) | - |
| <DocLink id="kibDataPluginApi" section="def-common.IIndexPattern" text="IIndexPattern"/> | [model.ts#L30](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/store/sourcerer/model.ts#L30) | - |
| <DocLink id="kibDataPluginApi" section="def-common.IIndexPattern" text="IIndexPattern"/> | [index.tsx#L33](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/detections/components/rules/severity_mapping/index.tsx#L33) | - |

View file

@ -51,5 +51,6 @@ export function createDiscoverGridDirective(reactDirective: any) {
['settings', { watchDepth: 'reference' }],
['showTimeCol', { watchDepth: 'value' }],
['sort', { watchDepth: 'value' }],
['className', { watchDepth: 'value' }],
]);
}

View file

@ -0,0 +1,85 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
import React, { useRef, useEffect } from 'react';
import { I18nProvider } from '@kbn/i18n/react';
import { IScope } from 'angular';
import { getServices } from '../../../kibana_services';
import { DocTableLegacyProps, injectAngularElement } from './create_doc_table_react';
type AngularEmbeddableScope = IScope & { renderProps?: DocTableEmbeddableProps };
export interface DocTableEmbeddableProps extends Partial<DocTableLegacyProps> {
refs: HTMLElement;
}
function getRenderFn(domNode: Element, props: DocTableEmbeddableProps) {
const directive = {
template: `<doc-table
class="panel-content"
columns="renderProps.columns"
data-description="{{renderProps.searchDescription}}"
data-shared-item
data-test-subj="embeddedSavedSearchDocTable"
data-title="{{renderProps.sharedItemTitle}}"
filter="renderProps.onFilter"
hits="renderProps.rows"
index-pattern="renderProps.indexPattern"
is-loading="renderProps.isLoading"
on-add-column="renderProps.onAddColumn"
on-change-sort-order="renderProps.onSort"
on-move-column="renderProps.onMoveColumn"
on-remove-column="renderProps.onRemoveColumn"
render-complete
sorting="renderProps.sort"
total-hit-count="renderProps.totalHitCount"
use-new-fields-api="renderProps.useNewFieldsApi"></doc-table>`,
};
return async () => {
try {
const injector = await getServices().getEmbeddableInjector();
return await injectAngularElement(domNode, directive.template, props, injector);
} catch (e) {
// eslint-disable-next-line no-console
console.error(e);
throw e;
}
};
}
export function DiscoverDocTableEmbeddable(props: DocTableEmbeddableProps) {
return (
<I18nProvider>
<DocTableLegacyInner {...props} />
</I18nProvider>
);
}
function DocTableLegacyInner(renderProps: DocTableEmbeddableProps) {
const scope = useRef<AngularEmbeddableScope | undefined>();
useEffect(() => {
if (renderProps.refs && !scope.current) {
const fn = getRenderFn(renderProps.refs, renderProps);
fn().then((newScope) => {
scope.current = newScope;
});
} else if (scope?.current) {
scope.current.renderProps = { ...renderProps };
scope.current.$applyAsync();
}
}, [renderProps]);
useEffect(() => {
return () => {
scope.current?.$destroy();
};
}, []);
return <React.Fragment />;
}

View file

@ -9,3 +9,4 @@
export { createDocTableDirective } from './doc_table';
export { getSort, getSortArray } from './lib/get_sort';
export { getSortForSearchSource } from './lib/get_sort_for_search_source';
export { getDefaultSort } from './lib/get_default_sort';

View file

@ -51,6 +51,10 @@ export interface DiscoverGridProps {
* Determines which element labels the grid for ARIA
*/
ariaLabelledBy: string;
/**
* Optional class name to apply
*/
className?: string;
/**
* Determines which columns are displayed
*/
@ -175,6 +179,7 @@ export const DiscoverGrid = ({
isSortEnabled = true,
isPaginationEnabled = true,
controlColumnIds = ['openDetails', 'select'],
className,
}: DiscoverGridProps) => {
const [selectedDocs, setSelectedDocs] = useState<string[]>([]);
const [isFilterActive, setIsFilterActive] = useState(false);
@ -284,6 +289,7 @@ export const DiscoverGrid = ({
),
[displayedColumns, indexPattern, showTimeCol, settings, defaultColumns, isSortEnabled]
);
const schemaDetectors = useMemo(() => getSchemaDetectors(), []);
const columnsVisibility = useMemo(
() => ({
@ -368,6 +374,7 @@ export const DiscoverGrid = ({
data-title={searchTitle}
data-description={searchDescription}
data-document-number={displayedRows.length}
className={className}
>
<KibanaContextProvider services={{ uiSettings: services.uiSettings }}>
<EuiDataGridMemoized

View file

@ -6,68 +6,57 @@
* Side Public License, v 1.
*/
import './search_embeddable.scss';
import angular from 'angular';
import _ from 'lodash';
import { Subscription } from 'rxjs';
import React from 'react';
import ReactDOM from 'react-dom';
import { i18n } from '@kbn/i18n';
import { UiActionsStart } from '../../../../ui_actions/public';
import { RequestAdapter, Adapters } from '../../../../inspector/public';
import {
APPLY_FILTER_TRIGGER,
esFilters,
Filter,
TimeRange,
FilterManager,
Query,
IFieldType,
} from '../../../../data/public';
import { isEqual } from 'lodash';
import { Container, Embeddable } from '../../../../embeddable/public';
import * as columnActions from '../angular/doc_table/actions/columns';
import searchTemplate from './search_template.html';
import searchTemplateGrid from './search_template_datagrid.html';
import { ISearchEmbeddable, SearchInput, SearchOutput } from './types';
import { SortOrder } from '../angular/doc_table/components/table_header/helpers';
import { getSortForSearchSource } from '../angular/doc_table';
import { getServices, IndexPattern, ISearchSource } from '../../kibana_services';
import { SavedSearch } from '../../saved_searches';
import { Adapters, RequestAdapter } from '../../../../inspector/common';
import { SEARCH_EMBEDDABLE_TYPE } from './constants';
import { SavedSearch } from '../..';
import { APPLY_FILTER_TRIGGER, esFilters, FilterManager } from '../../../../data/public';
import { DiscoverServices } from '../../build_services';
import {
Query,
TimeRange,
Filter,
IFieldType,
IndexPattern,
ISearchSource,
} from '../../../../data/common';
import { SortOrder } from '../angular/doc_table/components/table_header/helpers';
import { ElasticSearchHit } from '../doc_views/doc_views_types';
import { SavedSearchEmbeddableComponent } from './saved_search_embeddable_component';
import { UiActionsStart } from '../../../../ui_actions/public';
import { getServices } from '../../kibana_services';
import {
DOC_HIDE_TIME_COLUMN_SETTING,
DOC_TABLE_LEGACY,
SAMPLE_SIZE_SETTING,
SEARCH_FIELDS_FROM_SOURCE,
SORT_DEFAULT_ORDER_SETTING,
} from '../../../common';
import { DiscoverGridSettings } from '../components/discover_grid/types';
import { DiscoverServices } from '../../build_services';
import { ElasticSearchHit } from '../doc_views/doc_views_types';
import { getDefaultSort } from '../angular/doc_table/lib/get_default_sort';
import * as columnActions from '../angular/doc_table/actions/columns';
import { getSortForSearchSource, getDefaultSort } from '../angular/doc_table';
import { handleSourceColumnState } from '../angular/helpers';
import { DiscoverGridProps } from '../components/discover_grid/discover_grid';
import { DiscoverGridSettings } from '../components/discover_grid/types';
interface SearchScope extends ng.IScope {
columns?: string[];
export interface SearchProps extends Partial<DiscoverGridProps> {
settings?: DiscoverGridSettings;
description?: string;
sort?: SortOrder[];
sharedItemTitle?: string;
inspectorAdapters?: Adapters;
setSortOrder?: (sortPair: SortOrder[]) => void;
setColumns?: (columns: string[]) => void;
removeColumn?: (column: string) => void;
addColumn?: (column: string) => void;
moveColumn?: (column: string, index: number) => void;
filter?: (field: IFieldType, value: string[], operator: string) => void;
hits?: ElasticSearchHit[];
indexPattern?: IndexPattern;
totalHitCount?: number;
isLoading?: boolean;
showTimeCol?: boolean;
useNewFieldsApi?: boolean;
onMoveColumn?: (column: string, index: number) => void;
}
interface SearchEmbeddableConfig {
$rootScope: ng.IRootScopeService;
$compile: ng.ICompileService;
savedSearch: SavedSearch;
editUrl: string;
editPath: string;
@ -77,17 +66,13 @@ interface SearchEmbeddableConfig {
services: DiscoverServices;
}
export class SearchEmbeddable
export class SavedSearchEmbeddable
extends Embeddable<SearchInput, SearchOutput>
implements ISearchEmbeddable {
private readonly savedSearch: SavedSearch;
private $rootScope: ng.IRootScopeService;
private $compile: ng.ICompileService;
private inspectorAdapters: Adapters;
private searchScope?: SearchScope;
private panelTitle: string = '';
private filtersSearchSource?: ISearchSource;
private searchInstance?: JQLite;
private filtersSearchSource!: ISearchSource;
private subscription?: Subscription;
public readonly type = SEARCH_EMBEDDABLE_TYPE;
private filterManager: FilterManager;
@ -98,11 +83,12 @@ export class SearchEmbeddable
private prevFilters?: Filter[];
private prevQuery?: Query;
private prevSearchSessionId?: string;
private searchProps?: SearchProps;
private node?: HTMLElement;
constructor(
{
$rootScope,
$compile,
savedSearch,
editUrl,
editPath,
@ -130,164 +116,24 @@ export class SearchEmbeddable
this.services = services;
this.filterManager = filterManager;
this.savedSearch = savedSearch;
this.$rootScope = $rootScope;
this.$compile = $compile;
this.inspectorAdapters = {
requests: new RequestAdapter(),
};
this.initializeSearchScope();
this.initializeSearchEmbeddableProps();
this.subscription = this.getUpdated$().subscribe(() => {
this.panelTitle = this.output.title || '';
if (this.searchScope) {
this.pushContainerStateParamsToScope(this.searchScope);
if (this.searchProps) {
this.pushContainerStateParamsToProps(this.searchProps);
}
});
}
public getInspectorAdapters() {
return this.inspectorAdapters;
}
public getSavedSearch() {
return this.savedSearch;
}
/**
*
* @param {Element} domNode
*/
public render(domNode: HTMLElement) {
if (!this.searchScope) {
throw new Error('Search scope not defined');
}
this.searchInstance = this.$compile(
this.services.uiSettings.get('doc_table:legacy') ? searchTemplate : searchTemplateGrid
)(this.searchScope);
const rootNode = angular.element(domNode);
rootNode.append(this.searchInstance);
this.pushContainerStateParamsToScope(this.searchScope);
}
public destroy() {
super.destroy();
this.savedSearch.destroy();
if (this.searchInstance) {
this.searchInstance.remove();
}
if (this.searchScope) {
this.searchScope.$destroy();
delete this.searchScope;
}
if (this.subscription) {
this.subscription.unsubscribe();
}
if (this.abortController) this.abortController.abort();
}
private initializeSearchScope() {
const searchScope: SearchScope = (this.searchScope = this.$rootScope.$new());
searchScope.description = this.savedSearch.description;
searchScope.inspectorAdapters = this.inspectorAdapters;
const { searchSource } = this.savedSearch;
const indexPattern = (searchScope.indexPattern = searchSource.getField('index'))!;
if (!this.savedSearch.sort || !this.savedSearch.sort.length) {
this.savedSearch.sort = getDefaultSort(
indexPattern,
getServices().uiSettings.get(SORT_DEFAULT_ORDER_SETTING, 'desc')
);
}
const timeRangeSearchSource = searchSource.create();
timeRangeSearchSource.setField('filter', () => {
if (!this.searchScope || !this.input.timeRange) return;
return this.services.timefilter.createFilter(indexPattern, this.input.timeRange);
});
this.filtersSearchSource = searchSource.create();
this.filtersSearchSource.setParent(timeRangeSearchSource);
searchSource.setParent(this.filtersSearchSource);
this.pushContainerStateParamsToScope(searchScope);
searchScope.setSortOrder = (sort) => {
this.updateInput({ sort });
};
searchScope.isLoading = true;
const useNewFieldsApi = !getServices().uiSettings.get(SEARCH_FIELDS_FROM_SOURCE, false);
searchScope.useNewFieldsApi = useNewFieldsApi;
searchScope.addColumn = (columnName: string) => {
if (!searchScope.columns) {
return;
}
const columns = columnActions.addColumn(searchScope.columns, columnName, useNewFieldsApi);
this.updateInput({ columns });
};
searchScope.removeColumn = (columnName: string) => {
if (!searchScope.columns) {
return;
}
const columns = columnActions.removeColumn(searchScope.columns, columnName, useNewFieldsApi);
this.updateInput({ columns });
};
searchScope.moveColumn = (columnName, newIndex: number) => {
if (!searchScope.columns) {
return;
}
const columns = columnActions.moveColumn(searchScope.columns, columnName, newIndex);
this.updateInput({ columns });
};
searchScope.setColumns = (columns: string[]) => {
this.updateInput({ columns });
};
if (this.savedSearch.grid) {
searchScope.settings = this.savedSearch.grid;
}
searchScope.showTimeCol = !this.services.uiSettings.get(DOC_HIDE_TIME_COLUMN_SETTING, false);
searchScope.filter = async (field, value, operator) => {
let filters = esFilters.generateFilters(
this.filterManager,
field,
value,
operator,
indexPattern.id!
);
filters = filters.map((filter) => ({
...filter,
$state: { store: esFilters.FilterStateStore.APP_STATE },
}));
await this.executeTriggerActions(APPLY_FILTER_TRIGGER, {
embeddable: this,
filters,
});
};
}
public reload() {
if (this.searchScope)
this.pushContainerStateParamsToScope(this.searchScope, { forceFetch: true });
}
private fetch = async () => {
const searchSessionId = this.input.searchSessionId;
const useNewFieldsApi = !this.services.uiSettings.get(SEARCH_FIELDS_FROM_SOURCE, false);
if (!this.searchScope) return;
if (!this.searchProps) return;
const { searchSource } = this.savedSearch;
@ -299,8 +145,8 @@ export class SearchEmbeddable
searchSource.setField(
'sort',
getSortForSearchSource(
this.searchScope.sort,
this.searchScope.indexPattern,
this.searchProps!.sort,
this.searchProps!.indexPattern,
this.services.uiSettings.get(SORT_DEFAULT_ORDER_SETTING)
)
);
@ -310,8 +156,8 @@ export class SearchEmbeddable
searchSource.setField('fields', [fields]);
} else {
searchSource.removeField('fields');
if (this.searchScope.indexPattern) {
const fieldNames = this.searchScope.indexPattern.fields.map((field) => field.name);
if (this.searchProps.indexPattern) {
const fieldNames = this.searchProps.indexPattern.fields.map((field) => field.name);
searchSource.setField('fieldsFromSource', fieldNames);
}
}
@ -319,9 +165,8 @@ export class SearchEmbeddable
// Log request to inspector
this.inspectorAdapters.requests!.reset();
this.searchScope.$apply(() => {
this.searchScope!.isLoading = true;
});
this.searchProps!.isLoading = true;
this.updateOutput({ loading: true, error: undefined });
try {
@ -344,64 +189,222 @@ export class SearchEmbeddable
.toPromise();
this.updateOutput({ loading: false, error: undefined });
// Apply the changes to the angular scope
this.searchScope.$apply(() => {
this.searchScope!.hits = resp.hits.hits;
this.searchScope!.totalHitCount = resp.hits.total as number;
this.searchScope!.isLoading = false;
});
this.searchProps!.rows = resp.hits.hits;
this.searchProps!.totalHitCount = resp.hits.total as number;
this.searchProps!.isLoading = false;
} catch (error) {
this.updateOutput({ loading: false, error });
this.searchScope.$apply(() => {
this.searchScope!.isLoading = false;
});
this.searchProps!.isLoading = false;
}
};
private pushContainerStateParamsToScope(
searchScope: SearchScope,
private initializeSearchEmbeddableProps() {
const { searchSource } = this.savedSearch;
const indexPattern = searchSource.getField('index');
if (!indexPattern) {
return;
}
if (!this.savedSearch.sort || !this.savedSearch.sort.length) {
this.savedSearch.sort = getDefaultSort(
indexPattern,
getServices().uiSettings.get(SORT_DEFAULT_ORDER_SETTING, 'desc')
);
}
const props: SearchProps = {
columns: this.savedSearch.columns,
indexPattern,
isLoading: false,
sort: getDefaultSort(
indexPattern,
getServices().uiSettings.get(SORT_DEFAULT_ORDER_SETTING, 'desc')
),
rows: [],
searchDescription: this.savedSearch.description,
description: this.savedSearch.description,
inspectorAdapters: this.inspectorAdapters,
searchTitle: this.savedSearch.lastSavedTitle,
services: this.services,
onAddColumn: (columnName: string) => {
if (!props.columns) {
return;
}
const updatedColumns = columnActions.addColumn(props.columns, columnName, true);
this.updateInput({ columns: updatedColumns });
},
onRemoveColumn: (columnName: string) => {
if (!props.columns) {
return;
}
const updatedColumns = columnActions.removeColumn(props.columns, columnName, true);
this.updateInput({ columns: updatedColumns });
},
onMoveColumn: (columnName: string, newIndex: number) => {
if (!props.columns) {
return;
}
const columns = columnActions.moveColumn(props.columns, columnName, newIndex);
this.updateInput({ columns });
},
onSetColumns: (columns: string[]) => {
this.updateInput({ columns });
},
onSort: (sort: string[][]) => {
const sortOrderArr: SortOrder[] = [];
sort.forEach((arr) => {
sortOrderArr.push(arr as SortOrder);
});
this.updateInput({ sort: sortOrderArr });
},
sampleSize: 500,
onFilter: async (field, value, operator) => {
let filters = esFilters.generateFilters(
this.filterManager,
// @ts-expect-error
field,
value,
operator,
indexPattern.id!
);
filters = filters.map((filter) => ({
...filter,
$state: { store: esFilters.FilterStateStore.APP_STATE },
}));
await this.executeTriggerActions(APPLY_FILTER_TRIGGER, {
embeddable: this,
filters,
});
},
useNewFieldsApi: !this.services.uiSettings.get(SEARCH_FIELDS_FROM_SOURCE, false),
showTimeCol: !this.services.uiSettings.get(DOC_HIDE_TIME_COLUMN_SETTING, false),
ariaLabelledBy: 'documentsAriaLabel',
};
const timeRangeSearchSource = searchSource.create();
timeRangeSearchSource.setField('filter', () => {
if (!this.searchProps || !this.input.timeRange) return;
return this.services.timefilter.createFilter(indexPattern, this.input.timeRange);
});
this.filtersSearchSource = searchSource.create();
this.filtersSearchSource.setParent(timeRangeSearchSource);
searchSource.setParent(this.filtersSearchSource);
this.pushContainerStateParamsToProps(props);
props.isLoading = true;
if (this.savedSearch.grid) {
props.settings = this.savedSearch.grid;
}
}
private async pushContainerStateParamsToProps(
searchProps: SearchProps,
{ forceFetch = false }: { forceFetch: boolean } = { forceFetch: false }
) {
const isFetchRequired =
!esFilters.onlyDisabledFiltersChanged(this.input.filters, this.prevFilters) ||
!_.isEqual(this.prevQuery, this.input.query) ||
!_.isEqual(this.prevTimeRange, this.input.timeRange) ||
!_.isEqual(searchScope.sort, this.input.sort || this.savedSearch.sort) ||
!isEqual(this.prevQuery, this.input.query) ||
!isEqual(this.prevTimeRange, this.input.timeRange) ||
!isEqual(searchProps.sort, this.input.sort || this.savedSearch.sort) ||
this.prevSearchSessionId !== this.input.searchSessionId;
// If there is column or sort data on the panel, that means the original columns or sort settings have
// been overridden in a dashboard.
searchScope.columns = handleSourceColumnState(
searchProps.columns = handleSourceColumnState(
{ columns: this.input.columns || this.savedSearch.columns },
this.services.core.uiSettings
).columns;
const savedSearchSort =
this.savedSearch.sort && this.savedSearch.sort.length
? this.savedSearch.sort
: getDefaultSort(
this.searchScope?.indexPattern,
this.searchProps?.indexPattern,
getServices().uiSettings.get(SORT_DEFAULT_ORDER_SETTING, 'desc')
);
searchScope.sort = this.input.sort || savedSearchSort;
searchScope.sharedItemTitle = this.panelTitle;
searchProps.sort = this.input.sort || savedSearchSort;
searchProps.sharedItemTitle = this.panelTitle;
if (forceFetch || isFetchRequired) {
this.filtersSearchSource!.setField('filter', this.input.filters);
this.filtersSearchSource!.setField('query', this.input.query);
this.filtersSearchSource.setField('filter', this.input.filters);
this.filtersSearchSource.setField('query', this.input.query);
if (this.input.query?.query || this.input.filters?.length) {
this.filtersSearchSource!.setField('highlightAll', true);
this.filtersSearchSource.setField('highlightAll', true);
} else {
this.filtersSearchSource!.removeField('highlightAll');
this.filtersSearchSource.removeField('highlightAll');
}
this.prevFilters = this.input.filters;
this.prevQuery = this.input.query;
this.prevTimeRange = this.input.timeRange;
this.prevSearchSessionId = this.input.searchSessionId;
this.fetch();
} else if (this.searchScope) {
// trigger a digest cycle to make sure non-fetch relevant changes are propagated
this.searchScope.$applyAsync();
this.searchProps = searchProps;
await this.fetch();
} else if (this.searchProps && this.node) {
this.searchProps = searchProps;
}
if (this.node) {
this.renderReactComponent(this.node, this.searchProps!);
}
}
/**
*
* @param {Element} domNode
*/
public async render(domNode: HTMLElement) {
if (!this.searchProps) {
throw new Error('Search props not defined');
}
if (this.node) {
ReactDOM.unmountComponentAtNode(this.node);
}
this.node = domNode;
}
private renderReactComponent(domNode: HTMLElement, searchProps: SearchProps) {
if (!this.searchProps) {
return;
}
const useLegacyTable = this.services.uiSettings.get(DOC_TABLE_LEGACY);
const props = {
searchProps,
useLegacyTable,
refs: domNode,
};
ReactDOM.render(<SavedSearchEmbeddableComponent {...props} />, domNode);
}
public reload() {
if (this.searchProps) {
this.pushContainerStateParamsToProps(this.searchProps, { forceFetch: true });
}
}
public getSavedSearch(): SavedSearch {
return this.savedSearch;
}
public getInspectorAdapters() {
return this.inspectorAdapters;
}
public destroy() {
super.destroy();
this.savedSearch.destroy();
if (this.searchProps) {
delete this.searchProps;
}
this.subscription?.unsubscribe();
if (this.abortController) this.abortController.abort();
}
}

View file

@ -0,0 +1,39 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
import React from 'react';
import { DiscoverGridEmbeddable } from '../angular/create_discover_grid_directive';
import { DiscoverDocTableEmbeddable } from '../angular/doc_table/create_doc_table_embeddable';
import { DiscoverGridProps } from '../components/discover_grid/discover_grid';
import { SearchProps } from './saved_search_embeddable';
interface SavedSearchEmbeddableComponentProps {
searchProps: SearchProps;
useLegacyTable: boolean;
refs: HTMLElement;
}
const DiscoverDocTableEmbeddableMemoized = React.memo(DiscoverDocTableEmbeddable);
const DiscoverGridEmbeddableMemoized = React.memo(DiscoverGridEmbeddable);
export function SavedSearchEmbeddableComponent({
searchProps,
useLegacyTable,
refs,
}: SavedSearchEmbeddableComponentProps) {
if (useLegacyTable) {
const docTableProps = {
...searchProps,
refs,
};
return <DiscoverDocTableEmbeddableMemoized {...docTableProps} />;
}
const discoverGridProps = searchProps as DiscoverGridProps;
return <DiscoverGridEmbeddableMemoized {...discoverGridProps} className="dscDiscoverGrid" />;
}

View file

@ -18,8 +18,9 @@ import {
import { TimeRange } from '../../../../data/public';
import { SearchInput, SearchOutput, SearchEmbeddable } from './types';
import { SearchInput, SearchOutput } from './types';
import { SEARCH_EMBEDDABLE_TYPE } from './constants';
import { SavedSearchEmbeddable } from './saved_search_embeddable';
interface StartServices {
executeTriggerActions: UiActionsStart['executeTriggerActions'];
@ -27,7 +28,7 @@ interface StartServices {
}
export class SearchEmbeddableFactory
implements EmbeddableFactoryDefinition<SearchInput, SearchOutput, SearchEmbeddable> {
implements EmbeddableFactoryDefinition<SearchInput, SearchOutput, SavedSearchEmbeddable> {
public readonly type = SEARCH_EMBEDDABLE_TYPE;
private $injector: auto.IInjectorService | null;
private getInjector: () => Promise<auto.IInjectorService> | null;
@ -65,14 +66,11 @@ export class SearchEmbeddableFactory
savedObjectId: string,
input: Partial<SearchInput> & { id: string; timeRange: TimeRange },
parent?: Container
): Promise<SearchEmbeddable | ErrorEmbeddable> => {
): Promise<SavedSearchEmbeddable | ErrorEmbeddable> => {
if (!this.$injector) {
this.$injector = await this.getInjector();
}
const $injector = this.$injector as auto.IInjectorService;
const $compile = $injector.get<ng.ICompileService>('$compile');
const $rootScope = $injector.get<ng.IRootScopeService>('$rootScope');
const filterManager = getServices().filterManager;
const url = await getServices().getSavedSearchUrlById(savedObjectId);
@ -81,12 +79,12 @@ export class SearchEmbeddableFactory
const savedObject = await getServices().getSavedSearchById(savedObjectId);
const indexPattern = savedObject.searchSource.getField('index');
const { executeTriggerActions } = await this.getStartServices();
const { SearchEmbeddable: SearchEmbeddableClass } = await import('./search_embeddable');
return new SearchEmbeddableClass(
const { SavedSearchEmbeddable: SavedSearchEmbeddableClass } = await import(
'./saved_search_embeddable'
);
return new SavedSearchEmbeddableClass(
{
savedSearch: savedObject,
$rootScope,
$compile,
editUrl,
editPath: url,
filterManager,

View file

@ -1,21 +0,0 @@
<doc-table
class="panel-content"
columns="columns"
data-description="{{description}}"
data-shared-item
data-test-subj="embeddedSavedSearchDocTable"
data-title="{{sharedItemTitle}}"
filter="filter"
hits="hits"
index-pattern="indexPattern"
is-loading="isLoading"
on-add-column="addColumn"
on-change-sort-order="setSortOrder"
on-move-column="moveColumn"
on-remove-column="removeColumn"
render-complete
sorting="sort"
total-hit-count="totalHitCount"
use-new-fields-api="useNewFieldsApi"
>
</doc-table>

View file

@ -1,19 +0,0 @@
<discover-grid
class="dscDiscoverGrid"
columns="columns"
search-description="description"
search-title="sharedItemTitle"
data-test-subj="embeddedSavedSearchDocTable"
index-pattern="indexPattern"
is-loading="isLoading"
on-add-column="addColumn"
on-filter="filter"
on-remove-column="removeColumn"
on-set-columns="setColumns"
on-sort="setSortOrder"
rows="hits"
sample-size="500"
settings="settings"
show-time-col="showTimeCol"
sort="sort"
></discover-grid>