File tree Expand file tree Collapse file tree
x-pack/plugins/lens/public Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ const createStartContract = (): Start => {
1414 EmbeddableComponent : jest . fn ( ( ) => null ) ,
1515 canUseEditor : jest . fn ( ( ) => true ) ,
1616 navigateToPrefilledEditor : jest . fn ( ) ,
17+ getXyVisTypes : jest . fn ( ) ,
1718 } ;
1819 return startContract ;
1920} ;
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ import {
4242 VISUALIZE_FIELD_TRIGGER ,
4343} from '../../../../src/plugins/ui_actions/public' ;
4444import { APP_ID , getEditPath , NOT_INTERNATIONALIZED_PRODUCT_NAME } from '../common' ;
45- import { EditorFrameStart } from './types' ;
45+ import type { EditorFrameStart , VisualizationType } from './types' ;
4646import { getLensAliasConfig } from './vis_type_alias' ;
4747import { visualizeFieldAction } from './trigger_actions/visualize_field_actions' ;
4848import { getSearchProvider } from './search_provider' ;
@@ -101,6 +101,11 @@ export interface LensPublicStart {
101101 * Method which returns true if the user has permission to use Lens as defined by application capabilities.
102102 */
103103 canUseEditor : ( ) => boolean ;
104+
105+ /**
106+ * Method which returns xy VisualizationTypes array keeping this async as to not impact page load bundle
107+ */
108+ getXyVisTypes : ( ) => Promise < VisualizationType [ ] > ;
104109}
105110
106111export class LensPlugin {
@@ -257,6 +262,10 @@ export class LensPlugin {
257262 canUseEditor : ( ) => {
258263 return Boolean ( core . application . capabilities . visualize ?. show ) ;
259264 } ,
265+ getXyVisTypes : async ( ) => {
266+ const { visualizationTypes } = await import ( './xy_visualization/types' ) ;
267+ return visualizationTypes ;
268+ } ,
260269 } ;
261270 }
262271
You can’t perform that action at this time.
0 commit comments