|
|
@ -34,7 +34,7 @@ type Service struct { |
|
|
|
features featuremgmt.FeatureToggles |
|
|
|
features featuremgmt.FeatureToggles |
|
|
|
accessControl accesscontrol.AccessControl |
|
|
|
accessControl accesscontrol.AccessControl |
|
|
|
|
|
|
|
|
|
|
|
// bus is currently used to publish events that cause scheduler to update rules.
|
|
|
|
// bus is currently used to publish event in case of title change
|
|
|
|
bus bus.Bus |
|
|
|
bus bus.Bus |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -121,8 +121,12 @@ func (s *Service) Get(ctx context.Context, cmd *folder.GetFolderQuery) (*folder. |
|
|
|
cmd.ID = nil |
|
|
|
cmd.ID = nil |
|
|
|
cmd.UID = &dashFolder.UID |
|
|
|
cmd.UID = &dashFolder.UID |
|
|
|
} |
|
|
|
} |
|
|
|
f, err := s.store.Get(ctx, *cmd) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if dashFolder.IsGeneral() { |
|
|
|
|
|
|
|
return dashFolder, nil |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
f, err := s.store.Get(ctx, *cmd) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
return nil, err |
|
|
|
return nil, err |
|
|
|
} |
|
|
|
} |
|
|
@ -191,7 +195,7 @@ func (s *Service) GetParents(ctx context.Context, q folder.GetParentsQuery) ([]* |
|
|
|
|
|
|
|
|
|
|
|
func (s *Service) getFolderByID(ctx context.Context, user *user.SignedInUser, id int64, orgID int64) (*folder.Folder, error) { |
|
|
|
func (s *Service) getFolderByID(ctx context.Context, user *user.SignedInUser, id int64, orgID int64) (*folder.Folder, error) { |
|
|
|
if id == 0 { |
|
|
|
if id == 0 { |
|
|
|
return &folder.Folder{ID: id, Title: "General"}, nil |
|
|
|
return &folder.GeneralFolder, nil |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
dashFolder, err := s.dashboardFolderStore.GetFolderByID(ctx, orgID, id) |
|
|
|
dashFolder, err := s.dashboardFolderStore.GetFolderByID(ctx, orgID, id) |
|
|
|