MM-39058 - invite people to join team and channels (#19849)

* MM-39058-invite-to-team-from-add-channel

* fix tests by validating the memberInvite is not nil

* fix i18n texts

* fix lint problem

* fix translation lines

* fix the data structure

* modify api4-team_local file to match with the expected structure

* fix unit tests, fix translation tests

* remove go routine cause not necesary

* add unit test for invite to team and channel

* remove unnecessary validation

* allow both data structures, simple string array and object with memberInvite struct

* fix texts

* fix linter

* fix problems with graceful invites workflow

* handle error while parsing body

* fix unit tests

* take the address just once

* rename channels to channelIds

* fix unit tests

* add tests and fix local channels invite support

Co-authored-by: Pablo Velez Vidal <pablo.velez@mattermost.com>
Этот коммит содержится в:
Pablo Andrés Vélez Vidal
2022-04-08 12:20:44 -05:00
коммит произвёл GitHub
родитель 0e4b0b6939
Коммит 4b354685e9
16 изменённых файлов: 517 добавлений и 52 удалений

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

@@ -237,6 +237,29 @@ func (_m *ServiceInterface) SendInviteEmails(team *model.Team, senderName string
return r0
}
// SendInviteEmailsToTeamAndChannels provides a mock function with given fields: team, channels, senderName, senderUserId, senderProfileImage, invites, siteURL, reminderData, message, errorWhenNotSent
func (_m *ServiceInterface) SendInviteEmailsToTeamAndChannels(team *model.Team, channels []*model.Channel, senderName string, senderUserId string, senderProfileImage []byte, invites []string, siteURL string, reminderData *model.TeamInviteReminderData, message string, errorWhenNotSent bool) ([]*model.EmailInviteWithError, error) {
ret := _m.Called(team, channels, senderName, senderUserId, senderProfileImage, invites, siteURL, reminderData, message, errorWhenNotSent)
var r0 []*model.EmailInviteWithError
if rf, ok := ret.Get(0).(func(*model.Team, []*model.Channel, string, string, []byte, []string, string, *model.TeamInviteReminderData, string, bool) []*model.EmailInviteWithError); ok {
r0 = rf(team, channels, senderName, senderUserId, senderProfileImage, invites, siteURL, reminderData, message, errorWhenNotSent)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]*model.EmailInviteWithError)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(*model.Team, []*model.Channel, string, string, []byte, []string, string, *model.TeamInviteReminderData, string, bool) error); ok {
r1 = rf(team, channels, senderName, senderUserId, senderProfileImage, invites, siteURL, reminderData, message, errorWhenNotSent)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// SendLicenseInactivityEmail provides a mock function with given fields: _a0, name, locale, siteURL
func (_m *ServiceInterface) SendLicenseInactivityEmail(_a0 string, name string, locale string, siteURL string) error {
ret := _m.Called(_a0, name, locale, siteURL)