1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-11 00:08:30 +01:00
unleash.unleash/frontend/src/interfaces/uiConfig.ts
andreas-unleash 1cd0edb11a
feat: variant with number payload (#4654)
Adds `number` as possible payload type for variant.
Adds a flag to enable the feature
Updates all relevant models and schemas
Adds the option to the UI

Closes: #
[1-1357](https://linear.app/unleash/issue/1-1357/support-number-in-variant-payload)

---------

Signed-off-by: andreas-unleash <andreas@getunleash.ai>
2023-09-11 16:57:42 +03:00

89 lines
2.1 KiB
TypeScript

import { ReactNode } from 'react';
import { Variant } from 'utils/variants';
export interface IUiConfig {
authenticationType?: string;
baseUriPath?: string;
/**
* @deprecated `useUiFlags` can be used instead
* @example
* ```ts
* const yourFlag = useUiFlags("yourFlag")
* ```
*/
flags: UiFlags;
name: string;
slogan: string;
environment?: string;
unleashUrl?: string;
version: string;
versionInfo?: IVersionInfo;
links: ILinks[];
disablePasswordAuth?: boolean;
emailEnabled?: boolean;
networkViewEnabled: boolean;
maintenanceMode?: boolean;
toast?: IProclamationToast;
segmentValuesLimit?: number;
strategySegmentsLimit?: number;
frontendApiOrigins?: string[];
}
export interface IProclamationToast {
message: string;
id: string;
severity: 'success' | 'info' | 'warning' | 'error';
link: string;
}
export type UiFlags = {
P: boolean;
RE: boolean;
EEA?: boolean;
SE?: boolean;
T?: boolean;
UNLEASH_CLOUD?: boolean;
UG?: boolean;
embedProxyFrontend?: boolean;
maintenanceMode?: boolean;
messageBanner?: Variant;
featuresExportImport?: boolean;
caseInsensitiveInOperators?: boolean;
proPlanAutoCharge?: boolean;
notifications?: boolean;
personalAccessTokensKillSwitch?: boolean;
demo?: boolean;
googleAuthEnabled?: boolean;
disableBulkToggle?: boolean;
disableNotifications?: boolean;
advancedPlayground?: boolean;
customRootRolesKillSwitch?: boolean;
strategyVariant?: boolean;
lastSeenByEnvironment?: boolean;
integrationsRework?: boolean;
multipleRoles?: boolean;
featureNamingPattern?: boolean;
doraMetrics?: boolean;
variantTypeNumber?: boolean;
[key: string]: boolean | Variant | undefined;
};
export interface IVersionInfo {
instanceId: string;
isLatest: boolean;
latest: Partial<IVersion>;
current: IVersion;
}
export interface IVersion {
oss: string;
enterprise: string;
}
export interface ILinks {
value: string;
icon: ReactNode;
href: string;
title: string;
}