MM-53703 Add display-name for experimental default channel (#26191)

* [MM-53703] add displayname for experimental default channel (#24644)

* [MM-53703] add unit test for default experimental channel (#24644)

* Update server/channels/app/teams/teams_test.go

---------

Co-authored-by: Sazzad Hossain <sazzad.hossain@marginedge.com>
Co-authored-by: Mattermost Build <build@mattermost.com>
Co-authored-by: Harrison Healey <harrisonmhealey@gmail.com>
Этот коммит содержится в:
sazzad hossain
2024-03-14 02:52:15 +06:00
коммит произвёл GitHub
родитель ac3eb04dcc
Коммит 1bd9407e78
2 изменённых файлов: 49 добавлений и 1 удалений

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

@@ -50,7 +50,14 @@ func (ts *TeamService) createDefaultChannels(rctx request.CTX, teamID string) ([
channels := []*model.Channel{}
defaultChannelNames := ts.DefaultChannelNames()
for _, name := range defaultChannelNames {
displayName := i18n.TDefault(displayNames[name], name)
var displayName string
if displayNameValue, ok := displayNames[name]; ok {
displayName = i18n.TDefault(displayNameValue, name)
} else {
// If the default channel is experimental (from config.json)
// we don't have to translate
displayName = name
}
channel := &model.Channel{DisplayName: displayName, Name: name, Type: model.ChannelTypeOpen, TeamId: teamID}
// We should use the channel service here (coming soon). Ideally, we should just emit an event
// and let the subscribers do the job, in this case it would be the channels service.