Implement preference service (#47870)

* Implement preference service

* Adjust wire.go

* Fix integration test user

* Fix api pref tests

* Fix a11y error

Co-authored-by: Alexandra Vargas <alexa1866@gmail.com>
Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com>
This commit is contained in:
idafurjes
2022-04-21 15:03:17 +02:00
committed by GitHub
co-authored by Alexandra Vargas Emil Tullstedt
parent 03cf38e659
commit dbcaedac6c
18 changed files with 132 additions and 629 deletions
+4 -1
View File
@@ -51,6 +51,7 @@ import (
"github.com/grafana/grafana/pkg/services/notifications"
"github.com/grafana/grafana/pkg/services/plugindashboards"
pluginSettings "github.com/grafana/grafana/pkg/services/pluginsettings/service"
pref "github.com/grafana/grafana/pkg/services/preference"
"github.com/grafana/grafana/pkg/services/provisioning"
"github.com/grafana/grafana/pkg/services/query"
"github.com/grafana/grafana/pkg/services/queryhistory"
@@ -147,6 +148,7 @@ type HTTPServer struct {
DashboardsnapshotsService *dashboardsnapshots.Service
PluginSettings *pluginSettings.Service
AvatarCacheServer *avatar.AvatarCacheServer
preferenceService pref.Service
}
type ServerOptions struct {
@@ -178,7 +180,7 @@ func ProvideHTTPServer(opts ServerOptions, cfg *setting.Cfg, routeRegister routi
dashboardProvisioningService dashboards.DashboardProvisioningService, folderService dashboards.FolderService,
datasourcePermissionsService permissions.DatasourcePermissionsService, alertNotificationService *alerting.AlertNotificationService,
dashboardsnapshotsService *dashboardsnapshots.Service, commentsService *comments.Service, pluginSettings *pluginSettings.Service,
avatarCacheServer *avatar.AvatarCacheServer,
avatarCacheServer *avatar.AvatarCacheServer, preferenceService pref.Service,
) (*HTTPServer, error) {
web.Env = cfg.Env
m := web.New()
@@ -251,6 +253,7 @@ func ProvideHTTPServer(opts ServerOptions, cfg *setting.Cfg, routeRegister routi
PluginSettings: pluginSettings,
permissionServices: permissionsServices,
AvatarCacheServer: avatarCacheServer,
preferenceService: preferenceService,
}
if hs.Listener != nil {
hs.log.Debug("Using provided listener")