diff --git a/src/lib/__snapshots__/create-config.test.ts.snap b/src/lib/__snapshots__/create-config.test.ts.snap index 0ba0809c25..ff3e1d4c10 100644 --- a/src/lib/__snapshots__/create-config.test.ts.snap +++ b/src/lib/__snapshots__/create-config.test.ts.snap @@ -86,6 +86,7 @@ exports[`should create default config 1`] = ` "disableNotifications": false, "disablePublishUnannouncedEvents": false, "disableUpdateMaxRevisionId": false, + "displayEdgeBanner": false, "edgeBulkMetrics": false, "embedProxy": true, "embedProxyFrontend": true, diff --git a/src/lib/routes/admin-api/config.ts b/src/lib/routes/admin-api/config.ts index b166f7948c..3da2e79e36 100644 --- a/src/lib/routes/admin-api/config.ts +++ b/src/lib/routes/admin-api/config.ts @@ -7,8 +7,8 @@ import Controller from '../controller'; import VersionService from '../../services/version-service'; import SettingService from '../../services/setting-service'; import { - simpleAuthSettingsKey, SimpleAuthSettings, + simpleAuthSettingsKey, } from '../../types/settings/simple-auth-settings'; import { ADMIN, NONE } from '../../types/permissions'; import { createResponseSchema } from '../../openapi/util/create-response-schema'; @@ -153,7 +153,9 @@ class ConfigController extends Controller { const flags = { ...this.config.ui.flags, ...expFlags, - displayUpgradeEdgeBanner: usesOldEdge, + displayUpgradeEdgeBanner: + usesOldEdge || + this.config.flagResolver.isEnabled('displayEdgeBanner'), }; const response: UiConfigSchema = { diff --git a/src/lib/types/experimental.ts b/src/lib/types/experimental.ts index aeb3977000..cbaee15667 100644 --- a/src/lib/types/experimental.ts +++ b/src/lib/types/experimental.ts @@ -1,4 +1,4 @@ -import { Variant, PayloadType } from 'unleash-client'; +import { PayloadType, Variant } from 'unleash-client'; import { parseEnvVarBoolean } from '../util'; import { getDefaultVariant } from 'unleash-client/lib/variant'; @@ -51,7 +51,8 @@ export type IFlagKey = | 'disableUpdateMaxRevisionId' | 'disablePublishUnannouncedEvents' | 'sdkReporting' - | 'scimApi'; + | 'scimApi' + | 'displayEdgeBanner'; export type IFlags = Partial<{ [key in IFlagKey]: boolean | Variant }>; @@ -252,6 +253,10 @@ const flags: IFlags = { process.env.UNLEASH_EXPERIMENTAL_SCIM_API, false, ), + displayEdgeBanner: parseEnvVarBoolean( + process.env.UNLEASH_EXPERIMENTAL_DISPLAY_EDGE_BANNER, + false, + ), }; export const defaultExperimentalOptions: IExperimentalOptions = {