Chore: Deprecate FolderID from DashboardSearchProjection (#77811)

pull/77880/head
Kat Yang 2 years ago committed by GitHub
parent 82daf05145
commit bc875b4c13
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      pkg/services/dashboards/database/database_test.go
  2. 13
      pkg/services/dashboards/models.go
  3. 1
      pkg/services/dashboards/service/dashboard_service.go

@ -1239,6 +1239,7 @@ func makeQueryResult(query *dashboards.FindPersistedDashboardsQuery, res []dashb
Tags: []string{}, Tags: []string{},
} }
// nolint:staticcheck
if item.FolderID > 0 { if item.FolderID > 0 {
hit.FolderURL = dashboards.GetFolderURL(item.FolderUID, item.FolderSlug) hit.FolderURL = dashboards.GetFolderURL(item.FolderUID, item.FolderSlug)
} }

@ -348,12 +348,13 @@ type SaveDashboardDTO struct {
} }
type DashboardSearchProjection struct { type DashboardSearchProjection struct {
ID int64 `xorm:"id"` ID int64 `xorm:"id"`
UID string `xorm:"uid"` UID string `xorm:"uid"`
Title string Title string
Slug string Slug string
Term string Term string
IsFolder bool IsFolder bool
// Deprecated: use FolderUID instead
FolderID int64 `xorm:"folder_id"` FolderID int64 `xorm:"folder_id"`
FolderUID string `xorm:"folder_uid"` FolderUID string `xorm:"folder_uid"`
FolderSlug string FolderSlug string

@ -564,6 +564,7 @@ func makeQueryResult(query *dashboards.FindPersistedDashboardsQuery, res []dashb
Tags: []string{}, Tags: []string{},
} }
// nolint:staticcheck
if item.FolderID > 0 { if item.FolderID > 0 {
hit.FolderURL = dashboards.GetFolderURL(item.FolderUID, item.FolderSlug) hit.FolderURL = dashboards.GetFolderURL(item.FolderUID, item.FolderSlug)
} }

Loading…
Cancel
Save