Add shared channels related configuration under a E20 license check (#16415)
* Add shared channels related configuration under a E20 license check * Apply PR suggestions; Default config value for shared channels Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
@@ -60,7 +60,6 @@ func GenerateClientConfig(c *model.Config, telemetryID string, license *model.Li
|
|||||||
} else {
|
} else {
|
||||||
props["ExperimentalChannelOrganization"] = strconv.FormatBool(false)
|
props["ExperimentalChannelOrganization"] = strconv.FormatBool(false)
|
||||||
}
|
}
|
||||||
props["ExperimentalSharedChannels"] = strconv.FormatBool(*c.ExperimentalSettings.EnableSharedChannels)
|
|
||||||
|
|
||||||
props["ExperimentalChannelSidebarOrganization"] = *c.ServiceSettings.ExperimentalChannelSidebarOrganization
|
props["ExperimentalChannelSidebarOrganization"] = *c.ServiceSettings.ExperimentalChannelSidebarOrganization
|
||||||
props["ExperimentalEnableAutomaticReplies"] = strconv.FormatBool(*c.TeamSettings.ExperimentalEnableAutomaticReplies)
|
props["ExperimentalEnableAutomaticReplies"] = strconv.FormatBool(*c.TeamSettings.ExperimentalEnableAutomaticReplies)
|
||||||
@@ -135,6 +134,7 @@ func GenerateClientConfig(c *model.Config, telemetryID string, license *model.Li
|
|||||||
|
|
||||||
props["CustomUrlSchemes"] = strings.Join(c.DisplaySettings.CustomUrlSchemes, ",")
|
props["CustomUrlSchemes"] = strings.Join(c.DisplaySettings.CustomUrlSchemes, ",")
|
||||||
props["IsDefaultMarketplace"] = strconv.FormatBool(*c.PluginSettings.MarketplaceUrl == model.PLUGIN_SETTINGS_DEFAULT_MARKETPLACE_URL)
|
props["IsDefaultMarketplace"] = strconv.FormatBool(*c.PluginSettings.MarketplaceUrl == model.PLUGIN_SETTINGS_DEFAULT_MARKETPLACE_URL)
|
||||||
|
props["ExperimentalSharedChannels"] = "false"
|
||||||
|
|
||||||
if license != nil {
|
if license != nil {
|
||||||
props["ExperimentalHideTownSquareinLHS"] = strconv.FormatBool(*c.TeamSettings.ExperimentalHideTownSquareinLHS)
|
props["ExperimentalHideTownSquareinLHS"] = strconv.FormatBool(*c.TeamSettings.ExperimentalHideTownSquareinLHS)
|
||||||
@@ -199,6 +199,10 @@ func GenerateClientConfig(c *model.Config, telemetryID string, license *model.Li
|
|||||||
if *license.Features.Cloud {
|
if *license.Features.Cloud {
|
||||||
props["CWSUrl"] = *c.CloudSettings.CWSUrl
|
props["CWSUrl"] = *c.CloudSettings.CWSUrl
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if *license.Features.SharedChannels {
|
||||||
|
props["ExperimentalSharedChannels"] = strconv.FormatBool(*c.ExperimentalSettings.EnableSharedChannels)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return props
|
return props
|
||||||
|
|||||||
@@ -84,6 +84,8 @@ type Features struct {
|
|||||||
EnterprisePlugins *bool `json:"enterprise_plugins"`
|
EnterprisePlugins *bool `json:"enterprise_plugins"`
|
||||||
AdvancedLogging *bool `json:"advanced_logging"`
|
AdvancedLogging *bool `json:"advanced_logging"`
|
||||||
Cloud *bool `json:"cloud"`
|
Cloud *bool `json:"cloud"`
|
||||||
|
SharedChannels *bool `json:"shared_channels"`
|
||||||
|
RemoteClusterService *bool `json:"remote_cluster_service"`
|
||||||
|
|
||||||
// after we enabled more features we'll need to control them with this
|
// after we enabled more features we'll need to control them with this
|
||||||
FutureFeatures *bool `json:"future_features"`
|
FutureFeatures *bool `json:"future_features"`
|
||||||
@@ -114,6 +116,8 @@ func (f *Features) ToMap() map[string]interface{} {
|
|||||||
"enterprise_plugins": *f.EnterprisePlugins,
|
"enterprise_plugins": *f.EnterprisePlugins,
|
||||||
"advanced_logging": *f.AdvancedLogging,
|
"advanced_logging": *f.AdvancedLogging,
|
||||||
"cloud": *f.Cloud,
|
"cloud": *f.Cloud,
|
||||||
|
"shared_channels": *f.SharedChannels,
|
||||||
|
"remote_cluster_service": *f.RemoteClusterService,
|
||||||
"future": *f.FutureFeatures,
|
"future": *f.FutureFeatures,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -230,6 +234,14 @@ func (f *Features) SetDefaults() {
|
|||||||
if f.Cloud == nil {
|
if f.Cloud == nil {
|
||||||
f.Cloud = NewBool(false)
|
f.Cloud = NewBool(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if f.SharedChannels == nil {
|
||||||
|
f.SharedChannels = NewBool(false)
|
||||||
|
}
|
||||||
|
|
||||||
|
if f.RemoteClusterService == nil {
|
||||||
|
f.RemoteClusterService = f.SharedChannels
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (l *License) IsExpired() bool {
|
func (l *License) IsExpired() bool {
|
||||||
|
|||||||
@@ -33,6 +33,8 @@ func TestLicenseFeaturesToMap(t *testing.T) {
|
|||||||
CheckTrue(t, m["custom_permissions_schemes"].(bool))
|
CheckTrue(t, m["custom_permissions_schemes"].(bool))
|
||||||
CheckTrue(t, m["id_loaded"].(bool))
|
CheckTrue(t, m["id_loaded"].(bool))
|
||||||
CheckTrue(t, m["future"].(bool))
|
CheckTrue(t, m["future"].(bool))
|
||||||
|
CheckFalse(t, m["shared_channels"].(bool))
|
||||||
|
CheckFalse(t, m["remote_cluster_service"].(bool))
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestLicenseFeaturesSetDefaults(t *testing.T) {
|
func TestLicenseFeaturesSetDefaults(t *testing.T) {
|
||||||
@@ -57,6 +59,8 @@ func TestLicenseFeaturesSetDefaults(t *testing.T) {
|
|||||||
CheckTrue(t, *f.CustomPermissionsSchemes)
|
CheckTrue(t, *f.CustomPermissionsSchemes)
|
||||||
CheckTrue(t, *f.GuestAccountsPermissions)
|
CheckTrue(t, *f.GuestAccountsPermissions)
|
||||||
CheckTrue(t, *f.IDLoadedPushNotifications)
|
CheckTrue(t, *f.IDLoadedPushNotifications)
|
||||||
|
CheckFalse(t, *f.SharedChannels)
|
||||||
|
CheckFalse(t, *f.RemoteClusterService)
|
||||||
CheckTrue(t, *f.FutureFeatures)
|
CheckTrue(t, *f.FutureFeatures)
|
||||||
|
|
||||||
f = Features{}
|
f = Features{}
|
||||||
@@ -82,6 +86,7 @@ func TestLicenseFeaturesSetDefaults(t *testing.T) {
|
|||||||
*f.GuestAccountsPermissions = true
|
*f.GuestAccountsPermissions = true
|
||||||
*f.EmailNotificationContents = true
|
*f.EmailNotificationContents = true
|
||||||
*f.IDLoadedPushNotifications = true
|
*f.IDLoadedPushNotifications = true
|
||||||
|
*f.SharedChannels = true
|
||||||
|
|
||||||
f.SetDefaults()
|
f.SetDefaults()
|
||||||
|
|
||||||
@@ -104,6 +109,8 @@ func TestLicenseFeaturesSetDefaults(t *testing.T) {
|
|||||||
CheckTrue(t, *f.GuestAccounts)
|
CheckTrue(t, *f.GuestAccounts)
|
||||||
CheckTrue(t, *f.GuestAccountsPermissions)
|
CheckTrue(t, *f.GuestAccountsPermissions)
|
||||||
CheckTrue(t, *f.IDLoadedPushNotifications)
|
CheckTrue(t, *f.IDLoadedPushNotifications)
|
||||||
|
CheckTrue(t, *f.SharedChannels)
|
||||||
|
CheckTrue(t, *f.RemoteClusterService)
|
||||||
CheckFalse(t, *f.FutureFeatures)
|
CheckFalse(t, *f.FutureFeatures)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -188,6 +195,8 @@ func TestLicenseToFromJson(t *testing.T) {
|
|||||||
CheckBool(t, *f1.GuestAccounts, *f.GuestAccounts)
|
CheckBool(t, *f1.GuestAccounts, *f.GuestAccounts)
|
||||||
CheckBool(t, *f1.GuestAccountsPermissions, *f.GuestAccountsPermissions)
|
CheckBool(t, *f1.GuestAccountsPermissions, *f.GuestAccountsPermissions)
|
||||||
CheckBool(t, *f1.IDLoadedPushNotifications, *f.IDLoadedPushNotifications)
|
CheckBool(t, *f1.IDLoadedPushNotifications, *f.IDLoadedPushNotifications)
|
||||||
|
CheckBool(t, *f1.SharedChannels, *f.SharedChannels)
|
||||||
|
CheckBool(t, *f1.RemoteClusterService, *f.RemoteClusterService)
|
||||||
CheckBool(t, *f1.FutureFeatures, *f.FutureFeatures)
|
CheckBool(t, *f1.FutureFeatures, *f.FutureFeatures)
|
||||||
|
|
||||||
invalid := `{"asdf`
|
invalid := `{"asdf`
|
||||||
|
|||||||
@@ -160,6 +160,8 @@ func GetClientLicense(l *model.License) map[string]string {
|
|||||||
props["CustomTermsOfService"] = strconv.FormatBool(*l.Features.CustomTermsOfService)
|
props["CustomTermsOfService"] = strconv.FormatBool(*l.Features.CustomTermsOfService)
|
||||||
props["LockTeammateNameDisplay"] = strconv.FormatBool(*l.Features.LockTeammateNameDisplay)
|
props["LockTeammateNameDisplay"] = strconv.FormatBool(*l.Features.LockTeammateNameDisplay)
|
||||||
props["Cloud"] = strconv.FormatBool(*l.Features.Cloud)
|
props["Cloud"] = strconv.FormatBool(*l.Features.Cloud)
|
||||||
|
props["SharedChannels"] = strconv.FormatBool(*l.Features.SharedChannels)
|
||||||
|
props["RemoteClusterService"] = strconv.FormatBool(*l.Features.RemoteClusterService)
|
||||||
}
|
}
|
||||||
|
|
||||||
return props
|
return props
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user