[MM-58059] Remove PostPriority feature flag (#26929)

This commit is contained in:
Ben Schumacher
2024-05-06 10:11:28 +02:00
committed by GitHub
parent c9cb3d5bb0
commit 732932f51f
7 changed files with 1 additions and 45 deletions

View File

@@ -714,7 +714,6 @@ const defaultServerConfig: AdminConfig = {
PermalinkPreviews: false,
CallsEnabled: true,
NormalizeLdapDNs: false,
PostPriority: false,
WysiwygEditor: false,
OnboardingTourTips: true,
DeprecateCloudFree: false,

View File

@@ -233,9 +233,6 @@ func TestCreatePost(t *testing.T) {
}
func TestCreatePostForPriority(t *testing.T) {
os.Setenv("MM_FEATUREFLAGS_POSTPRIORITY", "true")
defer os.Unsetenv("MM_FEATUREFLAGS_POSTPRIORITY")
th := Setup(t).InitBasic()
defer th.TearDown()
client := th.Client

View File

@@ -6192,8 +6192,6 @@ func TestUpdatePasswordAudit(t *testing.T) {
}
func TestGetThreadsForUser(t *testing.T) {
os.Setenv("MM_FEATUREFLAGS_POSTPRIORITY", "true")
defer os.Unsetenv("MM_FEATUREFLAGS_POSTPRIORITY")
th := Setup(t).InitBasic()
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) {
th.App.UpdateConfig(func(cfg *model.Config) {
*cfg.ServiceSettings.PostPriority = false
cfg.FeatureFlags.PostPriority = true
})
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) {
th.App.UpdateConfig(func(cfg *model.Config) {
*cfg.ServiceSettings.PostPriority = true
cfg.FeatureFlags.PostPriority = true
})
client := th.Client
@@ -6349,7 +6345,6 @@ func TestGetThreadsForUser(t *testing.T) {
t.Run("isUrgent, 1 thread", func(t *testing.T) {
th.App.UpdateConfig(func(cfg *model.Config) {
*cfg.ServiceSettings.PostPriority = true
cfg.FeatureFlags.PostPriority = true
})
client := th.Client
@@ -7104,9 +7099,6 @@ func TestThreadCounts(t *testing.T) {
}
func TestSingleThreadGet(t *testing.T) {
os.Setenv("MM_FEATUREFLAGS_POSTPRIORITY", "true")
defer os.Unsetenv("MM_FEATUREFLAGS_POSTPRIORITY")
th := Setup(t).InitBasic()
defer th.TearDown()
@@ -7116,7 +7108,6 @@ func TestSingleThreadGet(t *testing.T) {
*cfg.ServiceSettings.ThreadAutoFollow = true
*cfg.ServiceSettings.CollapsedThreads = model.CollapsedThreadsDefaultOn
*cfg.ServiceSettings.PostPriority = true
cfg.FeatureFlags.PostPriority = true
})
client := th.Client
@@ -7162,7 +7153,6 @@ func TestSingleThreadGet(t *testing.T) {
th.App.UpdateConfig(func(cfg *model.Config) {
*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)

View File

@@ -4,7 +4,6 @@
package app
import (
"os"
"testing"
"github.com/mattermost/mattermost/server/public/model"
@@ -16,9 +15,6 @@ import (
func TestResolvePersistentNotification(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)
defer th.TearDown()
@@ -42,9 +38,6 @@ func TestResolvePersistentNotification(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)
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) {
os.Setenv("MM_FEATUREFLAGS_POSTPRIORITY", "true")
defer os.Unsetenv("MM_FEATUREFLAGS_POSTPRIORITY")
th := SetupWithStoreMock(t)
defer th.TearDown()
@@ -159,9 +149,6 @@ func TestResolvePersistentNotification(t *testing.T) {
func TestDeletePersistentNotification(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)
defer th.TearDown()
@@ -185,9 +172,6 @@ func TestDeletePersistentNotification(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)
defer th.TearDown()

View File

@@ -8,7 +8,6 @@ import (
"errors"
"fmt"
"net/http"
"os"
"strconv"
"sync"
"testing"
@@ -2451,9 +2450,6 @@ func TestCountMentionsFromPost(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()
defer th.TearDown()

View File

@@ -29,8 +29,6 @@ type FeatureFlags struct {
NormalizeLdapDNs bool
PostPriority bool
// Enable WYSIWYG text editor
WysiwygEditor bool

View File

@@ -2542,7 +2542,6 @@ const AdminDefinition: AdminDefinitionType = {
},
help_text_markdown: false,
isDisabled: it.not(it.userHasWritePermissionOnResource(RESOURCE_KEYS.SITE.POSTS)),
isHidden: it.configIsFalse('FeatureFlags', 'PostPriority'),
},
{
type: 'bool',
@@ -2561,10 +2560,7 @@ const AdminDefinition: AdminDefinitionType = {
},
help_text_markdown: false,
isDisabled: it.not(it.userHasWritePermissionOnResource(RESOURCE_KEYS.SITE.POSTS)),
isHidden: it.any(
it.configIsFalse('FeatureFlags', 'PostPriority'),
it.configIsFalse('ServiceSettings', 'PostPriority'),
),
isHidden: it.configIsFalse('ServiceSettings', 'PostPriority'),
},
{
type: 'number',
@@ -2584,7 +2580,6 @@ const AdminDefinition: AdminDefinitionType = {
help_text_markdown: false,
isDisabled: it.not(it.userHasWritePermissionOnResource(RESOURCE_KEYS.SITE.POSTS)),
isHidden: it.any(
it.configIsFalse('FeatureFlags', 'PostPriority'),
it.configIsFalse('ServiceSettings', 'PostPriority'),
it.configIsFalse('ServiceSettings', 'AllowPersistentNotifications'),
),
@@ -2607,7 +2602,6 @@ const AdminDefinition: AdminDefinitionType = {
help_text_markdown: false,
isDisabled: it.not(it.userHasWritePermissionOnResource(RESOURCE_KEYS.SITE.POSTS)),
isHidden: it.any(
it.configIsFalse('FeatureFlags', 'PostPriority'),
it.configIsFalse('ServiceSettings', 'PostPriority'),
it.configIsFalse('ServiceSettings', 'AllowPersistentNotifications'),
),
@@ -2631,7 +2625,6 @@ const AdminDefinition: AdminDefinitionType = {
help_text_markdown: false,
isDisabled: it.not(it.userHasWritePermissionOnResource(RESOURCE_KEYS.SITE.POSTS)),
isHidden: it.any(
it.configIsFalse('FeatureFlags', 'PostPriority'),
it.configIsFalse('ServiceSettings', 'PostPriority'),
it.configIsFalse('ServiceSettings', 'AllowPersistentNotifications'),
),
@@ -2655,7 +2648,6 @@ const AdminDefinition: AdminDefinitionType = {
isDisabled: it.not(it.userHasWritePermissionOnResource(RESOURCE_KEYS.SITE.POSTS)),
isHidden: it.any(
it.configIsFalse('GuestAccountsSettings', 'Enable'),
it.configIsFalse('FeatureFlags', 'PostPriority'),
it.configIsFalse('ServiceSettings', 'PostPriority'),
it.configIsFalse('ServiceSettings', 'AllowPersistentNotifications'),
),