[MM-58059] Remove PostPriority feature flag (#26929)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
c9cb3d5bb0
Коммит
732932f51f
@@ -714,7 +714,6 @@ const defaultServerConfig: AdminConfig = {
|
|||||||
PermalinkPreviews: false,
|
PermalinkPreviews: false,
|
||||||
CallsEnabled: true,
|
CallsEnabled: true,
|
||||||
NormalizeLdapDNs: false,
|
NormalizeLdapDNs: false,
|
||||||
PostPriority: false,
|
|
||||||
WysiwygEditor: false,
|
WysiwygEditor: false,
|
||||||
OnboardingTourTips: true,
|
OnboardingTourTips: true,
|
||||||
DeprecateCloudFree: false,
|
DeprecateCloudFree: false,
|
||||||
|
|||||||
@@ -233,9 +233,6 @@ func TestCreatePost(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestCreatePostForPriority(t *testing.T) {
|
func TestCreatePostForPriority(t *testing.T) {
|
||||||
os.Setenv("MM_FEATUREFLAGS_POSTPRIORITY", "true")
|
|
||||||
defer os.Unsetenv("MM_FEATUREFLAGS_POSTPRIORITY")
|
|
||||||
|
|
||||||
th := Setup(t).InitBasic()
|
th := Setup(t).InitBasic()
|
||||||
defer th.TearDown()
|
defer th.TearDown()
|
||||||
client := th.Client
|
client := th.Client
|
||||||
|
|||||||
@@ -6192,8 +6192,6 @@ func TestUpdatePasswordAudit(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestGetThreadsForUser(t *testing.T) {
|
func TestGetThreadsForUser(t *testing.T) {
|
||||||
os.Setenv("MM_FEATUREFLAGS_POSTPRIORITY", "true")
|
|
||||||
defer os.Unsetenv("MM_FEATUREFLAGS_POSTPRIORITY")
|
|
||||||
th := Setup(t).InitBasic()
|
th := Setup(t).InitBasic()
|
||||||
defer th.TearDown()
|
defer th.TearDown()
|
||||||
|
|
||||||
@@ -6300,7 +6298,6 @@ func TestGetThreadsForUser(t *testing.T) {
|
|||||||
t.Run("throw error when post-priority service-setting is off", func(t *testing.T) {
|
t.Run("throw error when post-priority service-setting is off", func(t *testing.T) {
|
||||||
th.App.UpdateConfig(func(cfg *model.Config) {
|
th.App.UpdateConfig(func(cfg *model.Config) {
|
||||||
*cfg.ServiceSettings.PostPriority = false
|
*cfg.ServiceSettings.PostPriority = false
|
||||||
cfg.FeatureFlags.PostPriority = true
|
|
||||||
})
|
})
|
||||||
|
|
||||||
client := th.Client
|
client := th.Client
|
||||||
@@ -6321,7 +6318,6 @@ func TestGetThreadsForUser(t *testing.T) {
|
|||||||
t.Run("throw error when post-priority is set for a reply", func(t *testing.T) {
|
t.Run("throw error when post-priority is set for a reply", func(t *testing.T) {
|
||||||
th.App.UpdateConfig(func(cfg *model.Config) {
|
th.App.UpdateConfig(func(cfg *model.Config) {
|
||||||
*cfg.ServiceSettings.PostPriority = true
|
*cfg.ServiceSettings.PostPriority = true
|
||||||
cfg.FeatureFlags.PostPriority = true
|
|
||||||
})
|
})
|
||||||
|
|
||||||
client := th.Client
|
client := th.Client
|
||||||
@@ -6349,7 +6345,6 @@ func TestGetThreadsForUser(t *testing.T) {
|
|||||||
t.Run("isUrgent, 1 thread", func(t *testing.T) {
|
t.Run("isUrgent, 1 thread", func(t *testing.T) {
|
||||||
th.App.UpdateConfig(func(cfg *model.Config) {
|
th.App.UpdateConfig(func(cfg *model.Config) {
|
||||||
*cfg.ServiceSettings.PostPriority = true
|
*cfg.ServiceSettings.PostPriority = true
|
||||||
cfg.FeatureFlags.PostPriority = true
|
|
||||||
})
|
})
|
||||||
|
|
||||||
client := th.Client
|
client := th.Client
|
||||||
@@ -7104,9 +7099,6 @@ func TestThreadCounts(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestSingleThreadGet(t *testing.T) {
|
func TestSingleThreadGet(t *testing.T) {
|
||||||
os.Setenv("MM_FEATUREFLAGS_POSTPRIORITY", "true")
|
|
||||||
defer os.Unsetenv("MM_FEATUREFLAGS_POSTPRIORITY")
|
|
||||||
|
|
||||||
th := Setup(t).InitBasic()
|
th := Setup(t).InitBasic()
|
||||||
defer th.TearDown()
|
defer th.TearDown()
|
||||||
|
|
||||||
@@ -7116,7 +7108,6 @@ func TestSingleThreadGet(t *testing.T) {
|
|||||||
*cfg.ServiceSettings.ThreadAutoFollow = true
|
*cfg.ServiceSettings.ThreadAutoFollow = true
|
||||||
*cfg.ServiceSettings.CollapsedThreads = model.CollapsedThreadsDefaultOn
|
*cfg.ServiceSettings.CollapsedThreads = model.CollapsedThreadsDefaultOn
|
||||||
*cfg.ServiceSettings.PostPriority = true
|
*cfg.ServiceSettings.PostPriority = true
|
||||||
cfg.FeatureFlags.PostPriority = true
|
|
||||||
})
|
})
|
||||||
|
|
||||||
client := th.Client
|
client := th.Client
|
||||||
@@ -7162,7 +7153,6 @@ func TestSingleThreadGet(t *testing.T) {
|
|||||||
|
|
||||||
th.App.UpdateConfig(func(cfg *model.Config) {
|
th.App.UpdateConfig(func(cfg *model.Config) {
|
||||||
*cfg.ServiceSettings.PostPriority = true
|
*cfg.ServiceSettings.PostPriority = true
|
||||||
cfg.FeatureFlags.PostPriority = true
|
|
||||||
})
|
})
|
||||||
|
|
||||||
tr, _, err = th.Client.GetUserThread(context.Background(), th.BasicUser.Id, th.BasicTeam.Id, threads.Threads[0].PostId, true)
|
tr, _, err = th.Client.GetUserThread(context.Background(), th.BasicUser.Id, th.BasicTeam.Id, threads.Threads[0].PostId, true)
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
package app
|
package app
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"os"
|
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost/server/public/model"
|
"github.com/mattermost/mattermost/server/public/model"
|
||||||
@@ -16,9 +15,6 @@ import (
|
|||||||
|
|
||||||
func TestResolvePersistentNotification(t *testing.T) {
|
func TestResolvePersistentNotification(t *testing.T) {
|
||||||
t.Run("should not delete when no posts exist", func(t *testing.T) {
|
t.Run("should not delete when no posts exist", func(t *testing.T) {
|
||||||
os.Setenv("MM_FEATUREFLAGS_POSTPRIORITY", "true")
|
|
||||||
defer os.Unsetenv("MM_FEATUREFLAGS_POSTPRIORITY")
|
|
||||||
|
|
||||||
th := SetupWithStoreMock(t)
|
th := SetupWithStoreMock(t)
|
||||||
defer th.TearDown()
|
defer th.TearDown()
|
||||||
|
|
||||||
@@ -42,9 +38,6 @@ func TestResolvePersistentNotification(t *testing.T) {
|
|||||||
})
|
})
|
||||||
|
|
||||||
t.Run("should delete for mentioned user", func(t *testing.T) {
|
t.Run("should delete for mentioned user", func(t *testing.T) {
|
||||||
os.Setenv("MM_FEATUREFLAGS_POSTPRIORITY", "true")
|
|
||||||
defer os.Unsetenv("MM_FEATUREFLAGS_POSTPRIORITY")
|
|
||||||
|
|
||||||
th := SetupWithStoreMock(t)
|
th := SetupWithStoreMock(t)
|
||||||
defer th.TearDown()
|
defer th.TearDown()
|
||||||
|
|
||||||
@@ -108,9 +101,6 @@ func TestResolvePersistentNotification(t *testing.T) {
|
|||||||
})
|
})
|
||||||
|
|
||||||
t.Run("should not delete for non-mentioned user", func(t *testing.T) {
|
t.Run("should not delete for non-mentioned user", func(t *testing.T) {
|
||||||
os.Setenv("MM_FEATUREFLAGS_POSTPRIORITY", "true")
|
|
||||||
defer os.Unsetenv("MM_FEATUREFLAGS_POSTPRIORITY")
|
|
||||||
|
|
||||||
th := SetupWithStoreMock(t)
|
th := SetupWithStoreMock(t)
|
||||||
defer th.TearDown()
|
defer th.TearDown()
|
||||||
|
|
||||||
@@ -159,9 +149,6 @@ func TestResolvePersistentNotification(t *testing.T) {
|
|||||||
|
|
||||||
func TestDeletePersistentNotification(t *testing.T) {
|
func TestDeletePersistentNotification(t *testing.T) {
|
||||||
t.Run("should not delete when no posts exist", func(t *testing.T) {
|
t.Run("should not delete when no posts exist", func(t *testing.T) {
|
||||||
os.Setenv("MM_FEATUREFLAGS_POSTPRIORITY", "true")
|
|
||||||
defer os.Unsetenv("MM_FEATUREFLAGS_POSTPRIORITY")
|
|
||||||
|
|
||||||
th := SetupWithStoreMock(t)
|
th := SetupWithStoreMock(t)
|
||||||
defer th.TearDown()
|
defer th.TearDown()
|
||||||
|
|
||||||
@@ -185,9 +172,6 @@ func TestDeletePersistentNotification(t *testing.T) {
|
|||||||
})
|
})
|
||||||
|
|
||||||
t.Run("should delete", func(t *testing.T) {
|
t.Run("should delete", func(t *testing.T) {
|
||||||
os.Setenv("MM_FEATUREFLAGS_POSTPRIORITY", "true")
|
|
||||||
defer os.Unsetenv("MM_FEATUREFLAGS_POSTPRIORITY")
|
|
||||||
|
|
||||||
th := SetupWithStoreMock(t)
|
th := SetupWithStoreMock(t)
|
||||||
defer th.TearDown()
|
defer th.TearDown()
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
|
||||||
"strconv"
|
"strconv"
|
||||||
"sync"
|
"sync"
|
||||||
"testing"
|
"testing"
|
||||||
@@ -2451,9 +2450,6 @@ func TestCountMentionsFromPost(t *testing.T) {
|
|||||||
})
|
})
|
||||||
|
|
||||||
t.Run("should count urgent mentions", func(t *testing.T) {
|
t.Run("should count urgent mentions", func(t *testing.T) {
|
||||||
os.Setenv("MM_FEATUREFLAGS_POSTPRIORITY", "true")
|
|
||||||
defer os.Unsetenv("MM_FEATUREFLAGS_POSTPRIORITY")
|
|
||||||
|
|
||||||
th := Setup(t).InitBasic()
|
th := Setup(t).InitBasic()
|
||||||
defer th.TearDown()
|
defer th.TearDown()
|
||||||
|
|
||||||
|
|||||||
@@ -29,8 +29,6 @@ type FeatureFlags struct {
|
|||||||
|
|
||||||
NormalizeLdapDNs bool
|
NormalizeLdapDNs bool
|
||||||
|
|
||||||
PostPriority bool
|
|
||||||
|
|
||||||
// Enable WYSIWYG text editor
|
// Enable WYSIWYG text editor
|
||||||
WysiwygEditor bool
|
WysiwygEditor bool
|
||||||
|
|
||||||
|
|||||||
@@ -2542,7 +2542,6 @@ const AdminDefinition: AdminDefinitionType = {
|
|||||||
},
|
},
|
||||||
help_text_markdown: false,
|
help_text_markdown: false,
|
||||||
isDisabled: it.not(it.userHasWritePermissionOnResource(RESOURCE_KEYS.SITE.POSTS)),
|
isDisabled: it.not(it.userHasWritePermissionOnResource(RESOURCE_KEYS.SITE.POSTS)),
|
||||||
isHidden: it.configIsFalse('FeatureFlags', 'PostPriority'),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'bool',
|
type: 'bool',
|
||||||
@@ -2561,10 +2560,7 @@ const AdminDefinition: AdminDefinitionType = {
|
|||||||
},
|
},
|
||||||
help_text_markdown: false,
|
help_text_markdown: false,
|
||||||
isDisabled: it.not(it.userHasWritePermissionOnResource(RESOURCE_KEYS.SITE.POSTS)),
|
isDisabled: it.not(it.userHasWritePermissionOnResource(RESOURCE_KEYS.SITE.POSTS)),
|
||||||
isHidden: it.any(
|
isHidden: it.configIsFalse('ServiceSettings', 'PostPriority'),
|
||||||
it.configIsFalse('FeatureFlags', 'PostPriority'),
|
|
||||||
it.configIsFalse('ServiceSettings', 'PostPriority'),
|
|
||||||
),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'number',
|
type: 'number',
|
||||||
@@ -2584,7 +2580,6 @@ const AdminDefinition: AdminDefinitionType = {
|
|||||||
help_text_markdown: false,
|
help_text_markdown: false,
|
||||||
isDisabled: it.not(it.userHasWritePermissionOnResource(RESOURCE_KEYS.SITE.POSTS)),
|
isDisabled: it.not(it.userHasWritePermissionOnResource(RESOURCE_KEYS.SITE.POSTS)),
|
||||||
isHidden: it.any(
|
isHidden: it.any(
|
||||||
it.configIsFalse('FeatureFlags', 'PostPriority'),
|
|
||||||
it.configIsFalse('ServiceSettings', 'PostPriority'),
|
it.configIsFalse('ServiceSettings', 'PostPriority'),
|
||||||
it.configIsFalse('ServiceSettings', 'AllowPersistentNotifications'),
|
it.configIsFalse('ServiceSettings', 'AllowPersistentNotifications'),
|
||||||
),
|
),
|
||||||
@@ -2607,7 +2602,6 @@ const AdminDefinition: AdminDefinitionType = {
|
|||||||
help_text_markdown: false,
|
help_text_markdown: false,
|
||||||
isDisabled: it.not(it.userHasWritePermissionOnResource(RESOURCE_KEYS.SITE.POSTS)),
|
isDisabled: it.not(it.userHasWritePermissionOnResource(RESOURCE_KEYS.SITE.POSTS)),
|
||||||
isHidden: it.any(
|
isHidden: it.any(
|
||||||
it.configIsFalse('FeatureFlags', 'PostPriority'),
|
|
||||||
it.configIsFalse('ServiceSettings', 'PostPriority'),
|
it.configIsFalse('ServiceSettings', 'PostPriority'),
|
||||||
it.configIsFalse('ServiceSettings', 'AllowPersistentNotifications'),
|
it.configIsFalse('ServiceSettings', 'AllowPersistentNotifications'),
|
||||||
),
|
),
|
||||||
@@ -2631,7 +2625,6 @@ const AdminDefinition: AdminDefinitionType = {
|
|||||||
help_text_markdown: false,
|
help_text_markdown: false,
|
||||||
isDisabled: it.not(it.userHasWritePermissionOnResource(RESOURCE_KEYS.SITE.POSTS)),
|
isDisabled: it.not(it.userHasWritePermissionOnResource(RESOURCE_KEYS.SITE.POSTS)),
|
||||||
isHidden: it.any(
|
isHidden: it.any(
|
||||||
it.configIsFalse('FeatureFlags', 'PostPriority'),
|
|
||||||
it.configIsFalse('ServiceSettings', 'PostPriority'),
|
it.configIsFalse('ServiceSettings', 'PostPriority'),
|
||||||
it.configIsFalse('ServiceSettings', 'AllowPersistentNotifications'),
|
it.configIsFalse('ServiceSettings', 'AllowPersistentNotifications'),
|
||||||
),
|
),
|
||||||
@@ -2655,7 +2648,6 @@ const AdminDefinition: AdminDefinitionType = {
|
|||||||
isDisabled: it.not(it.userHasWritePermissionOnResource(RESOURCE_KEYS.SITE.POSTS)),
|
isDisabled: it.not(it.userHasWritePermissionOnResource(RESOURCE_KEYS.SITE.POSTS)),
|
||||||
isHidden: it.any(
|
isHidden: it.any(
|
||||||
it.configIsFalse('GuestAccountsSettings', 'Enable'),
|
it.configIsFalse('GuestAccountsSettings', 'Enable'),
|
||||||
it.configIsFalse('FeatureFlags', 'PostPriority'),
|
|
||||||
it.configIsFalse('ServiceSettings', 'PostPriority'),
|
it.configIsFalse('ServiceSettings', 'PostPriority'),
|
||||||
it.configIsFalse('ServiceSettings', 'AllowPersistentNotifications'),
|
it.configIsFalse('ServiceSettings', 'AllowPersistentNotifications'),
|
||||||
),
|
),
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user