Merge branch 'master' into MM-47853-true-up-review-telemetry-off-non-air-gapped
Этот коммит содержится в:
@@ -10,6 +10,7 @@ import (
|
||||
"errors"
|
||||
"io"
|
||||
"net/http"
|
||||
"regexp"
|
||||
"sort"
|
||||
"strings"
|
||||
"unicode/utf8"
|
||||
@@ -159,7 +160,7 @@ type ChannelModeratedRolesPatch struct {
|
||||
type ChannelSearchOpts struct {
|
||||
NotAssociatedToGroup string
|
||||
ExcludeDefaultChannels bool
|
||||
IncludeDeleted bool
|
||||
IncludeDeleted bool // If true, deleted channels will be included in the results.
|
||||
Deleted bool
|
||||
ExcludeChannelNames []string
|
||||
TeamIds []string
|
||||
@@ -173,7 +174,7 @@ type ChannelSearchOpts struct {
|
||||
Private bool
|
||||
Page *int
|
||||
PerPage *int
|
||||
LastDeleteAt int
|
||||
LastDeleteAt int // When combined with IncludeDeleted, only channels deleted after this time will be returned.
|
||||
LastUpdateAt int
|
||||
}
|
||||
|
||||
@@ -185,6 +186,8 @@ type ChannelMemberCountByGroup struct {
|
||||
|
||||
type ChannelOption func(channel *Channel)
|
||||
|
||||
var gmNameRegex = regexp.MustCompile("^[a-f0-9]{40}$")
|
||||
|
||||
func WithID(ID string) ChannelOption {
|
||||
return func(channel *Channel) {
|
||||
channel.Id = ID
|
||||
@@ -281,9 +284,11 @@ func (o *Channel) IsValid() *AppError {
|
||||
return NewAppError("Channel.IsValid", "model.channel.is_valid.creator_id.app_error", nil, "", http.StatusBadRequest)
|
||||
}
|
||||
|
||||
userIds := strings.Split(o.Name, "__")
|
||||
if o.Type != ChannelTypeDirect && len(userIds) == 2 && IsValidId(userIds[0]) && IsValidId(userIds[1]) {
|
||||
return NewAppError("Channel.IsValid", "model.channel.is_valid.name.app_error", nil, "", http.StatusBadRequest)
|
||||
if o.Type != ChannelTypeDirect && o.Type != ChannelTypeGroup {
|
||||
userIds := strings.Split(o.Name, "__")
|
||||
if ok := gmNameRegex.MatchString(o.Name); ok || (o.Type != ChannelTypeDirect && len(userIds) == 2 && IsValidId(userIds[0]) && IsValidId(userIds[1])) {
|
||||
return NewAppError("Channel.IsValid", "model.channel.is_valid.name.app_error", nil, "", http.StatusBadRequest)
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
|
||||
@@ -79,6 +79,12 @@ func TestChannelIsValid(t *testing.T) {
|
||||
|
||||
o.Purpose = strings.Repeat("0123456789", 25)
|
||||
require.Nil(t, o.IsValid())
|
||||
|
||||
o.Name = "beu8cc6b3jnxfe9r4na9baooma__36atajbs87dqmpym6o8eiy9saa"
|
||||
require.NotNil(t, o.IsValid())
|
||||
|
||||
o.Name = "71b03afcbb2d503d49f87f057549c43db4e19f92"
|
||||
require.NotNil(t, o.IsValid())
|
||||
}
|
||||
|
||||
func TestChannelPreSave(t *testing.T) {
|
||||
|
||||
@@ -2867,8 +2867,8 @@ func (s *PluginSettings) SetDefaults(ls LogSettings) {
|
||||
}
|
||||
|
||||
if s.PluginStates[PluginIdFocalboard] == nil {
|
||||
// Enable the focalboard plugin by default
|
||||
s.PluginStates[PluginIdFocalboard] = &PluginState{Enable: true}
|
||||
// Disable the focalboard plugin by default
|
||||
s.PluginStates[PluginIdFocalboard] = &PluginState{Enable: false}
|
||||
}
|
||||
|
||||
if s.PluginStates[PluginIdApps] == nil {
|
||||
|
||||
@@ -387,11 +387,11 @@ func TestConfigDefaultChannelExportPluginState(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestConfigDefaultFocalboardPluginState(t *testing.T) {
|
||||
t.Run("should enable Focalboard plugin by default", func(t *testing.T) {
|
||||
t.Run("should not enable Focalboard plugin by default", func(t *testing.T) {
|
||||
c1 := Config{}
|
||||
c1.SetDefaults()
|
||||
|
||||
assert.True(t, c1.PluginSettings.PluginStates["focalboard"].Enable)
|
||||
assert.False(t, c1.PluginSettings.PluginStates["focalboard"].Enable)
|
||||
})
|
||||
|
||||
t.Run("should not re-enable focalboard plugin after it has been disabled", func(t *testing.T) {
|
||||
|
||||
@@ -63,6 +63,9 @@ type FeatureFlags struct {
|
||||
|
||||
PostPriority bool
|
||||
|
||||
// Enable WYSIWYG text editor
|
||||
WysiwygEditor bool
|
||||
|
||||
PeopleProduct bool
|
||||
|
||||
AnnualSubscription bool
|
||||
@@ -92,7 +95,7 @@ func (f *FeatureFlags) SetDefaults() {
|
||||
f.InsightsEnabled = true
|
||||
f.CommandPalette = false
|
||||
f.CallsEnabled = true
|
||||
f.BoardsProduct = false
|
||||
f.BoardsProduct = true
|
||||
f.SendWelcomePost = true
|
||||
f.PostPriority = true
|
||||
f.PeopleProduct = false
|
||||
@@ -101,6 +104,7 @@ func (f *FeatureFlags) SetDefaults() {
|
||||
f.ReduceOnBoardingTaskList = false
|
||||
f.ThreadsEverywhere = false
|
||||
f.GlobalDrafts = true
|
||||
f.WysiwygEditor = false
|
||||
}
|
||||
|
||||
func (f *FeatureFlags) Plugins() map[string]string {
|
||||
|
||||
@@ -13,6 +13,7 @@ import (
|
||||
// It should be maintained in chronological order with most current
|
||||
// release at the front of the list.
|
||||
var versions = []string{
|
||||
"7.8.0",
|
||||
"7.7.0",
|
||||
"7.6.0",
|
||||
"7.5.0",
|
||||
|
||||
Ссылка в новой задаче
Block a user