diff --git a/e2e-tests/playwright/support/server/default_config.ts b/e2e-tests/playwright/support/server/default_config.ts index 5d6e56f7d5..33d545537b 100644 --- a/e2e-tests/playwright/support/server/default_config.ts +++ b/e2e-tests/playwright/support/server/default_config.ts @@ -697,6 +697,7 @@ const defaultServerConfig: AdminConfig = { ThreadsEverywhere: false, GlobalDrafts: true, OnboardingTourTips: true, + AppsSidebarCategory: false, }, ImportSettings: { Directory: './import', diff --git a/model/feature_flags.go b/model/feature_flags.go index 689ff32fd6..59d0ec8891 100644 --- a/model/feature_flags.go +++ b/model/feature_flags.go @@ -74,6 +74,8 @@ type FeatureFlags struct { GlobalDrafts bool OnboardingTourTips bool + + AppsSidebarCategory bool } func (f *FeatureFlags) SetDefaults() { @@ -102,6 +104,7 @@ func (f *FeatureFlags) SetDefaults() { f.WysiwygEditor = false f.OnboardingAutoShowLinkedBoard = false f.OnboardingTourTips = true + f.AppsSidebarCategory = false } func (f *FeatureFlags) Plugins() map[string]string { diff --git a/webapp/channels/src/packages/mattermost-redux/src/selectors/entities/preferences.test.ts b/webapp/channels/src/packages/mattermost-redux/src/selectors/entities/preferences.test.ts index cb7eca1570..cf5e7e4665 100644 --- a/webapp/channels/src/packages/mattermost-redux/src/selectors/entities/preferences.test.ts +++ b/webapp/channels/src/packages/mattermost-redux/src/selectors/entities/preferences.test.ts @@ -732,3 +732,41 @@ describe('shouldShowUnreadsCategory', () => { expect(Selectors.shouldShowUnreadsCategory(state)).toBe(true); }); }); + +describe('get feature flags', () => { + test('should check the value of feature flag AppsSidebarCategory', () => { + let state = { + entities: { + general: { + config: {}, + }, + }, + } as GlobalState; + + expect(Selectors.appsSidebarCategoryEnabled(state)).toBe(false); + + state = { + entities: { + general: { + config: { + FeatureFlagAppsSidebarCategory: 'false', + }, + }, + }, + } as GlobalState; + + expect(Selectors.appsSidebarCategoryEnabled(state)).toBe(false); + + state = { + entities: { + general: { + config: { + FeatureFlagAppsSidebarCategory: 'true', + }, + }, + }, + } as GlobalState; + + expect(Selectors.appsSidebarCategoryEnabled(state)).toBe(true); + }); +}); diff --git a/webapp/channels/src/packages/mattermost-redux/src/selectors/entities/preferences.ts b/webapp/channels/src/packages/mattermost-redux/src/selectors/entities/preferences.ts index cc3dc612cc..fa0149a93c 100644 --- a/webapp/channels/src/packages/mattermost-redux/src/selectors/entities/preferences.ts +++ b/webapp/channels/src/packages/mattermost-redux/src/selectors/entities/preferences.ts @@ -299,3 +299,7 @@ export function autoShowLinkedBoardFFEnabled(state: GlobalState): boolean { export function onboardingTourTipsEnabled(state: GlobalState): boolean { return getFeatureFlagValue(state, 'OnboardingTourTips') === 'true'; } + +export function appsSidebarCategoryEnabled(state: GlobalState): boolean { + return getFeatureFlagValue(state, 'AppsSidebarCategory') === 'true'; +} diff --git a/webapp/platform/types/src/config.ts b/webapp/platform/types/src/config.ts index acb4047d45..a99f58ef4b 100644 --- a/webapp/platform/types/src/config.ts +++ b/webapp/platform/types/src/config.ts @@ -116,6 +116,7 @@ export type ClientConfig = { ExperimentalViewArchivedChannels: string; FileLevel: string; FeatureFlagAppsEnabled: string; + FeatureFlagAppsSidebarCategory: string; FeatureFlagBoardsProduct: string; FeatureFlagCallsEnabled: string; FeatureFlagGraphQL: string;