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})
}
// nolint:staticcheck
if len(query.FolderIds) > 0 {
filters = append(filters, searchstore.FolderFilter{IDs: query.FolderIds})
}

View File

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

View File

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

View File

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