Chore: Remove dashboards from models pkg (#61578)
* Copy dashboard models to dashboard pkg * Use some models from current pkg instead of models * Adjust api pkg * Adjust pkg services * Fix lint * Chore: Remove dashboards models * Remove dashboards from models pkg * Fix lint in tests * Fix lint in tests 2 * Fix for import in auth * Remove newline * Revert unused fix
This commit is contained in:
@@ -148,13 +148,13 @@ func TestIntegration_DashboardPermissionFilter(t *testing.T) {
|
||||
func setupTest(t *testing.T, numFolders, numDashboards int, permissions []accesscontrol.Permission) db.DB {
|
||||
store := db.InitTestDB(t)
|
||||
err := store.WithDbSession(context.Background(), func(sess *sqlstore.DBSession) error {
|
||||
dashes := make([]models.Dashboard, 0, numFolders+numDashboards)
|
||||
dashes := make([]dashboards.Dashboard, 0, numFolders+numDashboards)
|
||||
for i := 1; i <= numFolders; i++ {
|
||||
str := strconv.Itoa(i)
|
||||
dashes = append(dashes, models.Dashboard{
|
||||
OrgId: 1,
|
||||
dashes = append(dashes, dashboards.Dashboard{
|
||||
OrgID: 1,
|
||||
Slug: str,
|
||||
Uid: str,
|
||||
UID: str,
|
||||
Title: str,
|
||||
IsFolder: true,
|
||||
Data: simplejson.New(),
|
||||
@@ -169,11 +169,11 @@ func setupTest(t *testing.T, numFolders, numDashboards int, permissions []access
|
||||
if i%numFolders != 0 {
|
||||
folderID = i % numFolders
|
||||
}
|
||||
dashes = append(dashes, models.Dashboard{
|
||||
OrgId: 1,
|
||||
dashes = append(dashes, dashboards.Dashboard{
|
||||
OrgID: 1,
|
||||
IsFolder: false,
|
||||
FolderId: int64(folderID),
|
||||
Uid: str,
|
||||
FolderID: int64(folderID),
|
||||
UID: str,
|
||||
Slug: str,
|
||||
Title: str,
|
||||
Data: simplejson.New(),
|
||||
|
||||
@@ -41,13 +41,13 @@ func setupBenchMark(b *testing.B, numUsers, numDashboards int) db.DB {
|
||||
store := db.InitTestDB(b)
|
||||
now := time.Now()
|
||||
err := store.WithDbSession(context.Background(), func(sess *sqlstore.DBSession) error {
|
||||
dashes := make([]models.Dashboard, 0, numDashboards)
|
||||
dashes := make([]dashboards.Dashboard, 0, numDashboards)
|
||||
for i := 1; i <= numDashboards; i++ {
|
||||
str := strconv.Itoa(i)
|
||||
dashes = append(dashes, models.Dashboard{
|
||||
OrgId: 1,
|
||||
dashes = append(dashes, dashboards.Dashboard{
|
||||
OrgID: 1,
|
||||
IsFolder: false,
|
||||
Uid: str,
|
||||
UID: str,
|
||||
Slug: str,
|
||||
Title: str,
|
||||
Data: simplejson.New(),
|
||||
@@ -82,7 +82,7 @@ func setupBenchMark(b *testing.B, numUsers, numDashboards int) db.DB {
|
||||
permissions = append(permissions, accesscontrol.Permission{
|
||||
RoleID: int64(i),
|
||||
Action: dashboards.ActionDashboardsRead,
|
||||
Scope: dashboards.ScopeDashboardsProvider.GetResourceScopeUID(dash.Uid),
|
||||
Scope: dashboards.ScopeDashboardsProvider.GetResourceScopeUID(dash.UID),
|
||||
Updated: now,
|
||||
Created: now,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user