mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Chore: Remove FolderId from DashboardMeta (#78501)
* Chore: Remove FolderId from DashboardMeta * chore: replace FolderId with FolderUid * chore: fix test by adding FolderUID
This commit is contained in:
parent
7181811f96
commit
2d66d0de61
@ -87,6 +87,7 @@ func (pd *PublicDashboardServiceImpl) GetPublicDashboardForView(ctx context.Cont
|
||||
Version: dash.Version,
|
||||
IsFolder: false,
|
||||
FolderId: dash.FolderID, // nolint:staticcheck
|
||||
FolderUid: dash.FolderUID,
|
||||
PublicDashboardEnabled: pubdash.IsEnabled,
|
||||
}
|
||||
dash.Data.Get("timepicker").Set("hidden", !pubdash.TimeSelectionEnabled)
|
||||
|
@ -312,8 +312,7 @@ func TestGetPublicDashboardForView(t *testing.T) {
|
||||
|
||||
// #nosec G101 -- This is dummy/test token
|
||||
accessToken := "c54b1c4dd2b143a1a7a43005264d256d"
|
||||
// nolint:staticcheck
|
||||
d := &dashboards.Dashboard{UID: "mydashboard", Data: data, Slug: "dashboardSlug", Created: now, Updated: now, Version: 1, FolderID: 1}
|
||||
d := &dashboards.Dashboard{UID: "mydashboard", OrgID: 0, Data: data, Slug: "dashboardSlug", Created: now, Updated: now, Version: 1, FolderUID: "myFolder"}
|
||||
|
||||
testCases := []struct {
|
||||
Name string
|
||||
@ -345,7 +344,7 @@ func TestGetPublicDashboardForView(t *testing.T) {
|
||||
Updated: d.Updated,
|
||||
Version: d.Version,
|
||||
IsFolder: false,
|
||||
FolderId: d.FolderID, // nolint:staticcheck
|
||||
FolderUid: d.FolderUID,
|
||||
PublicDashboardEnabled: true,
|
||||
},
|
||||
},
|
||||
@ -373,7 +372,7 @@ func TestGetPublicDashboardForView(t *testing.T) {
|
||||
Updated: d.Updated,
|
||||
Version: d.Version,
|
||||
IsFolder: false,
|
||||
FolderId: d.FolderID, // nolint:staticcheck
|
||||
FolderUid: d.FolderUID,
|
||||
PublicDashboardEnabled: true,
|
||||
},
|
||||
},
|
||||
@ -414,8 +413,7 @@ func TestGetPublicDashboardForView(t *testing.T) {
|
||||
assert.Equal(t, test.DashResp.Meta.Updated, dashboardFullWithMeta.Meta.Updated)
|
||||
assert.Equal(t, test.DashResp.Meta.Version, dashboardFullWithMeta.Meta.Version)
|
||||
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.FolderUid, dashboardFullWithMeta.Meta.FolderUid)
|
||||
assert.Equal(t, test.DashResp.Meta.PublicDashboardEnabled, dashboardFullWithMeta.Meta.PublicDashboardEnabled)
|
||||
|
||||
// hide the timepicker if the time selection is disabled
|
||||
@ -1895,7 +1893,6 @@ func insertTestDashboard(t *testing.T, dashboardStore dashboards.Store, title st
|
||||
|
||||
cmd := dashboards.SaveDashboardCommand{
|
||||
OrgID: orgId,
|
||||
FolderID: folderId, // nolint:staticcheck
|
||||
FolderUID: folderUID,
|
||||
IsFolder: isFolder,
|
||||
Dashboard: simplejson.NewFromAny(map[string]any{
|
||||
|
Loading…
Reference in New Issue
Block a user