Skip to content

Commit

Permalink
UI Flags cleanup (#2778)
Browse files Browse the repository at this point in the history
  • Loading branch information
sjaanus committed Jan 2, 2023
1 parent c62d775 commit 8a8cd1b
Show file tree
Hide file tree
Showing 10 changed files with 5 additions and 27 deletions.
Expand Up @@ -24,7 +24,7 @@ export const useCreateFeaturePath = (
}

return {
path: getCreateTogglePath(projectId, uiConfig.flags.E),
path: getCreateTogglePath(projectId),
projectId,
};
};
Expand Up @@ -13,11 +13,9 @@ export const FeatureNotFound = () => {
const { classes: styles } = useStyles();
const { uiConfig } = useUiConfig();

const createFeatureTogglePath = getCreateTogglePath(
projectId,
uiConfig.flags.E,
{ name: featureId }
);
const createFeatureTogglePath = getCreateTogglePath(projectId, {
name: featureId,
});

if (!archivedFeatures) {
return null;
Expand Down
Expand Up @@ -517,12 +517,7 @@ export const ProjectFeatureToggles = ({
<PageHeader.Divider sx={{ marginLeft: 0 }} />
<ResponsiveButton
onClick={() =>
navigate(
getCreateTogglePath(
projectId,
uiConfig.flags.E
)
)
navigate(getCreateTogglePath(projectId))
}
maxWidth="960px"
Icon={Add}
Expand Down
2 changes: 0 additions & 2 deletions frontend/src/hooks/api/getters/useUiConfig/defaultValue.ts
Expand Up @@ -7,11 +7,9 @@ export const defaultValue: IUiConfig = {
slogan: 'The enterprise ready feature toggle service.',
flags: {
P: false,
C: false,
E: false,
RE: false,
EEA: false,
CO: false,
SE: false,
T: false,
UNLEASH_CLOUD: false,
Expand Down
4 changes: 0 additions & 4 deletions frontend/src/interfaces/uiConfig.ts
Expand Up @@ -29,20 +29,16 @@ export interface IProclamationToast {
}

export interface IFlags {
C: boolean;
P: boolean;
E: boolean;
RE: boolean;
EEA?: boolean;
OIDC?: boolean;
CO?: boolean;
SE?: boolean;
T?: boolean;
UNLEASH_CLOUD?: boolean;
UG?: boolean;
ENABLE_DARK_MODE_SUPPORT?: boolean;
embedProxyFrontend?: boolean;
changeRequests?: boolean;
variantsPerEnvironment?: boolean;
networkView?: boolean;
maintenance?: boolean;
Expand Down
1 change: 0 additions & 1 deletion frontend/src/utils/routePathHelpers.ts
Expand Up @@ -4,7 +4,6 @@ export const getTogglePath = (projectId: string, featureToggleName: string) => {

export const getCreateTogglePath = (
projectId: string,
newPath: boolean = false,
query?: Record<string, string>
) => {
const path = `/projects/${projectId}/create-toggle`;
Expand Down
2 changes: 0 additions & 2 deletions src/lib/__snapshots__/create-config.test.ts.snap
Expand Up @@ -71,7 +71,6 @@ exports[`should create default config 1`] = `
"ENABLE_DARK_MODE_SUPPORT": false,
"anonymiseEventLog": false,
"batchMetrics": false,
"changeRequests": false,
"embedProxy": true,
"embedProxyFrontend": true,
"maintenance": false,
Expand All @@ -90,7 +89,6 @@ exports[`should create default config 1`] = `
"ENABLE_DARK_MODE_SUPPORT": false,
"anonymiseEventLog": false,
"batchMetrics": false,
"changeRequests": false,
"embedProxy": true,
"embedProxyFrontend": true,
"maintenance": false,
Expand Down
4 changes: 0 additions & 4 deletions src/lib/types/experimental.ts
Expand Up @@ -11,10 +11,6 @@ const flags = {
process.env.UNLEASH_EXPERIMENTAL_EMBED_PROXY,
true,
),
changeRequests: parseEnvVarBoolean(
process.env.UNLEASH_EXPERIMENTAL_CHANGE_REQUESTS,
false,
),
embedProxyFrontend: parseEnvVarBoolean(
process.env.UNLEASH_EXPERIMENTAL_EMBED_PROXY_FRONTEND,
true,
Expand Down
1 change: 0 additions & 1 deletion src/server-dev.ts
Expand Up @@ -39,7 +39,6 @@ process.nextTick(async () => {
batchMetrics: true,
anonymiseEventLog: false,
responseTimeWithAppName: true,
changeRequests: true,
variantsPerEnvironment: true,
maintenance: false,
serviceAccounts: true,
Expand Down
1 change: 0 additions & 1 deletion src/test/config/test-config.ts
Expand Up @@ -27,7 +27,6 @@ export function createTestConfig(config?: IUnleashOptions): IUnleashConfig {
embedProxy: true,
embedProxyFrontend: true,
batchMetrics: true,
changeRequests: true,
variantsPerEnvironment: true,
},
},
Expand Down

0 comments on commit 8a8cd1b

Please sign in to comment.