mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
MM-51711_Feature flag: APPS sidebar category (#22766)
This commit is contained in:
parent
3b8a0f224b
commit
9156205178
@ -697,6 +697,7 @@ const defaultServerConfig: AdminConfig = {
|
||||
ThreadsEverywhere: false,
|
||||
GlobalDrafts: true,
|
||||
OnboardingTourTips: true,
|
||||
AppsSidebarCategory: false,
|
||||
},
|
||||
ImportSettings: {
|
||||
Directory: './import',
|
||||
|
@ -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 {
|
||||
|
@ -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);
|
||||
});
|
||||
});
|
||||
|
@ -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';
|
||||
}
|
||||
|
@ -116,6 +116,7 @@ export type ClientConfig = {
|
||||
ExperimentalViewArchivedChannels: string;
|
||||
FileLevel: string;
|
||||
FeatureFlagAppsEnabled: string;
|
||||
FeatureFlagAppsSidebarCategory: string;
|
||||
FeatureFlagBoardsProduct: string;
|
||||
FeatureFlagCallsEnabled: string;
|
||||
FeatureFlagGraphQL: string;
|
||||
|
Loading…
Reference in New Issue
Block a user