Validation and error handling for dashboard visualizations
Problem to solve
Follow up from review comment in this MR: !113790 (comment 1309104552)
Users may configure their dashboard visualizations incorrectly, causing our components to crash out / behave unexpectedly. For example, if the visualization JSON does not specify an xAxisTitle
, the column_chart
component will fail.
We should validate these configurations, and provide user feedback to allow people to correct their errors.
Proposal
We should have one panel-level validator for all visualizations and let the visualizations fail hard. The panel-level validator could be something similar to
cube_analytics.js
that takes in the type + configuration and validates it against a schema. I think this would be far more efficient and easier to maintain than letting each visualization raise it's own errors and it also keeps all error handling on thepanel_base.vue
component.