Chore: Remove FolderID from Dashboard Import (#78832)

* Chore: Remove FolderID from Dashboard Import

* chore: regen specs

* Remove OrgID from DashboardImportRequest and DashboardImportResponse

* Remove OrdIDs from swagger and tests

---------

Co-authored-by: Ida Furjesova <ida.furjesova@grafana.com>
This commit is contained in:
Kat Yang 2023-12-13 06:03:23 -05:00 committed by GitHub
parent 7a38a5ab1d
commit e4738cbaf9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -195,8 +195,7 @@ func TestDashboardUpdater(t *testing.T) {
require.Equal(t, "updated.json", ctx.importDashboardArgs[0].Path)
require.Equal(t, int64(2), ctx.importDashboardArgs[0].User.GetOrgID())
require.Equal(t, org.RoleAdmin, ctx.importDashboardArgs[0].User.GetOrgRole())
// nolint:staticcheck
require.Equal(t, int64(0), ctx.importDashboardArgs[0].FolderId)
require.Equal(t, string(""), ctx.importDashboardArgs[0].FolderUid)
require.True(t, ctx.importDashboardArgs[0].Overwrite)
})
})
@ -323,24 +322,21 @@ func TestDashboardUpdater(t *testing.T) {
require.Equal(t, "dashboard1.json", ctx.importDashboardArgs[0].Path)
require.Equal(t, int64(2), ctx.importDashboardArgs[0].User.GetOrgID())
require.Equal(t, org.RoleAdmin, ctx.importDashboardArgs[0].User.GetOrgRole())
// nolint:staticcheck
require.Equal(t, int64(0), ctx.importDashboardArgs[0].FolderId)
require.Equal(t, string(""), ctx.importDashboardArgs[0].FolderUid)
require.True(t, ctx.importDashboardArgs[0].Overwrite)
require.Equal(t, "test", ctx.importDashboardArgs[1].PluginId)
require.Equal(t, "dashboard2.json", ctx.importDashboardArgs[1].Path)
require.Equal(t, int64(2), ctx.importDashboardArgs[1].User.GetOrgID())
require.Equal(t, org.RoleAdmin, ctx.importDashboardArgs[1].User.GetOrgRole())
// nolint:staticcheck
require.Equal(t, int64(0), ctx.importDashboardArgs[1].FolderId)
require.Equal(t, string(""), ctx.importDashboardArgs[0].FolderUid)
require.True(t, ctx.importDashboardArgs[1].Overwrite)
require.Equal(t, "test", ctx.importDashboardArgs[2].PluginId)
require.Equal(t, "dashboard3.json", ctx.importDashboardArgs[2].Path)
require.Equal(t, int64(2), ctx.importDashboardArgs[2].User.GetOrgID())
require.Equal(t, org.RoleAdmin, ctx.importDashboardArgs[2].User.GetOrgRole())
// nolint:staticcheck
require.Equal(t, int64(0), ctx.importDashboardArgs[2].FolderId)
require.Equal(t, string(""), ctx.importDashboardArgs[0].FolderUid)
require.True(t, ctx.importDashboardArgs[2].Overwrite)
})
}