Feature: Wrangler (#23602)
* Migrate feature/wrangler to mono-repo * Add wrangler files * Fix linters, types, etc * Fix snapshots * Fix playwright * Fix pipelines * Fix more pipeline * Fixes for pipelines * More changes for pipeline * Fix types * Add support for a feature flag, but leave it defaulted on for spinwick usage for now * Update snapshot * fix js error when removing last value of multiselect, support CSV marshaling to string array for textsetting * Fix linter * Remove TODO * Remove another TODO * fix tests * Fix i18n * Add server tests * Fix linter * Fix linter * Use proper icon for dot menu * Update snapshot * Add Cypress UI tests for various entrypoints to move thread modal, split SCSS out from forward post into its own thing * clean up * fix linter * More cleanup * Revert files to master * Fix linter for e2e tests * Make ForwardPostChannelSelect channel types configurable with a prop * Add missing return * Fixes from PR feedback * First batch of PR Feedback * Another batch of PR changes * Fix linter * Update snapshots * Wrangler system messages are translated to each user's locale * Initially translate Wrangler into system locale rather than initiating user * More fixes for PR Feedback * Fix some server tests * More updates with master. Fixes around pipelines. Enforce Enterprise license on front/back end * Add tests for dot_menu * More pipeline fixes * Fix e2etests prettier * Update cypress tests, change occurrences of 'Wrangler' with 'Move Thread' * Fix linter * Remove enterprise lock * A couple more occurrences of wrangler strings, and one more enterprise lock * Fix server tests * Fix i18n * Fix e2e linter * Feature flag shouldn't be on by default * Enable move threads feature in smoke tests (#25657) * enable move threads feature * add @prod tag * Fix move_thread_from_public_channel e2e test * Fix e2e style --------- Co-authored-by: Mattermost Build <build@mattermost.com> Co-authored-by: yasserfaraazkhan <attitude3cena.yf@gmail.com>
Этот коммит содержится в:
@@ -3108,6 +3108,51 @@ func (s *PluginSettings) SetDefaults(ls LogSettings) {
|
||||
}
|
||||
}
|
||||
|
||||
type WranglerSettings struct {
|
||||
PermittedWranglerRoles []string
|
||||
AllowedEmailDomain []string
|
||||
MoveThreadMaxCount *int64
|
||||
MoveThreadToAnotherTeamEnable *bool
|
||||
MoveThreadFromPrivateChannelEnable *bool
|
||||
MoveThreadFromDirectMessageChannelEnable *bool
|
||||
MoveThreadFromGroupMessageChannelEnable *bool
|
||||
}
|
||||
|
||||
func (w *WranglerSettings) SetDefaults() {
|
||||
if w.PermittedWranglerRoles == nil {
|
||||
w.PermittedWranglerRoles = make([]string, 0)
|
||||
}
|
||||
if w.AllowedEmailDomain == nil {
|
||||
w.AllowedEmailDomain = make([]string, 0)
|
||||
}
|
||||
if w.MoveThreadMaxCount == nil {
|
||||
w.MoveThreadMaxCount = NewInt64(100)
|
||||
}
|
||||
if w.MoveThreadToAnotherTeamEnable == nil {
|
||||
w.MoveThreadToAnotherTeamEnable = NewBool(false)
|
||||
}
|
||||
if w.MoveThreadFromPrivateChannelEnable == nil {
|
||||
w.MoveThreadFromPrivateChannelEnable = NewBool(false)
|
||||
}
|
||||
if w.MoveThreadFromDirectMessageChannelEnable == nil {
|
||||
w.MoveThreadFromDirectMessageChannelEnable = NewBool(false)
|
||||
}
|
||||
if w.MoveThreadFromGroupMessageChannelEnable == nil {
|
||||
w.MoveThreadFromGroupMessageChannelEnable = NewBool(false)
|
||||
}
|
||||
}
|
||||
|
||||
func (w *WranglerSettings) IsValid() *AppError {
|
||||
validDomainRegex := regexp.MustCompile(`^(([a-zA-Z]{1})|([a-zA-Z]{1}[a-zA-Z]{1})|([a-zA-Z]{1}[0-9]{1})|([0-9]{1}[a-zA-Z]{1})|([a-zA-Z0-9][a-zA-Z0-9-_]{1,61}[a-zA-Z0-9]))\.([a-zA-Z]{2,6}|[a-zA-Z0-9-]{2,30}\.[a-zA-Z]{2,3})$`)
|
||||
for _, domain := range w.AllowedEmailDomain {
|
||||
if !validDomainRegex.MatchString(domain) && domain != "localhost" {
|
||||
return NewAppError("Config.IsValid", "model.config.is_valid.move_thread.domain_invalid.app_error", nil, "", http.StatusBadRequest)
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
type GlobalRelayMessageExportSettings struct {
|
||||
CustomerType *string `access:"compliance_compliance_export"` // must be either A9, A10 or CUSTOM, dictates SMTP server url
|
||||
SMTPUsername *string `access:"compliance_compliance_export"`
|
||||
@@ -3405,6 +3450,7 @@ type Config struct {
|
||||
FeatureFlags *FeatureFlags `access:"*_read" json:",omitempty"`
|
||||
ImportSettings ImportSettings // telemetry: none
|
||||
ExportSettings ExportSettings
|
||||
WranglerSettings WranglerSettings
|
||||
}
|
||||
|
||||
func (o *Config) Auditable() map[string]interface{} {
|
||||
@@ -3520,6 +3566,7 @@ func (o *Config) SetDefaults() {
|
||||
}
|
||||
o.ImportSettings.SetDefaults()
|
||||
o.ExportSettings.SetDefaults()
|
||||
o.WranglerSettings.SetDefaults()
|
||||
}
|
||||
|
||||
func (o *Config) IsValid() *AppError {
|
||||
@@ -3610,6 +3657,11 @@ func (o *Config) IsValid() *AppError {
|
||||
if appErr := o.ImportSettings.isValid(); appErr != nil {
|
||||
return appErr
|
||||
}
|
||||
|
||||
if appErr := o.WranglerSettings.IsValid(); appErr != nil {
|
||||
return appErr
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user