MM-14416: Adds new fields to Channels and Teams for use by LDAP groups removals. (#10450)
* MM-14416: Updates tests. * MM-14416: Adds new fields to models and patches. * MM-14416: Adds upgrade operations. * MM-14416: Removes the 'is' from the new field names. * MM-14416: Some fmting and removes API test change for now. * MM-14416: Adds team patch test. * MM-14416: Using sql.NullBool. * MM-14416: Using sql.NullBool.
Этот коммит содержится в:
коммит произвёл
Jesús Espino
родитель
683f215bd9
Коммит
16a9489bbb
@@ -4,6 +4,7 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"database/sql"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io"
|
||||
@@ -26,30 +27,32 @@ const (
|
||||
)
|
||||
|
||||
type Team struct {
|
||||
Id string `json:"id"`
|
||||
CreateAt int64 `json:"create_at"`
|
||||
UpdateAt int64 `json:"update_at"`
|
||||
DeleteAt int64 `json:"delete_at"`
|
||||
DisplayName string `json:"display_name"`
|
||||
Name string `json:"name"`
|
||||
Description string `json:"description"`
|
||||
Email string `json:"email"`
|
||||
Type string `json:"type"`
|
||||
CompanyName string `json:"company_name"`
|
||||
AllowedDomains string `json:"allowed_domains"`
|
||||
InviteId string `json:"invite_id"`
|
||||
AllowOpenInvite bool `json:"allow_open_invite"`
|
||||
LastTeamIconUpdate int64 `json:"last_team_icon_update,omitempty"`
|
||||
SchemeId *string `json:"scheme_id"`
|
||||
Id string `json:"id"`
|
||||
CreateAt int64 `json:"create_at"`
|
||||
UpdateAt int64 `json:"update_at"`
|
||||
DeleteAt int64 `json:"delete_at"`
|
||||
DisplayName string `json:"display_name"`
|
||||
Name string `json:"name"`
|
||||
Description string `json:"description"`
|
||||
Email string `json:"email"`
|
||||
Type string `json:"type"`
|
||||
CompanyName string `json:"company_name"`
|
||||
AllowedDomains string `json:"allowed_domains"`
|
||||
InviteId string `json:"invite_id"`
|
||||
AllowOpenInvite bool `json:"allow_open_invite"`
|
||||
LastTeamIconUpdate int64 `json:"last_team_icon_update,omitempty"`
|
||||
SchemeId *string `json:"scheme_id"`
|
||||
GroupConstrained sql.NullBool `json:"group_constrained"`
|
||||
}
|
||||
|
||||
type TeamPatch struct {
|
||||
DisplayName *string `json:"display_name"`
|
||||
Description *string `json:"description"`
|
||||
CompanyName *string `json:"company_name"`
|
||||
AllowedDomains *string `json:"allowed_domains"`
|
||||
InviteId *string `json:"invite_id"`
|
||||
AllowOpenInvite *bool `json:"allow_open_invite"`
|
||||
DisplayName *string `json:"display_name"`
|
||||
Description *string `json:"description"`
|
||||
CompanyName *string `json:"company_name"`
|
||||
AllowedDomains *string `json:"allowed_domains"`
|
||||
InviteId *string `json:"invite_id"`
|
||||
AllowOpenInvite *bool `json:"allow_open_invite"`
|
||||
GroupConstrained *bool `json:"group_constrained"`
|
||||
}
|
||||
|
||||
type TeamForExport struct {
|
||||
@@ -273,6 +276,10 @@ func (t *Team) Patch(patch *TeamPatch) {
|
||||
if patch.AllowOpenInvite != nil {
|
||||
t.AllowOpenInvite = *patch.AllowOpenInvite
|
||||
}
|
||||
|
||||
if patch.GroupConstrained != nil {
|
||||
t.GroupConstrained.Bool = *patch.GroupConstrained
|
||||
}
|
||||
}
|
||||
|
||||
func (t *TeamPatch) ToJson() string {
|
||||
|
||||
Ссылка в новой задаче
Block a user