Snapshots: Add snapshot enable config (#61587)

* Add config to remove Snapshot functionality (frontend is hidden and validation in the backend)
* Add test cases
* Remove unused mock on the test
* Moving Snapshot config from globar variables to settings.Cfg
* Removing warnings on code
This commit is contained in:
lean.dev authored and GitHub committed 2023-01-26 10:28:11 -03:00
1 parent 928e2c9c9e
commit 7d8ec6199d
14 files changed
+191 -99

No files matched your search

+1 -1
View File
@@ -701,7 +701,7 @@ func (hs *HTTPServer) registerRoutes() {
// Snapshots
r.Post("/api/snapshots/", reqSnapshotPublicModeOrSignedIn, hs.CreateDashboardSnapshot)
r.Get("/api/snapshot/shared-options/", reqSignedIn, GetSharingOptions)
r.Get("/api/snapshot/shared-options/", reqSignedIn, hs.GetSharingOptions)
r.Get("/api/snapshots/:key", routing.Wrap(hs.GetDashboardSnapshot))
r.Get("/api/snapshots-delete/:deleteKey", reqSnapshotPublicModeOrSignedIn, routing.Wrap(hs.DeleteDashboardSnapshotByDeleteKey))
r.Delete("/api/snapshots/:key", reqSignedIn, routing.Wrap(hs.DeleteDashboardSnapshot))