From b0a003ea58fff27421655f15a7520109e96b2acb Mon Sep 17 00:00:00 2001 From: Mateusz Kwasniewski Date: Mon, 29 May 2023 08:28:47 +0200 Subject: [PATCH] feat: disable notifications flag (#3874) --- frontend/src/component/menu/Header/Header.tsx | 5 ++++- frontend/src/interfaces/uiConfig.ts | 1 + src/lib/__snapshots__/create-config.test.ts.snap | 2 ++ src/lib/types/experimental.ts | 7 ++++++- 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/frontend/src/component/menu/Header/Header.tsx b/frontend/src/component/menu/Header/Header.tsx index 08f9ffe06c..2c4a5e6aa3 100644 --- a/frontend/src/component/menu/Header/Header.tsx +++ b/frontend/src/component/menu/Header/Header.tsx @@ -255,7 +255,10 @@ const Header: VFC = () => { {' '} } /> diff --git a/frontend/src/interfaces/uiConfig.ts b/frontend/src/interfaces/uiConfig.ts index 2c002499e8..b84e0d447c 100644 --- a/frontend/src/interfaces/uiConfig.ts +++ b/frontend/src/interfaces/uiConfig.ts @@ -52,6 +52,7 @@ export interface IFlags { strategyImprovements?: boolean; disableBulkToggle?: boolean; segmentContextFieldUsage?: boolean; + disableNotifications?: boolean; } export interface IVersionInfo { diff --git a/src/lib/__snapshots__/create-config.test.ts.snap b/src/lib/__snapshots__/create-config.test.ts.snap index 6779d0a14e..aa00871ae9 100644 --- a/src/lib/__snapshots__/create-config.test.ts.snap +++ b/src/lib/__snapshots__/create-config.test.ts.snap @@ -72,6 +72,7 @@ exports[`should create default config 1`] = ` "cleanClientApi": false, "demo": false, "disableBulkToggle": false, + "disableNotifications": false, "embedProxy": true, "embedProxyFrontend": true, "featuresExportImport": true, @@ -103,6 +104,7 @@ exports[`should create default config 1`] = ` "cleanClientApi": false, "demo": false, "disableBulkToggle": false, + "disableNotifications": false, "embedProxy": true, "embedProxyFrontend": true, "featuresExportImport": true, diff --git a/src/lib/types/experimental.ts b/src/lib/types/experimental.ts index 0e031d5038..3eeace5375 100644 --- a/src/lib/types/experimental.ts +++ b/src/lib/types/experimental.ts @@ -22,7 +22,8 @@ export type IFlagKey = | 'googleAuthEnabled' | 'variantMetrics' | 'disableBulkToggle' - | 'segmentContextFieldUsage'; + | 'segmentContextFieldUsage' + | 'disableNotifications'; export type IFlags = Partial<{ [key in IFlagKey]: boolean | Variant }>; @@ -103,6 +104,10 @@ const flags: IFlags = { process.env.UNLEASH_SSEGMENT_CONTEXT_FIELD_USAGE, false, ), + disableNotifications: parseEnvVarBoolean( + process.env.DISABLE_NOTIFICATIONS, + false, + ), }; export const defaultExperimentalOptions: IExperimentalOptions = {