Allow saving of provisioned dashboards (#19820)

Allows saving of provisioned dashboards if the config value allowUiUpdates is set to true

Fixes #11778
This commit is contained in:
Jon Gyllenswärd
2019-10-31 14:27:31 +01:00
committed by GitHub
parent 782eda3e9a
commit a45ce36566
15 changed files with 194 additions and 38 deletions
@@ -964,13 +964,13 @@ func permissionScenario(desc string, canSave bool, fn dashboardPermissionScenari
func callSaveWithResult(cmd models.SaveDashboardCommand) *models.Dashboard {
dto := toSaveDashboardDto(cmd)
res, _ := dashboards.NewService().SaveDashboard(&dto)
res, _ := dashboards.NewService().SaveDashboard(&dto, false)
return res
}
func callSaveWithError(cmd models.SaveDashboardCommand) error {
dto := toSaveDashboardDto(cmd)
_, err := dashboards.NewService().SaveDashboard(&dto)
_, err := dashboards.NewService().SaveDashboard(&dto, false)
return err
}
@@ -994,7 +994,7 @@ func saveTestDashboard(title string, orgId int64, folderId int64) *models.Dashbo
},
}
res, err := dashboards.NewService().SaveDashboard(&dto)
res, err := dashboards.NewService().SaveDashboard(&dto, false)
So(err, ShouldBeNil)
return res
@@ -1020,7 +1020,7 @@ func saveTestFolder(title string, orgId int64) *models.Dashboard {
},
}
res, err := dashboards.NewService().SaveDashboard(&dto)
res, err := dashboards.NewService().SaveDashboard(&dto, false)
So(err, ShouldBeNil)
return res