In #2721 it was suggested to display more informative and user friendly feedback when query results fail due to missing parameter value.
But parameter validation can be made even broader as there are other validations being done in the backend which can emit dedicated significant feedback.
In #4264 I attempt to adhere to all validation cases and here they are up for discussion.
1. Missing value
When a parameter has no value.
2. Invalid value
Numbers for Number params, string for Text params, object for DateRange params etc.
In the following screenshot, a valid DateRange param was changed to a Text param which doesn’t accept an object as a value.
3. Missing parameter
When a widget executes a query which has since been added a new parameter.
4. Redundant parameter
When a widget executes a query with a parameter that has already been removed.
5. Mismatched parameter
When there’s a mismatch between the parameter type and the expected template tag in the query text.
When a DateRange param is missing {{ param.start }}
or {{ param.end }}
.
Same for the opposite case, when a non-DateRange param is missing the normal {{ param }}
.
But if the same mismatch happens when the query is not saved - meaning, no schema to validate by parameter type - a more generic error is shown, suggesting to save the query and rerun.
6. Unsafe parameter
When there’s an unsafe parameter in a widget of a limited access public dashboard.
7. Unsaved parameter
This one is not really related but I felt the parameter feedback mechanism could be used to show this as well.
When a new parameter has been added but query not yet saved.
Lmk what you think.