[MM-13671] Rework Team InviteId Creation and Updates (#10536)

* Add regenerate invite ID endpoint; Dont allow inviteID updates via other methods; Remove unrequired checks in get handler

* Fix tests; Dont accept TeamId as invite ID

* Ensure all teams have an InviteID set

* Custom Selector to get empty teams; dont crash when inviteid set fails

* Remote InviteId from TeamPatch

* Add missing translation

* Translation string order

* Use sync store

* gofmt
Этот коммит содержится в:
Daniel Schalla
2019-04-25 23:09:38 +02:00
коммит произвёл GitHub
родитель ec95793b90
Коммит f7982216e4
11 изменённых файлов: 109 добавлений и 99 удалений

Просмотреть файл

@@ -283,8 +283,7 @@ func TestCreateUserWithInviteId(t *testing.T) {
inviteId := th.BasicTeam.InviteId
th.BasicTeam.InviteId = model.NewId()
_, resp := th.SystemAdminClient.UpdateTeam(th.BasicTeam)
_, resp := th.SystemAdminClient.RegenerateTeamInviteId(th.BasicTeam.Id)
CheckNoError(t, resp)
_, resp = th.Client.CreateUserWithInviteId(&user, inviteId)
@@ -319,7 +318,9 @@ func TestCreateUserWithInviteId(t *testing.T) {
th.App.UpdateConfig(func(cfg *model.Config) { *cfg.TeamSettings.EnableOpenServer = false })
inviteId := th.BasicTeam.InviteId
team, res := th.SystemAdminClient.RegenerateTeamInviteId(th.BasicTeam.Id)
assert.Nil(t, res.Error)
inviteId := team.InviteId
ruser, resp := th.Client.CreateUserWithInviteId(&user, inviteId)
CheckNoError(t, resp)