Split preference store (#46843)

* Split preference store

* Chore: Add tests to pref

* Fix preference in wire

* Rename and adjust

* Add pref service test

* Rename methods, add tests

* Rename Preferences to Preference, names IDs correctly

* Fix lint

* Refactor Save

* Refactor upsert
Add new logic for QueryHistory
Rename some fields according to go naming conventions
Refactore tests

* Roll back ID that breaks tests

* Rename Id to ID in UpdatePreferenceQuery

* Use preference as a model to modify store

* Move pref store fakes to pref test file

* Add integration tag for store tests

* Adjust test

Co-authored-by: yangkb09 <yangkb09@gmail.com>
This commit is contained in:
idafurjes
2022-04-14 14:22:00 +02:00
committed by GitHub
co-authored by yangkb09
parent 060ccacbf9
commit ecd6cd4a92
8 changed files with 1054 additions and 1 deletions
+2 -1
View File
@@ -65,13 +65,13 @@ import (
plugindashboardsservice "github.com/grafana/grafana/pkg/services/plugindashboards/service"
"github.com/grafana/grafana/pkg/services/pluginsettings"
pluginSettings "github.com/grafana/grafana/pkg/services/pluginsettings/service"
"github.com/grafana/grafana/pkg/services/preference/prefimpl"
"github.com/grafana/grafana/pkg/services/query"
"github.com/grafana/grafana/pkg/services/queryhistory"
"github.com/grafana/grafana/pkg/services/quota"
"github.com/grafana/grafana/pkg/services/rendering"
"github.com/grafana/grafana/pkg/services/schemaloader"
"github.com/grafana/grafana/pkg/services/search"
"github.com/grafana/grafana/pkg/services/searchV2"
"github.com/grafana/grafana/pkg/services/secrets"
secretsDatabase "github.com/grafana/grafana/pkg/services/secrets/database"
@@ -235,6 +235,7 @@ var wireBasicSet = wire.NewSet(
wire.Bind(new(alerting.DashAlertExtractor), new(*alerting.DashAlertExtractorService)),
comments.ProvideService,
guardian.ProvideService,
prefimpl.ProvideService,
avatar.ProvideAvatarCacheServer,
authproxy.ProvideAuthProxy,
statscollector.ProvideService,