Skip to content

Commit

Permalink
[Gitar] Updating TypeScript files
Browse files Browse the repository at this point in the history
  • Loading branch information
Gitar committed Aug 19, 2024
1 parent 662c7ab commit 155d7c6
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 22 deletions.
1 change: 0 additions & 1 deletion frontend/src/interfaces/uiConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ export type UiFlags = {
UNLEASH_CLOUD?: boolean;
UG?: boolean;
embedProxyFrontend?: boolean;
maintenanceMode?: boolean;
messageBanner?: Variant;
banner?: Variant;
featuresExportImport?: boolean;
Expand Down
1 change: 0 additions & 1 deletion src/lib/__snapshots__/create-config.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ exports[`should create default config 1`] = `
"integrationEvents": false,
"killInsightsUI": false,
"killScheduledChangeRequestCache": false,
"maintenanceMode": false,
"manyStrategiesPagination": false,
"messageBanner": {
"enabled": false,
Expand Down
5 changes: 1 addition & 4 deletions src/lib/features/maintenance/maintenance-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,7 @@ export default class MaintenanceService implements IMaintenanceStatus {

async isMaintenanceMode(): Promise<boolean> {
try {
return (
this.config.flagResolver.isEnabled('maintenanceMode') ||
(await this.resolveMaintenance())
);
return await this.resolveMaintenance();
} catch (e) {
this.logger.warn('Error checking maintenance mode', e);
return false;
Expand Down
5 changes: 0 additions & 5 deletions src/lib/openapi/spec/ui-config-schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,6 @@ export const uiConfigSchema = {
description: 'Whether this instance can send out emails or not.',
example: true,
},
maintenanceMode: {
type: 'boolean',
description: 'Whether maintenance mode is currently active or not.',
example: false,
},
segmentValuesLimit: {
type: 'number',
description:
Expand Down
5 changes: 0 additions & 5 deletions src/lib/types/experimental.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ export type IFlagKey =
| 'embedProxy'
| 'embedProxyFrontend'
| 'responseTimeWithAppNameKillSwitch'
| 'maintenanceMode'
| 'messageBanner'
| 'featuresExportImport'
| 'caseInsensitiveInOperators'
Expand Down Expand Up @@ -87,10 +86,6 @@ const flags: IFlags = {
process.env.UNLEASH_RESPONSE_TIME_WITH_APP_NAME_KILL_SWITCH,
false,
),
maintenanceMode: parseEnvVarBoolean(
process.env.UNLEASH_EXPERIMENTAL_MAINTENANCE_MODE,
false,
),
messageBanner: {
name: 'message-banner',
enabled: parseEnvVarBoolean(
Expand Down
8 changes: 2 additions & 6 deletions src/test/e2e/api/admin/maintenance.e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ afterAll(async () => {
test('should not allow to create feature flags in maintenance mode', async () => {
const appWithMaintenanceMode = await setupAppWithCustomConfig(db.stores, {
experimental: {
flags: {
maintenanceMode: true,
},
flags: {},
},
});

Expand Down Expand Up @@ -68,9 +66,7 @@ test('should go into maintenance mode, when user has set it', async () => {
test('maintenance mode flag should take precedence over maintenance mode setting', async () => {
const appWithMaintenanceMode = await setupAppWithCustomConfig(db.stores, {
experimental: {
flags: {
maintenanceMode: true,
},
flags: {},
},
});

Expand Down

0 comments on commit 155d7c6

Please sign in to comment.