From 271fe6234437a3ac86d2f7cb67f13558a8dd8fd9 Mon Sep 17 00:00:00 2001 From: Justin M <63619224+JustinMDotNet@users.noreply.github.com> Date: Mon, 16 Nov 2020 11:27:09 -0800 Subject: [PATCH] 12567 Fixed Notebooks not adding to recent connections (#13113) * 12567 Changed tryAddActiveConnection to always add recent connection * 12567 Reverted change to tryAddActiveConnection. Removed this._params.input from connectionDialogService > createModel * 12567 Simplified conditional in connectionDialogService --- src/sql/workbench/contrib/notebook/browser/notebookActions.ts | 2 +- .../services/connection/browser/connectionDialogService.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sql/workbench/contrib/notebook/browser/notebookActions.ts b/src/sql/workbench/contrib/notebook/browser/notebookActions.ts index 71c302cc1f..382407bf23 100644 --- a/src/sql/workbench/contrib/notebook/browser/notebookActions.ts +++ b/src/sql/workbench/contrib/notebook/browser/notebookActions.ts @@ -480,7 +480,7 @@ export class AttachToDropdown extends SelectBox { } let connection = await this._connectionDialogService.openDialogAndWait(this._connectionManagementService, { - connectionType: ConnectionType.temporary, + connectionType: ConnectionType.editor, providers: providers }, useProfile ? this.model.connectionProfile : undefined); diff --git a/src/sql/workbench/services/connection/browser/connectionDialogService.ts b/src/sql/workbench/services/connection/browser/connectionDialogService.ts index b256edff42..f3feddd44f 100644 --- a/src/sql/workbench/services/connection/browser/connectionDialogService.ts +++ b/src/sql/workbench/services/connection/browser/connectionDialogService.ts @@ -381,7 +381,7 @@ export class ConnectionDialogService implements IConnectionDialogService { newProfile.saveProfile = true; newProfile.generateNewId(); // If connecting from a query editor set "save connection" to false - if (this._params && this._params.input && this._params.connectionType === ConnectionType.editor) { + if (this._params?.connectionType === ConnectionType.editor) { newProfile.saveProfile = false; } return newProfile;