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:
idafurjes
2023-01-18 13:52:41 +01:00
committed by GitHub
parent db0be6bc95
commit b573b19ca3
56 changed files with 497 additions and 822 deletions

View File

@@ -144,7 +144,7 @@ func (m *folderHelper) generateNewDashboardUid(orgId int64) (string, error) {
for i := 0; i < 3; i++ {
uid := util.GenerateShortUID()
exists, err := m.sess.Where("org_id=? AND uid=?", orgId, uid).Get(&models.Dashboard{})
exists, err := m.sess.Where("org_id=? AND uid=?", orgId, uid).Get(&dashboards.Dashboard{})
if err != nil {
return "", err
}
@@ -252,7 +252,7 @@ func (m *folderHelper) setACL(orgID int64, dashboardID int64, items []*dashboard
}
// Update dashboard HasACL flag
dashboard := models.Dashboard{HasACL: true}
dashboard := dashboards.Dashboard{HasACL: true}
_, err := m.sess.Cols("has_acl").Where("id=?", dashboardID).Update(&dashboard)
return err
}