Chore: Deprecate FolderIds from FindPersistedDashboardsQuery (#77651)

* Chore: Deprecate FolderIds from FindPersistedDashboardsQuery

* Update pkg/services/dashboards/models.go

Co-authored-by: Arati R. <33031346+suntala@users.noreply.github.com>

---------

Co-authored-by: Arati R. <33031346+suntala@users.noreply.github.com>
This commit is contained in:
Kat Yang 2023-11-09 11:07:10 -05:00 committed by GitHub
parent 1c758ab5f2
commit c94410fdee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 10 deletions

View File

@ -1004,6 +1004,7 @@ func (d *dashboardStore) FindDashboards(ctx context.Context, query *dashboards.F
filters = append(filters, searchstore.TypeFilter{Dialect: d.store.GetDialect(), Type: query.Type}) filters = append(filters, searchstore.TypeFilter{Dialect: d.store.GetDialect(), Type: query.Type})
} }
// nolint:staticcheck
if len(query.FolderIds) > 0 { if len(query.FolderIds) > 0 {
filters = append(filters, searchstore.FolderFilter{IDs: query.FolderIds}) filters = append(filters, searchstore.FolderFilter{IDs: query.FolderIds})
} }

View File

@ -170,7 +170,7 @@ func TestIntegrationDashboardFolderDataAccess(t *testing.T) {
FolderIds: []int64{ FolderIds: []int64{
rootFolderId, rootFolderId,
folder1.ID, folder1.ID,
}, }, // nolint:staticcheck
SignedInUser: currentUser, SignedInUser: currentUser,
OrgId: 1, OrgId: 1,
} }

View File

@ -276,7 +276,7 @@ func TestIntegrationDashboardDataAccess(t *testing.T) {
query := dashboards.FindPersistedDashboardsQuery{ query := dashboards.FindPersistedDashboardsQuery{
OrgId: 1, OrgId: 1,
FolderIds: []int64{savedFolder.ID}, FolderIds: []int64{savedFolder.ID}, // nolint:staticcheck
SignedInUser: &user.SignedInUser{}, SignedInUser: &user.SignedInUser{},
} }
@ -435,7 +435,7 @@ func TestIntegrationDashboardDataAccess(t *testing.T) {
setup() setup()
query := dashboards.FindPersistedDashboardsQuery{ query := dashboards.FindPersistedDashboardsQuery{
OrgId: 1, OrgId: 1,
FolderIds: []int64{savedFolder.ID}, FolderIds: []int64{savedFolder.ID}, // nolint:staticcheck
SignedInUser: &user.SignedInUser{ SignedInUser: &user.SignedInUser{
OrgID: 1, OrgID: 1,
OrgRole: org.RoleEditor, OrgRole: org.RoleEditor,

View File

@ -486,13 +486,14 @@ type FindPersistedDashboardsQuery struct {
DashboardIds []int64 DashboardIds []int64
DashboardUIDs []string DashboardUIDs []string
Type string Type string
FolderIds []int64 // Deprecated: use FolderUIDs instead
FolderUIDs []string FolderIds []int64
Tags []string FolderUIDs []string
Limit int64 Tags []string
Page int64 Limit int64
Permission PermissionType Page int64
Sort model.SortOption Permission PermissionType
Sort model.SortOption
Filters []any Filters []any
} }