Validate dashboard visualizations and return on GraphQL response
backend issue for Validation and error handling for dashboard vis... (#396228 - closed)
Validate dashboard visualizations when they are loaded from YAML.
Any customer facing vizualiation errors can be returned on the visualization object ready to be displayed on the dashboard.
examples
When fetching the full dashboard details
productAnalyticsDashboards: {
nodes: [{
slug: "every_visualization",
// ...
panels: {
nodes: [{
title: "Daily Active Users",
// ...
visualization: {
slug: "my_new_viz",
// ...
errors: [
"unexpected foo at the bar"
]
and for the dashboard editor
productAnalyticsVisualizations: {
nodes: [{
slug: "my_new_viz",
type: "SingleStat",
data: {…},
options: {},
errors: [
"unexpected foo at the bar"
]
Note our existing analytics_visualization.json
schema needs some edits to be compatible with our current built-in visualizations, it is not compatible with JSON Schema right now. (Welcome7
-> AnalyticsVisualization
, missing properties, string vs int issues)
In addition to the standard JSON Schema formatting we will want to have some custom validation:
- If a visualization has
links
specified in options, ensure eachlinks
config has bothtext
andhref
Edited by Elwyn Benson