mirror of https://github.com/grafana/grafana.git
Chore: Deprecate FolderId in DashboardMeta (#77626)
* Chore: Deprecate FolderId in DashboardMeta * chore: regen specs
This commit is contained in:
parent
911ffed45b
commit
6ed09de47d
|
|
@ -164,7 +164,7 @@ func (hs *HTTPServer) GetDashboard(c *contextmodel.ReqContext) response.Response
|
||||||
Version: dash.Version,
|
Version: dash.Version,
|
||||||
HasACL: dash.HasACL,
|
HasACL: dash.HasACL,
|
||||||
IsFolder: dash.IsFolder,
|
IsFolder: dash.IsFolder,
|
||||||
FolderId: dash.FolderID,
|
FolderId: dash.FolderID, // nolint:staticcheck
|
||||||
Url: dash.GetURL(),
|
Url: dash.GetURL(),
|
||||||
FolderTitle: "General",
|
FolderTitle: "General",
|
||||||
AnnotationsPermissions: annotationPermissions,
|
AnnotationsPermissions: annotationPermissions,
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@ type DashboardMeta struct {
|
||||||
Version int `json:"version"`
|
Version int `json:"version"`
|
||||||
HasACL bool `json:"hasAcl" xorm:"has_acl"`
|
HasACL bool `json:"hasAcl" xorm:"has_acl"`
|
||||||
IsFolder bool `json:"isFolder"`
|
IsFolder bool `json:"isFolder"`
|
||||||
|
// Deprecated: use FolderUID instead
|
||||||
FolderId int64 `json:"folderId"`
|
FolderId int64 `json:"folderId"`
|
||||||
FolderUid string `json:"folderUid"`
|
FolderUid string `json:"folderUid"`
|
||||||
FolderTitle string `json:"folderTitle"`
|
FolderTitle string `json:"folderTitle"`
|
||||||
|
|
|
||||||
|
|
@ -83,7 +83,7 @@ func (pd *PublicDashboardServiceImpl) GetPublicDashboardForView(ctx context.Cont
|
||||||
Updated: dash.Updated,
|
Updated: dash.Updated,
|
||||||
Version: dash.Version,
|
Version: dash.Version,
|
||||||
IsFolder: false,
|
IsFolder: false,
|
||||||
FolderId: dash.FolderID,
|
FolderId: dash.FolderID, // nolint:staticcheck
|
||||||
PublicDashboardEnabled: pubdash.IsEnabled,
|
PublicDashboardEnabled: pubdash.IsEnabled,
|
||||||
}
|
}
|
||||||
dash.Data.Get("timepicker").Set("hidden", !pubdash.TimeSelectionEnabled)
|
dash.Data.Get("timepicker").Set("hidden", !pubdash.TimeSelectionEnabled)
|
||||||
|
|
|
||||||
|
|
@ -344,7 +344,7 @@ func TestGetPublicDashboardForView(t *testing.T) {
|
||||||
Updated: d.Updated,
|
Updated: d.Updated,
|
||||||
Version: d.Version,
|
Version: d.Version,
|
||||||
IsFolder: false,
|
IsFolder: false,
|
||||||
FolderId: d.FolderID,
|
FolderId: d.FolderID, // nolint:staticcheck
|
||||||
PublicDashboardEnabled: true,
|
PublicDashboardEnabled: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
@ -372,7 +372,7 @@ func TestGetPublicDashboardForView(t *testing.T) {
|
||||||
Updated: d.Updated,
|
Updated: d.Updated,
|
||||||
Version: d.Version,
|
Version: d.Version,
|
||||||
IsFolder: false,
|
IsFolder: false,
|
||||||
FolderId: d.FolderID,
|
FolderId: d.FolderID, // nolint:staticcheck
|
||||||
PublicDashboardEnabled: true,
|
PublicDashboardEnabled: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
@ -411,6 +411,7 @@ func TestGetPublicDashboardForView(t *testing.T) {
|
||||||
assert.Equal(t, test.DashResp.Meta.Updated, dashboardFullWithMeta.Meta.Updated)
|
assert.Equal(t, test.DashResp.Meta.Updated, dashboardFullWithMeta.Meta.Updated)
|
||||||
assert.Equal(t, test.DashResp.Meta.Version, dashboardFullWithMeta.Meta.Version)
|
assert.Equal(t, test.DashResp.Meta.Version, dashboardFullWithMeta.Meta.Version)
|
||||||
assert.Equal(t, false, dashboardFullWithMeta.Meta.IsFolder)
|
assert.Equal(t, false, dashboardFullWithMeta.Meta.IsFolder)
|
||||||
|
// nolint:staticcheck
|
||||||
assert.Equal(t, test.DashResp.Meta.FolderId, dashboardFullWithMeta.Meta.FolderId)
|
assert.Equal(t, test.DashResp.Meta.FolderId, dashboardFullWithMeta.Meta.FolderId)
|
||||||
assert.Equal(t, test.DashResp.Meta.PublicDashboardEnabled, dashboardFullWithMeta.Meta.PublicDashboardEnabled)
|
assert.Equal(t, test.DashResp.Meta.PublicDashboardEnabled, dashboardFullWithMeta.Meta.PublicDashboardEnabled)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13530,6 +13530,7 @@
|
||||||
"format": "date-time"
|
"format": "date-time"
|
||||||
},
|
},
|
||||||
"folderId": {
|
"folderId": {
|
||||||
|
"description": "Deprecated: use FolderUID instead",
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
"format": "int64"
|
"format": "int64"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -4443,6 +4443,7 @@
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"folderId": {
|
"folderId": {
|
||||||
|
"description": "Deprecated: use FolderUID instead",
|
||||||
"format": "int64",
|
"format": "int64",
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue