mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Chore: Move dashboard models to dashboard pkg (#61458)
* Copy dashboard models to dashboard pkg * Use some models from current pkg instead of models * Adjust api pkg * Adjust pkg services * Fix lint
This commit is contained in:
@@ -9,7 +9,7 @@ import (
|
||||
"github.com/grafana/grafana/pkg/expr"
|
||||
"github.com/grafana/grafana/pkg/infra/log"
|
||||
"github.com/grafana/grafana/pkg/infra/x/persistentcollection"
|
||||
"github.com/grafana/grafana/pkg/models"
|
||||
"github.com/grafana/grafana/pkg/services/dashboards"
|
||||
"github.com/grafana/grafana/pkg/services/featuremgmt"
|
||||
"github.com/grafana/grafana/pkg/services/querylibrary"
|
||||
"github.com/grafana/grafana/pkg/services/store/kind/dashboard"
|
||||
@@ -67,7 +67,7 @@ type queryLoader interface {
|
||||
byUID(uid string) (*querylibrary.Query, error)
|
||||
}
|
||||
|
||||
func (s *service) UpdateDashboardQueries(ctx context.Context, user *user.SignedInUser, dash *models.Dashboard) error {
|
||||
func (s *service) UpdateDashboardQueries(ctx context.Context, user *user.SignedInUser, dash *dashboards.Dashboard) error {
|
||||
queryLoader := newPerRequestQueryLoader(ctx, user, s)
|
||||
return s.updateQueriesRecursively(queryLoader, dash.Data)
|
||||
}
|
||||
|
||||
@@ -5,8 +5,8 @@ import (
|
||||
|
||||
"github.com/grafana/grafana/pkg/api/routing"
|
||||
"github.com/grafana/grafana/pkg/components/simplejson"
|
||||
"github.com/grafana/grafana/pkg/models"
|
||||
"github.com/grafana/grafana/pkg/registry"
|
||||
"github.com/grafana/grafana/pkg/services/dashboards"
|
||||
"github.com/grafana/grafana/pkg/services/store/kind/dashboard"
|
||||
"github.com/grafana/grafana/pkg/services/user"
|
||||
)
|
||||
@@ -78,7 +78,7 @@ type Service interface {
|
||||
GetBatch(ctx context.Context, user *user.SignedInUser, uids []string) ([]*Query, error)
|
||||
Update(ctx context.Context, user *user.SignedInUser, query *Query) error
|
||||
Delete(ctx context.Context, user *user.SignedInUser, uid string) error
|
||||
UpdateDashboardQueries(ctx context.Context, user *user.SignedInUser, dash *models.Dashboard) error
|
||||
UpdateDashboardQueries(ctx context.Context, user *user.SignedInUser, dash *dashboards.Dashboard) error
|
||||
registry.CanBeDisabled
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user