Skip to content

Commit

Permalink
move enableNewMultipleConnectionSystem from a feature flag to a prefe…
Browse files Browse the repository at this point in the history
…rence so it can be set to false in compass-web
  • Loading branch information
lerouxb committed Aug 20, 2024
1 parent 0c34596 commit a4b9c61
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
13 changes: 0 additions & 13 deletions packages/compass-preferences-model/src/feature-flags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ export type FeatureFlags = {
newExplainPlan: boolean;
showInsights: boolean;
enableRenameCollectionModal: boolean;
enableNewMultipleConnectionSystem: boolean;
enableQueryHistoryAutocomplete: boolean;
enableProxySupport: boolean;
};
Expand Down Expand Up @@ -64,18 +63,6 @@ export const featureFlags: Required<{
},
},

/**
* Feature flag for the new multiple connection UI.
* Epic: COMPASS-6410
*/
enableNewMultipleConnectionSystem: {
stage: 'released',
description: {
short: 'Enables support for multiple connections.',
long: 'Allows users to open multiple connections in the same window.',
},
},

/**
* Feature flag for adding query history items to the query bar autocompletion. COMPASS-8096
*/
Expand Down
16 changes: 15 additions & 1 deletion packages/compass-preferences-model/src/preferences-schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ export type UserConfigurablePreferences = PermanentFeatureFlags &
enablePerformanceAdvisorBanner: boolean;
maximumNumberOfActiveConnections?: number;
enableShowDialogOnQuit: boolean;
enableNewMultipleConnectionSystem: boolean;
enableProxySupport: boolean;
proxy: string;
};
Expand Down Expand Up @@ -213,7 +214,7 @@ const featureFlagsProps: Required<{
}> = Object.fromEntries(
Object.entries(featureFlags).map(([key, value]) => [
key as keyof FeatureFlags,
featureFlagToPreferenceDefinition(value),
featureFlagToPreferenceDefinition(key, value),
])
) as unknown as Required<{
[K in keyof FeatureFlags]: PreferenceDefinition<K>;
Expand Down Expand Up @@ -780,6 +781,18 @@ export const storedUserPreferencesProps: Required<{
type: 'boolean',
},

enableNewMultipleConnectionSystem: {
ui: true,
cli: true,
global: true,
description: {
short: 'Enables support for multiple connections.',
long: 'Allows users to open multiple connections in the same window.',
},
validator: z.boolean().default(true),
type: 'boolean',
},

proxy: {
ui: true,
cli: true,
Expand Down Expand Up @@ -1026,6 +1039,7 @@ function deriveReadOnlyOptionState<K extends keyof AllPreferences>(

// Helper to convert feature flag definitions to preference definitions
function featureFlagToPreferenceDefinition(
key: string,
featureFlag: FeatureFlagDefinition
): PreferenceDefinition<keyof FeatureFlags> {
return {
Expand Down

0 comments on commit a4b9c61

Please sign in to comment.