Add ExperimentalSidebarPreference in the config (#9013)

* Add ExperimentalSidebarPreference in the config

* Override Sidebar preference based on GroupUnread settings

* Rename to ExperimentalChannelOrganization

* Add Sidebar config in diagnostics

* Fix diagnostics for experimental_channel_organization
This commit is contained in:
Chris Duarte
2018-07-23 08:18:24 -07:00
committed by Harrison Healey
parent e475cecf00
commit da124f018d
4 changed files with 15 additions and 0 deletions

View File

@@ -252,6 +252,7 @@ func (a *App) trackConfig() {
"experimental_enable_hardened_mode": *cfg.ServiceSettings.ExperimentalEnableHardenedMode,
"experimental_limit_client_config": *cfg.ServiceSettings.ExperimentalLimitClientConfig,
"enable_email_invitations": *cfg.ServiceSettings.EnableEmailInvitations,
"experimental_channel_organization": *cfg.ServiceSettings.ExperimentalChannelOrganization,
})
a.SendDiagnostic(TRACK_CONFIG_TEAM, map[string]interface{}{

View File

@@ -63,6 +63,7 @@
"EnableTutorial": true,
"ExperimentalEnableDefaultChannelLeaveJoinMessages": true,
"ExperimentalGroupUnreadChannels": "disabled",
"ExperimentalChannelOrganization": false,
"ImageProxyType": "",
"ImageProxyOptions": "",
"ImageProxyURL": "",

View File

@@ -233,6 +233,7 @@ type ServiceSettings struct {
EnableTutorial *bool
ExperimentalEnableDefaultChannelLeaveJoinMessages *bool
ExperimentalGroupUnreadChannels *string
ExperimentalChannelOrganization *bool
ImageProxyType *string
ImageProxyURL *string
ImageProxyOptions *string
@@ -478,6 +479,11 @@ func (s *ServiceSettings) SetDefaults() {
s.ExperimentalGroupUnreadChannels = NewString(GROUP_UNREAD_CHANNELS_DEFAULT_ON)
}
if s.ExperimentalChannelOrganization == nil {
experimentalUnreadEnabled := *s.ExperimentalGroupUnreadChannels != GROUP_UNREAD_CHANNELS_DISABLED
s.ExperimentalChannelOrganization = NewBool(experimentalUnreadEnabled)
}
if s.ImageProxyType == nil {
s.ImageProxyType = NewString("")
}

View File

@@ -533,6 +533,13 @@ func GenerateClientConfig(c *model.Config, diagnosticId string, license *model.L
props["EnableTutorial"] = strconv.FormatBool(*c.ServiceSettings.EnableTutorial)
props["ExperimentalEnableDefaultChannelLeaveJoinMessages"] = strconv.FormatBool(*c.ServiceSettings.ExperimentalEnableDefaultChannelLeaveJoinMessages)
props["ExperimentalGroupUnreadChannels"] = *c.ServiceSettings.ExperimentalGroupUnreadChannels
if *c.ServiceSettings.ExperimentalChannelOrganization || *c.ServiceSettings.ExperimentalGroupUnreadChannels != model.GROUP_UNREAD_CHANNELS_DISABLED {
props["ExperimentalChannelOrganization"] = strconv.FormatBool(true)
} else {
props["ExperimentalChannelOrganization"] = strconv.FormatBool(false)
}
props["ExperimentalEnableAutomaticReplies"] = strconv.FormatBool(*c.TeamSettings.ExperimentalEnableAutomaticReplies)
props["ExperimentalTimezone"] = strconv.FormatBool(*c.DisplaySettings.ExperimentalTimezone)