Chore: Move team models to models pkg (#61262)

* Chore: Move team models to models pkg

* Fix ACL tests

* More ACL tests

* Change Id to ID in conflict user command test

* Remove team from models

* Fix ac test lint
This commit is contained in:
idafurjes
2023-01-11 14:20:09 +01:00
committed by GitHub
parent 672b1711b0
commit f2ffce4351
31 changed files with 385 additions and 359 deletions
@@ -16,6 +16,7 @@ import (
acmig "github.com/grafana/grafana/pkg/services/sqlstore/migrations/accesscontrol"
"github.com/grafana/grafana/pkg/services/sqlstore/migrator"
"github.com/grafana/grafana/pkg/services/sqlstore/sqlutil"
"github.com/grafana/grafana/pkg/services/team"
"github.com/grafana/grafana/pkg/services/user"
"github.com/grafana/grafana/pkg/setting"
@@ -315,16 +316,16 @@ func setupTeams(t *testing.T, x *xorm.Engine) {
require.Equal(t, int64(5), orgUsersCount, "needed 5 users for this test to run")
// Setup teams (and members)
teams := []models.Team{
teams := []team.Team{
{
OrgId: 1,
OrgID: 1,
Name: "teamOrg1",
Email: "teamorg1@example.org",
Created: now,
Updated: now,
},
{
OrgId: 2,
OrgID: 2,
Name: "teamOrg2",
Email: "teamorg2@example.org",
Created: now,
+5 -4
View File
@@ -9,6 +9,7 @@ import (
"github.com/grafana/grafana/pkg/services/sqlstore"
"github.com/grafana/grafana/pkg/services/sqlstore/migrator"
"github.com/grafana/grafana/pkg/services/sqlstore/session"
"github.com/grafana/grafana/pkg/services/team"
"github.com/grafana/grafana/pkg/services/user"
)
@@ -20,7 +21,7 @@ type SQLStoreMock struct {
LastGetAlertsQuery *models.GetAlertsQuery
ExpectedUser *user.User
ExpectedTeamsByUser []*models.TeamDTO
ExpectedTeamsByUser []*team.TeamDTO
ExpectedAlert *models.Alert
ExpectedSystemStats *models.SystemStats
ExpectedDataSourceStats []*models.DataSourceStats
@@ -75,11 +76,11 @@ func (m *SQLStoreMock) GetUserProfile(ctx context.Context, query *user.GetUserPr
return m.ExpectedError
}
func (m *SQLStoreMock) CreateTeam(name string, email string, orgID int64) (models.Team, error) {
return models.Team{
func (m *SQLStoreMock) CreateTeam(name string, email string, orgID int64) (team.Team, error) {
return team.Team{
Name: name,
Email: email,
OrgId: orgID,
OrgID: orgID,
}, nil
}