[Lens] Allow datasource and visualization to display error in workspace #80127
Labels
enhancement
New value added to drive a business result
Feature:Lens
Team:Visualizations
Visualization editors, elastic-charts and infrastructure
Currently datasource and visualization can't opt out of rendering a chart except for not emitting a visualization at all which will result in a prompt to drop a field into the workspace.
In some cases the current configuration is invalid - in this case both visualization and datasource should be able to render an error message in the workspace instead of showing a chart.
Also, in some cases the datasources needs to know about the dimension group properties to show nice error messages guiding the user in the right direction.
To cover these use cases, the following changes need to be made to the frame level types:
DatasourceDimensionEditorProps
is extended withdimensionGroups: VisualizationDimensionGroupConfig[]
. This contains the latest return value ofgetConfiguration
of the currently active visualizationDatasource
is extended withgetErrorMessage(state: T, dimensionGroups: VisualizationDimensionGroupConfig[]) => { shortMessage: ReactNode, longMessage: ReactNode } | undefined
Visualization
is extended withgetErrorMessage(state: T, frame: FramePublicAPI) => { shortMessage: ReactNode, longMessage: ReactNode } | undefined
The text was updated successfully, but these errors were encountered: