Adds ConnectedWorkspacesSettings configuration block (#27820)
* Adds ServerFederationSettings configuration block The Server Federation related configuration properties were located in the `ExperimentalSettings` config block. Now that the feature is going to get out of beta, and foreseeing more configuration properties being added to it, we're moving them to a block of its own. If the properties were set in the old location, their values should be carried over to the new ones. The old properties are left in place and marked as deprecated not to cause issues with the model. * Update System Console to include Server Federation section * Remove system console section * Move the configuration properties to ConnectedWorkspaces * Add ConnectedWorkspacesSettings to the telemetry --------- Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
0c585bdac6
Коммит
d5e9aa9fb3
@@ -212,7 +212,7 @@ func setupTestHelper(dbStore store.Store, searchEngine *searchengine.Broker, ent
|
|||||||
}
|
}
|
||||||
|
|
||||||
func getLicense(enterprise bool, cfg *model.Config) *model.License {
|
func getLicense(enterprise bool, cfg *model.Config) *model.License {
|
||||||
if *cfg.ExperimentalSettings.EnableRemoteClusterService || *cfg.ExperimentalSettings.EnableSharedChannels {
|
if *cfg.ConnectedWorkspacesSettings.EnableRemoteClusterService || *cfg.ConnectedWorkspacesSettings.EnableSharedChannels {
|
||||||
return model.NewTestLicenseSKU(model.LicenseShortSkuProfessional)
|
return model.NewTestLicenseSKU(model.LicenseShortSkuProfessional)
|
||||||
}
|
}
|
||||||
if enterprise {
|
if enterprise {
|
||||||
|
|||||||
@@ -24,8 +24,8 @@ var (
|
|||||||
|
|
||||||
func setupForSharedChannels(tb testing.TB) *TestHelper {
|
func setupForSharedChannels(tb testing.TB) *TestHelper {
|
||||||
th := SetupConfig(tb, func(cfg *model.Config) {
|
th := SetupConfig(tb, func(cfg *model.Config) {
|
||||||
*cfg.ExperimentalSettings.EnableRemoteClusterService = true
|
*cfg.ConnectedWorkspacesSettings.EnableRemoteClusterService = true
|
||||||
*cfg.ExperimentalSettings.EnableSharedChannels = true
|
*cfg.ConnectedWorkspacesSettings.EnableSharedChannels = true
|
||||||
})
|
})
|
||||||
|
|
||||||
th.App.UpdateConfig(func(cfg *model.Config) {
|
th.App.UpdateConfig(func(cfg *model.Config) {
|
||||||
|
|||||||
@@ -145,7 +145,7 @@ func setupTestHelper(dbStore store.Store, enterprise bool, includeCacheLayer boo
|
|||||||
}
|
}
|
||||||
|
|
||||||
func getLicense(enterprise bool, cfg *model.Config) *model.License {
|
func getLicense(enterprise bool, cfg *model.Config) *model.License {
|
||||||
if *cfg.ExperimentalSettings.EnableRemoteClusterService || *cfg.ExperimentalSettings.EnableSharedChannels {
|
if *cfg.ConnectedWorkspacesSettings.EnableRemoteClusterService || *cfg.ConnectedWorkspacesSettings.EnableSharedChannels {
|
||||||
return model.NewTestLicenseSKU(model.LicenseShortSkuProfessional)
|
return model.NewTestLicenseSKU(model.LicenseShortSkuProfessional)
|
||||||
}
|
}
|
||||||
if enterprise {
|
if enterprise {
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import (
|
|||||||
|
|
||||||
func setupRemoteCluster(tb testing.TB) *TestHelper {
|
func setupRemoteCluster(tb testing.TB) *TestHelper {
|
||||||
return SetupConfig(tb, func(cfg *model.Config) {
|
return SetupConfig(tb, func(cfg *model.Config) {
|
||||||
*cfg.ExperimentalSettings.EnableRemoteClusterService = true
|
*cfg.ConnectedWorkspacesSettings.EnableRemoteClusterService = true
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -589,7 +589,7 @@ func (s *Server) startInterClusterServices(license *model.License) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Config check
|
// Config check
|
||||||
if !*s.platform.Config().ExperimentalSettings.EnableRemoteClusterService && !*s.platform.Config().ExperimentalSettings.EnableSharedChannels {
|
if !*s.platform.Config().ConnectedWorkspacesSettings.EnableRemoteClusterService && !*s.platform.Config().ConnectedWorkspacesSettings.EnableSharedChannels {
|
||||||
mlog.Debug("Remote Cluster Service disabled via config")
|
mlog.Debug("Remote Cluster Service disabled via config")
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@@ -618,7 +618,7 @@ func (s *Server) startInterClusterServices(license *model.License) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Config check
|
// Config check
|
||||||
if !*s.platform.Config().ExperimentalSettings.EnableSharedChannels {
|
if !*s.platform.Config().ConnectedWorkspacesSettings.EnableSharedChannels {
|
||||||
mlog.Debug("Shared Channels Service disabled via config")
|
mlog.Debug("Shared Channels Service disabled via config")
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,8 +14,8 @@ import (
|
|||||||
|
|
||||||
func setupSharedChannels(tb testing.TB) *TestHelper {
|
func setupSharedChannels(tb testing.TB) *TestHelper {
|
||||||
return SetupConfig(tb, func(cfg *model.Config) {
|
return SetupConfig(tb, func(cfg *model.Config) {
|
||||||
*cfg.ExperimentalSettings.EnableRemoteClusterService = true
|
*cfg.ConnectedWorkspacesSettings.EnableRemoteClusterService = true
|
||||||
*cfg.ExperimentalSettings.EnableSharedChannels = true
|
*cfg.ConnectedWorkspacesSettings.EnableSharedChannels = true
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -20,8 +20,8 @@ import (
|
|||||||
|
|
||||||
func setupForSharedChannels(tb testing.TB) *TestHelper {
|
func setupForSharedChannels(tb testing.TB) *TestHelper {
|
||||||
return setupConfig(tb, func(cfg *model.Config) {
|
return setupConfig(tb, func(cfg *model.Config) {
|
||||||
*cfg.ExperimentalSettings.EnableRemoteClusterService = true
|
*cfg.ConnectedWorkspacesSettings.EnableRemoteClusterService = true
|
||||||
*cfg.ExperimentalSettings.EnableSharedChannels = true
|
*cfg.ConnectedWorkspacesSettings.EnableSharedChannels = true
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ func setupTestHelper(dbStore store.Store, enterprise bool, includeCacheLayer boo
|
|||||||
}
|
}
|
||||||
|
|
||||||
func getLicense(enterprise bool, cfg *model.Config) *model.License {
|
func getLicense(enterprise bool, cfg *model.Config) *model.License {
|
||||||
if *cfg.ExperimentalSettings.EnableRemoteClusterService || *cfg.ExperimentalSettings.EnableSharedChannels {
|
if *cfg.ConnectedWorkspacesSettings.EnableRemoteClusterService || *cfg.ConnectedWorkspacesSettings.EnableSharedChannels {
|
||||||
return model.NewTestLicenseSKU(model.LicenseShortSkuProfessional)
|
return model.NewTestLicenseSKU(model.LicenseShortSkuProfessional)
|
||||||
}
|
}
|
||||||
if enterprise {
|
if enterprise {
|
||||||
|
|||||||
@@ -215,8 +215,8 @@ func GenerateClientConfig(c *model.Config, telemetryID string, license *model.Li
|
|||||||
}
|
}
|
||||||
|
|
||||||
if license.HasSharedChannels() {
|
if license.HasSharedChannels() {
|
||||||
props["ExperimentalSharedChannels"] = strconv.FormatBool(*c.ExperimentalSettings.EnableSharedChannels)
|
props["ExperimentalSharedChannels"] = strconv.FormatBool(*c.ConnectedWorkspacesSettings.EnableSharedChannels)
|
||||||
props["ExperimentalRemoteClusterService"] = strconv.FormatBool(c.FeatureFlags.EnableRemoteClusterService && *c.ExperimentalSettings.EnableRemoteClusterService)
|
props["ExperimentalRemoteClusterService"] = strconv.FormatBool(c.FeatureFlags.EnableRemoteClusterService && *c.ConnectedWorkspacesSettings.EnableRemoteClusterService)
|
||||||
}
|
}
|
||||||
|
|
||||||
if license.SkuShortName == model.LicenseShortSkuProfessional || license.SkuShortName == model.LicenseShortSkuEnterprise {
|
if license.SkuShortName == model.LicenseShortSkuProfessional || license.SkuShortName == model.LicenseShortSkuEnterprise {
|
||||||
|
|||||||
@@ -189,7 +189,7 @@ func TestGetClientConfig(t *testing.T) {
|
|||||||
{
|
{
|
||||||
"Shared channels other license",
|
"Shared channels other license",
|
||||||
&model.Config{
|
&model.Config{
|
||||||
ExperimentalSettings: model.ExperimentalSettings{
|
ConnectedWorkspacesSettings: model.ConnectedWorkspacesSettings{
|
||||||
EnableSharedChannels: model.NewPointer(true),
|
EnableSharedChannels: model.NewPointer(true),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -207,7 +207,7 @@ func TestGetClientConfig(t *testing.T) {
|
|||||||
{
|
{
|
||||||
"licensed for shared channels",
|
"licensed for shared channels",
|
||||||
&model.Config{
|
&model.Config{
|
||||||
ExperimentalSettings: model.ExperimentalSettings{
|
ConnectedWorkspacesSettings: model.ConnectedWorkspacesSettings{
|
||||||
EnableSharedChannels: model.NewPointer(true),
|
EnableSharedChannels: model.NewPointer(true),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -225,7 +225,7 @@ func TestGetClientConfig(t *testing.T) {
|
|||||||
{
|
{
|
||||||
"Shared channels professional license",
|
"Shared channels professional license",
|
||||||
&model.Config{
|
&model.Config{
|
||||||
ExperimentalSettings: model.ExperimentalSettings{
|
ConnectedWorkspacesSettings: model.ConnectedWorkspacesSettings{
|
||||||
EnableSharedChannels: model.NewPointer(true),
|
EnableSharedChannels: model.NewPointer(true),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -256,7 +256,7 @@ func TestGetClientConfig(t *testing.T) {
|
|||||||
{
|
{
|
||||||
"Shared channels enterprise license",
|
"Shared channels enterprise license",
|
||||||
&model.Config{
|
&model.Config{
|
||||||
ExperimentalSettings: model.ExperimentalSettings{
|
ConnectedWorkspacesSettings: model.ConnectedWorkspacesSettings{
|
||||||
EnableSharedChannels: model.NewPointer(true),
|
EnableSharedChannels: model.NewPointer(true),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -42,49 +42,50 @@ const (
|
|||||||
|
|
||||||
EnvVarInstallType = "MM_INSTALL_TYPE"
|
EnvVarInstallType = "MM_INSTALL_TYPE"
|
||||||
|
|
||||||
TrackConfigService = "config_service"
|
TrackConfigService = "config_service"
|
||||||
TrackConfigTeam = "config_team"
|
TrackConfigTeam = "config_team"
|
||||||
TrackConfigClientReq = "config_client_requirements"
|
TrackConfigClientReq = "config_client_requirements"
|
||||||
TrackConfigSQL = "config_sql"
|
TrackConfigSQL = "config_sql"
|
||||||
TrackConfigLog = "config_log"
|
TrackConfigLog = "config_log"
|
||||||
TrackConfigAudit = "config_audit"
|
TrackConfigAudit = "config_audit"
|
||||||
TrackConfigNotificationLog = "config_notifications_log"
|
TrackConfigNotificationLog = "config_notifications_log"
|
||||||
TrackConfigFile = "config_file"
|
TrackConfigFile = "config_file"
|
||||||
TrackConfigRate = "config_rate"
|
TrackConfigRate = "config_rate"
|
||||||
TrackConfigEmail = "config_email"
|
TrackConfigEmail = "config_email"
|
||||||
TrackConfigPrivacy = "config_privacy"
|
TrackConfigPrivacy = "config_privacy"
|
||||||
TrackConfigTheme = "config_theme"
|
TrackConfigTheme = "config_theme"
|
||||||
TrackConfigOAuth = "config_oauth"
|
TrackConfigOAuth = "config_oauth"
|
||||||
TrackConfigLDAP = "config_ldap"
|
TrackConfigLDAP = "config_ldap"
|
||||||
TrackConfigCompliance = "config_compliance"
|
TrackConfigCompliance = "config_compliance"
|
||||||
TrackConfigLocalization = "config_localization"
|
TrackConfigLocalization = "config_localization"
|
||||||
TrackConfigSAML = "config_saml"
|
TrackConfigSAML = "config_saml"
|
||||||
TrackConfigPassword = "config_password"
|
TrackConfigPassword = "config_password"
|
||||||
TrackConfigCluster = "config_cluster"
|
TrackConfigCluster = "config_cluster"
|
||||||
TrackConfigMetrics = "config_metrics"
|
TrackConfigMetrics = "config_metrics"
|
||||||
TrackConfigSupport = "config_support"
|
TrackConfigSupport = "config_support"
|
||||||
TrackConfigNativeApp = "config_nativeapp"
|
TrackConfigNativeApp = "config_nativeapp"
|
||||||
TrackConfigExperimental = "config_experimental"
|
TrackConfigExperimental = "config_experimental"
|
||||||
TrackConfigAnalytics = "config_analytics"
|
TrackConfigAnalytics = "config_analytics"
|
||||||
TrackConfigAnnouncement = "config_announcement"
|
TrackConfigAnnouncement = "config_announcement"
|
||||||
TrackConfigElasticsearch = "config_elasticsearch"
|
TrackConfigElasticsearch = "config_elasticsearch"
|
||||||
TrackConfigPlugin = "config_plugin"
|
TrackConfigPlugin = "config_plugin"
|
||||||
TrackConfigDataRetention = "config_data_retention"
|
TrackConfigDataRetention = "config_data_retention"
|
||||||
TrackConfigMessageExport = "config_message_export"
|
TrackConfigMessageExport = "config_message_export"
|
||||||
TrackConfigDisplay = "config_display"
|
TrackConfigDisplay = "config_display"
|
||||||
TrackConfigGuestAccounts = "config_guest_accounts"
|
TrackConfigGuestAccounts = "config_guest_accounts"
|
||||||
TrackConfigImageProxy = "config_image_proxy"
|
TrackConfigImageProxy = "config_image_proxy"
|
||||||
TrackConfigBleve = "config_bleve"
|
TrackConfigBleve = "config_bleve"
|
||||||
TrackConfigExport = "config_export"
|
TrackConfigExport = "config_export"
|
||||||
TrackConfigWrangler = "config_wrangler"
|
TrackConfigWrangler = "config_wrangler"
|
||||||
TrackFeatureFlags = "config_feature_flags"
|
TrackConfigConnectedWorkspaces = "config_connected_workspaces"
|
||||||
TrackPermissionsGeneral = "permissions_general"
|
TrackFeatureFlags = "config_feature_flags"
|
||||||
TrackPermissionsSystemScheme = "permissions_system_scheme"
|
TrackPermissionsGeneral = "permissions_general"
|
||||||
TrackPermissionsTeamSchemes = "permissions_team_schemes"
|
TrackPermissionsSystemScheme = "permissions_system_scheme"
|
||||||
TrackPermissionsSystemRoles = "permissions_system_roles"
|
TrackPermissionsTeamSchemes = "permissions_team_schemes"
|
||||||
TrackElasticsearch = "elasticsearch"
|
TrackPermissionsSystemRoles = "permissions_system_roles"
|
||||||
TrackGroups = "groups"
|
TrackElasticsearch = "elasticsearch"
|
||||||
TrackChannelModeration = "channel_moderation"
|
TrackGroups = "groups"
|
||||||
|
TrackChannelModeration = "channel_moderation"
|
||||||
|
|
||||||
TrackActivity = "activity"
|
TrackActivity = "activity"
|
||||||
TrackLicense = "license"
|
TrackLicense = "license"
|
||||||
@@ -773,8 +774,6 @@ func (ts *TelemetryService) trackConfig() {
|
|||||||
"isdefault_client_side_cert_check": isDefault(*cfg.ExperimentalSettings.ClientSideCertCheck, model.ClientSideCertCheckPrimaryAuth),
|
"isdefault_client_side_cert_check": isDefault(*cfg.ExperimentalSettings.ClientSideCertCheck, model.ClientSideCertCheckPrimaryAuth),
|
||||||
"link_metadata_timeout_milliseconds": *cfg.ExperimentalSettings.LinkMetadataTimeoutMilliseconds,
|
"link_metadata_timeout_milliseconds": *cfg.ExperimentalSettings.LinkMetadataTimeoutMilliseconds,
|
||||||
"restrict_system_admin": *cfg.ExperimentalSettings.RestrictSystemAdmin,
|
"restrict_system_admin": *cfg.ExperimentalSettings.RestrictSystemAdmin,
|
||||||
"enable_shared_channels": *cfg.ExperimentalSettings.EnableSharedChannels,
|
|
||||||
"enable_remote_cluster_service": *cfg.ExperimentalSettings.EnableRemoteClusterService && cfg.FeatureFlags.EnableRemoteClusterService,
|
|
||||||
"enable_app_bar": !*cfg.ExperimentalSettings.DisableAppBar,
|
"enable_app_bar": !*cfg.ExperimentalSettings.DisableAppBar,
|
||||||
"disable_refetching_on_browser_focus": *cfg.ExperimentalSettings.DisableRefetchingOnBrowserFocus,
|
"disable_refetching_on_browser_focus": *cfg.ExperimentalSettings.DisableRefetchingOnBrowserFocus,
|
||||||
"delay_channel_autocomplete": *cfg.ExperimentalSettings.DelayChannelAutocomplete,
|
"delay_channel_autocomplete": *cfg.ExperimentalSettings.DelayChannelAutocomplete,
|
||||||
@@ -891,6 +890,11 @@ func (ts *TelemetryService) trackConfig() {
|
|||||||
"move_thread_from_group_message_channel_enable": cfg.WranglerSettings.MoveThreadFromGroupMessageChannelEnable,
|
"move_thread_from_group_message_channel_enable": cfg.WranglerSettings.MoveThreadFromGroupMessageChannelEnable,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
ts.SendTelemetry(TrackConfigConnectedWorkspaces, map[string]any{
|
||||||
|
"enable_shared_channels": *cfg.ConnectedWorkspacesSettings.EnableSharedChannels,
|
||||||
|
"enable_remote_cluster_service": *cfg.ConnectedWorkspacesSettings.EnableRemoteClusterService && cfg.FeatureFlags.EnableRemoteClusterService,
|
||||||
|
})
|
||||||
|
|
||||||
// Convert feature flags to map[string]any for sending
|
// Convert feature flags to map[string]any for sending
|
||||||
flags := cfg.FeatureFlags.ToMap()
|
flags := cfg.FeatureFlags.ToMap()
|
||||||
interfaceFlags := make(map[string]any)
|
interfaceFlags := make(map[string]any)
|
||||||
|
|||||||
@@ -1068,8 +1068,8 @@ type ExperimentalSettings struct {
|
|||||||
ClientSideCertCheck *string `access:"experimental_features,cloud_restrictable"`
|
ClientSideCertCheck *string `access:"experimental_features,cloud_restrictable"`
|
||||||
LinkMetadataTimeoutMilliseconds *int64 `access:"experimental_features,write_restrictable,cloud_restrictable"`
|
LinkMetadataTimeoutMilliseconds *int64 `access:"experimental_features,write_restrictable,cloud_restrictable"`
|
||||||
RestrictSystemAdmin *bool `access:"experimental_features,write_restrictable"`
|
RestrictSystemAdmin *bool `access:"experimental_features,write_restrictable"`
|
||||||
EnableSharedChannels *bool `access:"experimental_features"`
|
EnableSharedChannels *bool `access:"experimental_features"` // Deprecated: use `ConnectedWorkspacesSettings.EnableSharedChannels`
|
||||||
EnableRemoteClusterService *bool `access:"experimental_features"`
|
EnableRemoteClusterService *bool `access:"experimental_features"` // Deprecated: use `ConnectedWorkspacesSettings.EnableRemoteClusterService`
|
||||||
DisableAppBar *bool `access:"experimental_features"`
|
DisableAppBar *bool `access:"experimental_features"`
|
||||||
DisableRefetchingOnBrowserFocus *bool `access:"experimental_features"`
|
DisableRefetchingOnBrowserFocus *bool `access:"experimental_features"`
|
||||||
DelayChannelAutocomplete *bool `access:"experimental_features"`
|
DelayChannelAutocomplete *bool `access:"experimental_features"`
|
||||||
@@ -3242,6 +3242,29 @@ func (w *WranglerSettings) IsValid() *AppError {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type ConnectedWorkspacesSettings struct {
|
||||||
|
EnableSharedChannels *bool
|
||||||
|
EnableRemoteClusterService *bool
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *ConnectedWorkspacesSettings) SetDefaults(isUpdate bool, e ExperimentalSettings) {
|
||||||
|
if c.EnableSharedChannels == nil {
|
||||||
|
if isUpdate && e.EnableSharedChannels != nil {
|
||||||
|
c.EnableSharedChannels = e.EnableSharedChannels
|
||||||
|
} else {
|
||||||
|
c.EnableSharedChannels = NewPointer(false)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if c.EnableRemoteClusterService == nil {
|
||||||
|
if isUpdate && e.EnableRemoteClusterService != nil {
|
||||||
|
c.EnableRemoteClusterService = e.EnableRemoteClusterService
|
||||||
|
} else {
|
||||||
|
c.EnableRemoteClusterService = NewPointer(false)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
type GlobalRelayMessageExportSettings struct {
|
type GlobalRelayMessageExportSettings struct {
|
||||||
CustomerType *string `access:"compliance_compliance_export"` // must be either A9, A10 or CUSTOM, dictates SMTP server url
|
CustomerType *string `access:"compliance_compliance_export"` // must be either A9, A10 or CUSTOM, dictates SMTP server url
|
||||||
SMTPUsername *string `access:"compliance_compliance_export"`
|
SMTPUsername *string `access:"compliance_compliance_export"`
|
||||||
@@ -3497,49 +3520,50 @@ const ConfigAccessTagAnySysConsoleRead = "*_read"
|
|||||||
// Product bool `access:write_restrictable`
|
// Product bool `access:write_restrictable`
|
||||||
// }
|
// }
|
||||||
type Config struct {
|
type Config struct {
|
||||||
ServiceSettings ServiceSettings
|
ServiceSettings ServiceSettings
|
||||||
TeamSettings TeamSettings
|
TeamSettings TeamSettings
|
||||||
ClientRequirements ClientRequirements
|
ClientRequirements ClientRequirements
|
||||||
SqlSettings SqlSettings
|
SqlSettings SqlSettings
|
||||||
LogSettings LogSettings
|
LogSettings LogSettings
|
||||||
ExperimentalAuditSettings ExperimentalAuditSettings
|
ExperimentalAuditSettings ExperimentalAuditSettings
|
||||||
NotificationLogSettings NotificationLogSettings
|
NotificationLogSettings NotificationLogSettings
|
||||||
PasswordSettings PasswordSettings
|
PasswordSettings PasswordSettings
|
||||||
FileSettings FileSettings
|
FileSettings FileSettings
|
||||||
EmailSettings EmailSettings
|
EmailSettings EmailSettings
|
||||||
RateLimitSettings RateLimitSettings
|
RateLimitSettings RateLimitSettings
|
||||||
PrivacySettings PrivacySettings
|
PrivacySettings PrivacySettings
|
||||||
SupportSettings SupportSettings
|
SupportSettings SupportSettings
|
||||||
AnnouncementSettings AnnouncementSettings
|
AnnouncementSettings AnnouncementSettings
|
||||||
ThemeSettings ThemeSettings
|
ThemeSettings ThemeSettings
|
||||||
GitLabSettings SSOSettings
|
GitLabSettings SSOSettings
|
||||||
GoogleSettings SSOSettings
|
GoogleSettings SSOSettings
|
||||||
Office365Settings Office365Settings
|
Office365Settings Office365Settings
|
||||||
OpenIdSettings SSOSettings
|
OpenIdSettings SSOSettings
|
||||||
LdapSettings LdapSettings
|
LdapSettings LdapSettings
|
||||||
ComplianceSettings ComplianceSettings
|
ComplianceSettings ComplianceSettings
|
||||||
LocalizationSettings LocalizationSettings
|
LocalizationSettings LocalizationSettings
|
||||||
SamlSettings SamlSettings
|
SamlSettings SamlSettings
|
||||||
NativeAppSettings NativeAppSettings
|
NativeAppSettings NativeAppSettings
|
||||||
CacheSettings CacheSettings
|
CacheSettings CacheSettings
|
||||||
ClusterSettings ClusterSettings
|
ClusterSettings ClusterSettings
|
||||||
MetricsSettings MetricsSettings
|
MetricsSettings MetricsSettings
|
||||||
ExperimentalSettings ExperimentalSettings
|
ExperimentalSettings ExperimentalSettings
|
||||||
AnalyticsSettings AnalyticsSettings
|
AnalyticsSettings AnalyticsSettings
|
||||||
ElasticsearchSettings ElasticsearchSettings
|
ElasticsearchSettings ElasticsearchSettings
|
||||||
BleveSettings BleveSettings
|
BleveSettings BleveSettings
|
||||||
DataRetentionSettings DataRetentionSettings
|
DataRetentionSettings DataRetentionSettings
|
||||||
MessageExportSettings MessageExportSettings
|
MessageExportSettings MessageExportSettings
|
||||||
JobSettings JobSettings
|
JobSettings JobSettings
|
||||||
PluginSettings PluginSettings
|
PluginSettings PluginSettings
|
||||||
DisplaySettings DisplaySettings
|
DisplaySettings DisplaySettings
|
||||||
GuestAccountsSettings GuestAccountsSettings
|
GuestAccountsSettings GuestAccountsSettings
|
||||||
ImageProxySettings ImageProxySettings
|
ImageProxySettings ImageProxySettings
|
||||||
CloudSettings CloudSettings // telemetry: none
|
CloudSettings CloudSettings // telemetry: none
|
||||||
FeatureFlags *FeatureFlags `access:"*_read" json:",omitempty"`
|
FeatureFlags *FeatureFlags `access:"*_read" json:",omitempty"`
|
||||||
ImportSettings ImportSettings // telemetry: none
|
ImportSettings ImportSettings // telemetry: none
|
||||||
ExportSettings ExportSettings
|
ExportSettings ExportSettings
|
||||||
WranglerSettings WranglerSettings
|
WranglerSettings WranglerSettings
|
||||||
|
ConnectedWorkspacesSettings ConnectedWorkspacesSettings
|
||||||
}
|
}
|
||||||
|
|
||||||
func (o *Config) Auditable() map[string]interface{} {
|
func (o *Config) Auditable() map[string]interface{} {
|
||||||
@@ -3656,6 +3680,7 @@ func (o *Config) SetDefaults() {
|
|||||||
o.ImportSettings.SetDefaults()
|
o.ImportSettings.SetDefaults()
|
||||||
o.ExportSettings.SetDefaults()
|
o.ExportSettings.SetDefaults()
|
||||||
o.WranglerSettings.SetDefaults()
|
o.WranglerSettings.SetDefaults()
|
||||||
|
o.ConnectedWorkspacesSettings.SetDefaults(isUpdate, o.ExperimentalSettings)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (o *Config) IsValid() *AppError {
|
func (o *Config) IsValid() *AppError {
|
||||||
|
|||||||
@@ -1761,3 +1761,37 @@ func TestConfigGetFileRetentionHours(t *testing.T) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestConfigDefaultConnectedWorkspacesSettings(t *testing.T) {
|
||||||
|
t.Run("if the config is new, default values should be established", func(t *testing.T) {
|
||||||
|
c := Config{}
|
||||||
|
c.SetDefaults()
|
||||||
|
require.False(t, *c.ConnectedWorkspacesSettings.EnableSharedChannels)
|
||||||
|
require.False(t, *c.ConnectedWorkspacesSettings.EnableRemoteClusterService)
|
||||||
|
})
|
||||||
|
|
||||||
|
t.Run("if the config is being updated and server federation settings had no values, experimental settings values should be migrated", func(t *testing.T) {
|
||||||
|
c := Config{}
|
||||||
|
c.SetDefaults()
|
||||||
|
c.ConnectedWorkspacesSettings = ConnectedWorkspacesSettings{}
|
||||||
|
c.ExperimentalSettings.EnableSharedChannels = NewPointer(true)
|
||||||
|
c.ExperimentalSettings.EnableRemoteClusterService = NewPointer(false)
|
||||||
|
|
||||||
|
c.SetDefaults()
|
||||||
|
require.True(t, *c.ConnectedWorkspacesSettings.EnableSharedChannels)
|
||||||
|
require.False(t, *c.ConnectedWorkspacesSettings.EnableRemoteClusterService)
|
||||||
|
})
|
||||||
|
|
||||||
|
t.Run("if the config is being updated and server federation settings already have values, they should not change", func(t *testing.T) {
|
||||||
|
c := Config{}
|
||||||
|
c.SetDefaults()
|
||||||
|
c.ConnectedWorkspacesSettings.EnableSharedChannels = NewPointer(false)
|
||||||
|
c.ConnectedWorkspacesSettings.EnableRemoteClusterService = NewPointer(true)
|
||||||
|
c.ExperimentalSettings.EnableSharedChannels = NewPointer(true)
|
||||||
|
c.ExperimentalSettings.EnableRemoteClusterService = NewPointer(false)
|
||||||
|
|
||||||
|
c.SetDefaults()
|
||||||
|
require.False(t, *c.ConnectedWorkspacesSettings.EnableSharedChannels)
|
||||||
|
require.True(t, *c.ConnectedWorkspacesSettings.EnableRemoteClusterService)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
@@ -6213,19 +6213,6 @@ const AdminDefinition: AdminDefinitionType = {
|
|||||||
placeholder: defineMessage({id: 'admin.experimental.userStatusAwayTimeout.example', defaultMessage: 'E.g.: "300"'}),
|
placeholder: defineMessage({id: 'admin.experimental.userStatusAwayTimeout.example', defaultMessage: 'E.g.: "300"'}),
|
||||||
isDisabled: it.not(it.userHasWritePermissionOnResource(RESOURCE_KEYS.EXPERIMENTAL.FEATURES)),
|
isDisabled: it.not(it.userHasWritePermissionOnResource(RESOURCE_KEYS.EXPERIMENTAL.FEATURES)),
|
||||||
},
|
},
|
||||||
{
|
|
||||||
type: 'bool',
|
|
||||||
key: 'ExperimentalSettings.EnableSharedChannels',
|
|
||||||
label: defineMessage({id: 'admin.experimental.enableSharedChannels.title', defaultMessage: 'Enable Shared Channels:'}),
|
|
||||||
help_text: defineMessage({id: 'admin.experimental.enableSharedChannels.desc', defaultMessage: 'Toggles Shared Channels'}),
|
|
||||||
help_text_markdown: false,
|
|
||||||
isHidden: it.not(it.any(
|
|
||||||
it.licensedForFeature('SharedChannels'),
|
|
||||||
it.licensedForSku(LicenseSkus.Enterprise),
|
|
||||||
it.licensedForSku(LicenseSkus.Professional),
|
|
||||||
)),
|
|
||||||
isDisabled: it.not(it.userHasWritePermissionOnResource(RESOURCE_KEYS.EXPERIMENTAL.FEATURES)),
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
type: 'bool',
|
type: 'bool',
|
||||||
key: 'ExperimentalSettings.DisableAppBar',
|
key: 'ExperimentalSettings.DisableAppBar',
|
||||||
|
|||||||
@@ -931,8 +931,6 @@
|
|||||||
"admin.experimental.enableChannelViewedMessages.title": "Enable Channel Viewed WebSocket Messages:",
|
"admin.experimental.enableChannelViewedMessages.title": "Enable Channel Viewed WebSocket Messages:",
|
||||||
"admin.experimental.enableOnboardingFlow.desc": "When true, new users are shown steps to complete as part of an onboarding process",
|
"admin.experimental.enableOnboardingFlow.desc": "When true, new users are shown steps to complete as part of an onboarding process",
|
||||||
"admin.experimental.enableOnboardingFlow.title": "Enable Onboarding:",
|
"admin.experimental.enableOnboardingFlow.title": "Enable Onboarding:",
|
||||||
"admin.experimental.enableSharedChannels.desc": "When true, users who have permission to manage shared channels can configure another Mattermost server to synchronize and share a channel. Disabling shared channels stops synchronizing the channel with the other Mattermost server, however the channel continues to function for local users per normal channel behavior.",
|
|
||||||
"admin.experimental.enableSharedChannels.title": "Enable Shared Channels:",
|
|
||||||
"admin.experimental.enableThemeSelection.desc": "Enables the **Display > Theme** tab in Settings so users can select their theme.",
|
"admin.experimental.enableThemeSelection.desc": "Enables the **Display > Theme** tab in Settings so users can select their theme.",
|
||||||
"admin.experimental.enableThemeSelection.title": "Enable Theme Selection:",
|
"admin.experimental.enableThemeSelection.title": "Enable Theme Selection:",
|
||||||
"admin.experimental.enableTutorial.desc": "When true, users are prompted with a tutorial when they open Mattermost for the first time after account creation. When false, the tutorial is disabled, and users are placed in Town Square when they open Mattermost for the first time after account creation.",
|
"admin.experimental.enableTutorial.desc": "When true, users are prompted with a tutorial when they open Mattermost for the first time after account creation. When false, the tutorial is disabled, and users are placed in Town Square when they open Mattermost for the first time after account creation.",
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user