1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-07-26 13:48:33 +02:00

feat(banners): enable customer banners (#5348)

## About the changes
This feature allows our Enterprise customers to configure banners to be
displayed on their Unleash instance for all their users to see and
interact with. Previously known as "internal message banners".
This commit is contained in:
Gastón Fournier 2023-11-17 14:56:09 +01:00 committed by GitHub
parent be699962b1
commit 4801b64824
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 1 additions and 8 deletions

View File

@ -77,7 +77,6 @@ export const adminRoutes: INavigationMenuItem[] = [
{
path: '/admin/banners',
title: 'Banners',
flag: 'banners',
menu: { adminSettings: true, mode: ['enterprise'] },
group: 'instance',
},

View File

@ -3,17 +3,15 @@ import { formatApiPath } from 'utils/formatPath';
import handleErrorResponses from '../httpErrorResponseHandler';
import { useConditionalSWR } from '../useConditionalSWR/useConditionalSWR';
import useUiConfig from '../useUiConfig/useUiConfig';
import { useUiFlag } from 'hooks/useUiFlag';
import { IInternalBanner } from 'interfaces/banner';
const ENDPOINT = 'api/admin/banners';
export const useBanners = () => {
const { isEnterprise } = useUiConfig();
const bannersEnabled = useUiFlag('banners');
const { data, error, mutate } = useConditionalSWR(
isEnterprise() && bannersEnabled,
isEnterprise(),
{ banners: [] },
formatApiPath(ENDPOINT),
fetcher,

View File

@ -144,10 +144,6 @@ const flags: IFlags = {
process.env.UNLEASH_EXPERIMENTAL_USE_LAST_SEEN_REFACTOR,
false,
),
banners: parseEnvVarBoolean(
process.env.UNLEASH_EXPERIMENTAL_BANNERS,
false,
),
disableEnvsOnRevive: parseEnvVarBoolean(
process.env.UNLEASH_EXPERIMENTAL_DISABLE_ENVS_ON_REVIVE,
false,