mirror of
https://github.com/grafana/grafana.git
synced 2025-01-10 08:03:58 -06:00
Chore: Deprecate FolderID in Hit (#77623)
* Chore: Deprecate FolderID in Hit * chore: regen specs * chore: remove accidental deprecation comment
This commit is contained in:
parent
a5044fe6db
commit
71dd335bf8
@ -452,6 +452,7 @@ func TestIntegrationDashboardDataAccess(t *testing.T) {
|
||||
hit := hits[0]
|
||||
require.Equal(t, hit.ID, savedDash.ID)
|
||||
require.Equal(t, hit.URL, fmt.Sprintf("/d/%s/%s", savedDash.UID, savedDash.Slug))
|
||||
// nolint:staticcheck
|
||||
require.Equal(t, hit.FolderID, savedFolder.ID)
|
||||
require.Equal(t, hit.FolderUID, savedFolder.UID)
|
||||
require.Equal(t, hit.FolderTitle, savedFolder.Title)
|
||||
@ -479,6 +480,7 @@ func TestIntegrationDashboardDataAccess(t *testing.T) {
|
||||
hit := hits[0]
|
||||
require.Equal(t, hit.ID, savedDash.ID)
|
||||
require.Equal(t, hit.URL, fmt.Sprintf("/d/%s/%s", savedDash.UID, savedDash.Slug))
|
||||
// nolint:staticcheck
|
||||
require.Equal(t, hit.FolderID, savedFolder.ID)
|
||||
require.Equal(t, hit.FolderUID, savedFolder.UID)
|
||||
require.Equal(t, hit.FolderTitle, savedFolder.Title)
|
||||
@ -1231,7 +1233,7 @@ func makeQueryResult(query *dashboards.FindPersistedDashboardsQuery, res []dashb
|
||||
URI: "db/" + item.Slug,
|
||||
URL: dashboards.GetDashboardFolderURL(item.IsFolder, item.UID, item.Slug),
|
||||
Type: hitType,
|
||||
FolderID: item.FolderID,
|
||||
FolderID: item.FolderID, // nolint:staticcheck
|
||||
FolderUID: item.FolderUID,
|
||||
FolderTitle: item.FolderTitle,
|
||||
Tags: []string{},
|
||||
|
@ -558,7 +558,7 @@ func makeQueryResult(query *dashboards.FindPersistedDashboardsQuery, res []dashb
|
||||
URI: "db/" + item.Slug,
|
||||
URL: dashboards.GetDashboardFolderURL(item.IsFolder, item.UID, item.Slug),
|
||||
Type: getHitType(item),
|
||||
FolderID: item.FolderID,
|
||||
FolderID: item.FolderID, // nolint:staticcheck
|
||||
FolderUID: item.FolderUID,
|
||||
FolderTitle: item.FolderTitle,
|
||||
Tags: []string{},
|
||||
|
@ -62,21 +62,22 @@ const (
|
||||
)
|
||||
|
||||
type Hit struct {
|
||||
ID int64 `json:"id"`
|
||||
UID string `json:"uid"`
|
||||
Title string `json:"title"`
|
||||
URI string `json:"uri"`
|
||||
URL string `json:"url"`
|
||||
Slug string `json:"slug"`
|
||||
Type HitType `json:"type"`
|
||||
Tags []string `json:"tags"`
|
||||
IsStarred bool `json:"isStarred"`
|
||||
FolderID int64 `json:"folderId,omitempty"`
|
||||
FolderUID string `json:"folderUid,omitempty"`
|
||||
FolderTitle string `json:"folderTitle,omitempty"`
|
||||
FolderURL string `json:"folderUrl,omitempty"`
|
||||
SortMeta int64 `json:"sortMeta"`
|
||||
SortMetaName string `json:"sortMetaName,omitempty"`
|
||||
ID int64 `json:"id"`
|
||||
UID string `json:"uid"`
|
||||
Title string `json:"title"`
|
||||
URI string `json:"uri"`
|
||||
URL string `json:"url"`
|
||||
Slug string `json:"slug"`
|
||||
Type HitType `json:"type"`
|
||||
Tags []string `json:"tags"`
|
||||
IsStarred bool `json:"isStarred"`
|
||||
// Deprecated: use FolderUID instead
|
||||
FolderID int64 `json:"folderId,omitempty"`
|
||||
FolderUID string `json:"folderUid,omitempty"`
|
||||
FolderTitle string `json:"folderTitle,omitempty"`
|
||||
FolderURL string `json:"folderUrl,omitempty"`
|
||||
SortMeta int64 `json:"sortMeta"`
|
||||
SortMetaName string `json:"sortMetaName,omitempty"`
|
||||
}
|
||||
|
||||
type HitList []*Hit
|
||||
|
@ -15278,6 +15278,7 @@
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"folderId": {
|
||||
"description": "Deprecated: use FolderUID instead",
|
||||
"type": "integer",
|
||||
"format": "int64"
|
||||
},
|
||||
|
@ -6191,6 +6191,7 @@
|
||||
"Hit": {
|
||||
"properties": {
|
||||
"folderId": {
|
||||
"description": "Deprecated: use FolderUID instead",
|
||||
"format": "int64",
|
||||
"type": "integer"
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user