Dashboard: Add dashboard validation warning to save drawer (#55732)

* add api route for validating a dashboard json

* add feature flag for showDashboardValidationWarnings

* tidy up

* comments and messages

* swagger specs

* fix typo

* more swagger

* tests!

* tidy test a little bit

* no more ioutil

* api will return different status code depending on validation error

* clean up

* handle 4xx errors

* remove console.log

* fix backend tests

* tidy up

* Swagger: Exclude alpha endpoints

Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>
This commit is contained in:
Josh Hunt
2022-10-14 09:51:05 -04:00
committed by GitHub
co-authored by Sofia Papagiannaki
parent e4b1347ca5
commit 2e16d5499e
14 changed files with 324 additions and 3 deletions
+4
View File
@@ -322,6 +322,10 @@ var (
State: FeatureStateAlpha,
RequiresDevMode: true,
},
{
Name: "showDashboardValidationWarnings",
Description: "Show warnings when Dashboards do not validate against the schema",
},
{
Name: "mysqlAnsiQuotes",
Description: "Use double quote to escape keyword in Mysql query",
+4
View File
@@ -239,6 +239,10 @@ const (
// Reusable query library
FlagQueryLibrary = "queryLibrary"
// FlagShowDashboardValidationWarnings
// Show warnings when Dashboards do not validate against the schema
FlagShowDashboardValidationWarnings = "showDashboardValidationWarnings"
// FlagMysqlAnsiQuotes
// Use double quote to escape keyword in Mysql query
FlagMysqlAnsiQuotes = "mysqlAnsiQuotes"