From da124f018dbb10a41f4d4b5ecb4818baf628e940 Mon Sep 17 00:00:00 2001 From: Chris Duarte Date: Mon, 23 Jul 2018 08:18:24 -0700 Subject: 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 --- app/diagnostics.go | 1 + config/default.json | 1 + model/config.go | 6 ++++++ utils/config.go | 7 +++++++ 4 files changed, 15 insertions(+) diff --git a/app/diagnostics.go b/app/diagnostics.go index 1aae97f0f..95113ec68 100644 --- a/app/diagnostics.go +++ b/app/diagnostics.go @@ -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{}{ diff --git a/config/default.json b/config/default.json index cd85eda50..add9a71d6 100644 --- a/config/default.json +++ b/config/default.json @@ -63,6 +63,7 @@ "EnableTutorial": true, "ExperimentalEnableDefaultChannelLeaveJoinMessages": true, "ExperimentalGroupUnreadChannels": "disabled", + "ExperimentalChannelOrganization": false, "ImageProxyType": "", "ImageProxyOptions": "", "ImageProxyURL": "", diff --git a/model/config.go b/model/config.go index f24abfe83..f36b321ec 100644 --- a/model/config.go +++ b/model/config.go @@ -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("") } diff --git a/utils/config.go b/utils/config.go index f8cc6ec75..0a20c1723 100644 --- a/utils/config.go +++ b/utils/config.go @@ -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) -- cgit v1.2.3-1-g7c22