From 732932f51fe26e84235a649d221cc2ccbf224894 Mon Sep 17 00:00:00 2001 From: Ben Schumacher Date: Mon, 6 May 2024 10:11:28 +0200 Subject: [PATCH] [MM-58059] Remove PostPriority feature flag (#26929) --- .../playwright/support/server/default_config.ts | 1 - server/channels/api4/post_test.go | 3 --- server/channels/api4/user_test.go | 10 ---------- .../app/post_persistent_notification_test.go | 16 ---------------- server/channels/app/post_test.go | 4 ---- server/public/model/feature_flags.go | 2 -- .../admin_console/admin_definition.tsx | 10 +--------- 7 files changed, 1 insertion(+), 45 deletions(-) diff --git a/e2e-tests/playwright/support/server/default_config.ts b/e2e-tests/playwright/support/server/default_config.ts index 39e38cb87d..c4f8543de6 100644 --- a/e2e-tests/playwright/support/server/default_config.ts +++ b/e2e-tests/playwright/support/server/default_config.ts @@ -714,7 +714,6 @@ const defaultServerConfig: AdminConfig = { PermalinkPreviews: false, CallsEnabled: true, NormalizeLdapDNs: false, - PostPriority: false, WysiwygEditor: false, OnboardingTourTips: true, DeprecateCloudFree: false, diff --git a/server/channels/api4/post_test.go b/server/channels/api4/post_test.go index 0bee734648..34d4ccee03 100644 --- a/server/channels/api4/post_test.go +++ b/server/channels/api4/post_test.go @@ -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 diff --git a/server/channels/api4/user_test.go b/server/channels/api4/user_test.go index 2f53387fa3..eb60b2844e 100644 --- a/server/channels/api4/user_test.go +++ b/server/channels/api4/user_test.go @@ -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) diff --git a/server/channels/app/post_persistent_notification_test.go b/server/channels/app/post_persistent_notification_test.go index 81191542b0..794e282ae2 100644 --- a/server/channels/app/post_persistent_notification_test.go +++ b/server/channels/app/post_persistent_notification_test.go @@ -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() diff --git a/server/channels/app/post_test.go b/server/channels/app/post_test.go index c4e0ac8b82..d22a1dc5b8 100644 --- a/server/channels/app/post_test.go +++ b/server/channels/app/post_test.go @@ -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() diff --git a/server/public/model/feature_flags.go b/server/public/model/feature_flags.go index 260cf34cd8..8065f2a2aa 100644 --- a/server/public/model/feature_flags.go +++ b/server/public/model/feature_flags.go @@ -29,8 +29,6 @@ type FeatureFlags struct { NormalizeLdapDNs bool - PostPriority bool - // Enable WYSIWYG text editor WysiwygEditor bool diff --git a/webapp/channels/src/components/admin_console/admin_definition.tsx b/webapp/channels/src/components/admin_console/admin_definition.tsx index acdbfe36c2..25c0f77419 100644 --- a/webapp/channels/src/components/admin_console/admin_definition.tsx +++ b/webapp/channels/src/components/admin_console/admin_definition.tsx @@ -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'), ),