[MM-27535] User invite limits for MM Cloud (#15197)

* Add a config for MM User Limit

* Adding graceful errors for if an administrator invites people passed their user limit

* Including changed vendor files

* Adding unit test

* Fix a bug

* Push up working tests (Thanks Joram)

* Add more cases, clean up logs in code

* One more case

* Refactoring based on PR comments

* Updating i18n

* Some changes based on PR review

* Remove a comment

* Bring back some translations that were somehow removed

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
This commit is contained in:
nickmisasi
2020-08-19 16:01:07 -04:00
committed by GitHub
parent 4e154756bd
commit 769f39eee5
20 changed files with 452 additions and 156 deletions

View File

@@ -52,6 +52,7 @@ func GenerateClientConfig(c *model.Config, diagnosticID string, license *model.L
props["ExperimentalEnablePostMetadata"] = "true"
props["ExperimentalEnableClickToReply"] = strconv.FormatBool(*c.ExperimentalSettings.EnableClickToReply)
props["ExperimentalCloudUserLimit"] = strconv.FormatInt(*c.ExperimentalSettings.CloudUserLimit, 8)
if *c.ServiceSettings.ExperimentalChannelOrganization || *c.ServiceSettings.ExperimentalGroupUnreadChannels != model.GROUP_UNREAD_CHANNELS_DISABLED {
props["ExperimentalChannelOrganization"] = strconv.FormatBool(true)
} else {
@@ -96,6 +97,8 @@ func GenerateClientConfig(c *model.Config, diagnosticID string, license *model.L
props["EnableEmailInvitations"] = strconv.FormatBool(*c.ServiceSettings.EnableEmailInvitations)
props["CloudUserLimit"] = strconv.FormatInt(*c.ExperimentalSettings.CloudUserLimit, 10)
// Set default values for all options that require a license.
props["ExperimentalHideTownSquareinLHS"] = "false"
props["ExperimentalTownSquareIsReadOnly"] = "false"