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:
parent
be699962b1
commit
4801b64824
@ -77,7 +77,6 @@ export const adminRoutes: INavigationMenuItem[] = [
|
||||
{
|
||||
path: '/admin/banners',
|
||||
title: 'Banners',
|
||||
flag: 'banners',
|
||||
menu: { adminSettings: true, mode: ['enterprise'] },
|
||||
group: 'instance',
|
||||
},
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user