1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-08-04 13:48:56 +02:00

UI Flags cleanup (#2778)

This commit is contained in:
sjaanus 2023-01-02 15:41:43 +02:00 committed by GitHub
parent c62d775933
commit 8a8cd1bf27
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 5 additions and 27 deletions

View File

@ -24,7 +24,7 @@ export const useCreateFeaturePath = (
} }
return { return {
path: getCreateTogglePath(projectId, uiConfig.flags.E), path: getCreateTogglePath(projectId),
projectId, projectId,
}; };
}; };

View File

@ -13,11 +13,9 @@ export const FeatureNotFound = () => {
const { classes: styles } = useStyles(); const { classes: styles } = useStyles();
const { uiConfig } = useUiConfig(); const { uiConfig } = useUiConfig();
const createFeatureTogglePath = getCreateTogglePath( const createFeatureTogglePath = getCreateTogglePath(projectId, {
projectId, name: featureId,
uiConfig.flags.E, });
{ name: featureId }
);
if (!archivedFeatures) { if (!archivedFeatures) {
return null; return null;

View File

@ -517,12 +517,7 @@ export const ProjectFeatureToggles = ({
<PageHeader.Divider sx={{ marginLeft: 0 }} /> <PageHeader.Divider sx={{ marginLeft: 0 }} />
<ResponsiveButton <ResponsiveButton
onClick={() => onClick={() =>
navigate( navigate(getCreateTogglePath(projectId))
getCreateTogglePath(
projectId,
uiConfig.flags.E
)
)
} }
maxWidth="960px" maxWidth="960px"
Icon={Add} Icon={Add}

View File

@ -7,11 +7,9 @@ export const defaultValue: IUiConfig = {
slogan: 'The enterprise ready feature toggle service.', slogan: 'The enterprise ready feature toggle service.',
flags: { flags: {
P: false, P: false,
C: false,
E: false, E: false,
RE: false, RE: false,
EEA: false, EEA: false,
CO: false,
SE: false, SE: false,
T: false, T: false,
UNLEASH_CLOUD: false, UNLEASH_CLOUD: false,

View File

@ -29,20 +29,16 @@ export interface IProclamationToast {
} }
export interface IFlags { export interface IFlags {
C: boolean;
P: boolean; P: boolean;
E: boolean; E: boolean;
RE: boolean; RE: boolean;
EEA?: boolean; EEA?: boolean;
OIDC?: boolean;
CO?: boolean;
SE?: boolean; SE?: boolean;
T?: boolean; T?: boolean;
UNLEASH_CLOUD?: boolean; UNLEASH_CLOUD?: boolean;
UG?: boolean; UG?: boolean;
ENABLE_DARK_MODE_SUPPORT?: boolean; ENABLE_DARK_MODE_SUPPORT?: boolean;
embedProxyFrontend?: boolean; embedProxyFrontend?: boolean;
changeRequests?: boolean;
variantsPerEnvironment?: boolean; variantsPerEnvironment?: boolean;
networkView?: boolean; networkView?: boolean;
maintenance?: boolean; maintenance?: boolean;

View File

@ -4,7 +4,6 @@ export const getTogglePath = (projectId: string, featureToggleName: string) => {
export const getCreateTogglePath = ( export const getCreateTogglePath = (
projectId: string, projectId: string,
newPath: boolean = false,
query?: Record<string, string> query?: Record<string, string>
) => { ) => {
const path = `/projects/${projectId}/create-toggle`; const path = `/projects/${projectId}/create-toggle`;

View File

@ -71,7 +71,6 @@ exports[`should create default config 1`] = `
"ENABLE_DARK_MODE_SUPPORT": false, "ENABLE_DARK_MODE_SUPPORT": false,
"anonymiseEventLog": false, "anonymiseEventLog": false,
"batchMetrics": false, "batchMetrics": false,
"changeRequests": false,
"embedProxy": true, "embedProxy": true,
"embedProxyFrontend": true, "embedProxyFrontend": true,
"maintenance": false, "maintenance": false,
@ -90,7 +89,6 @@ exports[`should create default config 1`] = `
"ENABLE_DARK_MODE_SUPPORT": false, "ENABLE_DARK_MODE_SUPPORT": false,
"anonymiseEventLog": false, "anonymiseEventLog": false,
"batchMetrics": false, "batchMetrics": false,
"changeRequests": false,
"embedProxy": true, "embedProxy": true,
"embedProxyFrontend": true, "embedProxyFrontend": true,
"maintenance": false, "maintenance": false,

View File

@ -11,10 +11,6 @@ const flags = {
process.env.UNLEASH_EXPERIMENTAL_EMBED_PROXY, process.env.UNLEASH_EXPERIMENTAL_EMBED_PROXY,
true, true,
), ),
changeRequests: parseEnvVarBoolean(
process.env.UNLEASH_EXPERIMENTAL_CHANGE_REQUESTS,
false,
),
embedProxyFrontend: parseEnvVarBoolean( embedProxyFrontend: parseEnvVarBoolean(
process.env.UNLEASH_EXPERIMENTAL_EMBED_PROXY_FRONTEND, process.env.UNLEASH_EXPERIMENTAL_EMBED_PROXY_FRONTEND,
true, true,

View File

@ -39,7 +39,6 @@ process.nextTick(async () => {
batchMetrics: true, batchMetrics: true,
anonymiseEventLog: false, anonymiseEventLog: false,
responseTimeWithAppName: true, responseTimeWithAppName: true,
changeRequests: true,
variantsPerEnvironment: true, variantsPerEnvironment: true,
maintenance: false, maintenance: false,
serviceAccounts: true, serviceAccounts: true,

View File

@ -27,7 +27,6 @@ export function createTestConfig(config?: IUnleashOptions): IUnleashConfig {
embedProxy: true, embedProxy: true,
embedProxyFrontend: true, embedProxyFrontend: true,
batchMetrics: true, batchMetrics: true,
changeRequests: true,
variantsPerEnvironment: true, variantsPerEnvironment: true,
}, },
}, },