Skip to content

Commit

Permalink
refactor(connection-form)!: use a simpler parameter for differentiati…
Browse files Browse the repository at this point in the history
…ng Atlas and non-Atlas connections (#6773)

Since `adjustConnectionOptionsBeforeConnect` is used in places like VSCode where we may not have the same concept of atlasMetadata, it is better for us to be more direct with our parameters and simply ask for `isAtlas`.
  • Loading branch information
gagik authored Mar 5, 2025
1 parent dad404d commit 3c0f5bb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1554,7 +1554,10 @@ const connectWithOptions = (
cloneDeep(connectionOptions),
SecretsForConnection.get(connectionInfo.id) ?? {}
),
connectionInfo,
connectionInfo: {
id: connectionInfo.id,
isAtlas: !!connectionInfo.atlasMetadata,
},
defaultAppName: appName,
preferences: {
forceConnectionOptions: forceConnectionOptions ?? [],
Expand Down
7 changes: 5 additions & 2 deletions packages/connection-form/src/hooks/use-connect-form.ts
Original file line number Diff line number Diff line change
Expand Up @@ -849,7 +849,10 @@ export function adjustConnectionOptionsBeforeConnect({
preferences,
}: {
connectionOptions: Readonly<ConnectionOptions>;
connectionInfo: Readonly<Pick<ConnectionInfo, 'id' | 'atlasMetadata'>>;
connectionInfo: {
id: string;
isAtlas: boolean;
};
defaultAppName?: string;
notifyDeviceFlow?: (deviceFlowInformation: {
verificationUrl: string;
Expand All @@ -869,7 +872,7 @@ export function adjustConnectionOptionsBeforeConnect({
setAppNameParamIfMissing({
defaultAppName,
connectionId: connectionInfo.id,
isAtlas: !!connectionInfo.atlasMetadata,
isAtlas: connectionInfo.isAtlas,
telemetryAnonymousId: preferences.telemetryAnonymousId,
}),
adjustOIDCConnectionOptionsBeforeConnect({
Expand Down

0 comments on commit 3c0f5bb

Please sign in to comment.