diff --git a/src/sql/parts/notebook/notebook.component.ts b/src/sql/parts/notebook/notebook.component.ts index 4d0a52e5ce..a4d9ab9d5c 100644 --- a/src/sql/parts/notebook/notebook.component.ts +++ b/src/sql/parts/notebook/notebook.component.ts @@ -344,11 +344,10 @@ export class NotebookComponent extends AngularDisposable implements OnInit, OnDe attachSelectBoxStyler(kernelDropdown, this.themeService); let attachToContainer = document.createElement('div'); - let attachTodropdwon = new AttachToDropdown(attachToContainer, this.contextViewService, this.modelRegistered, + let attachToDropdown = new AttachToDropdown(attachToContainer, this.contextViewService, this.modelRegistered, this.connectionManagementService, this.connectionDialogService, this.notificationService, this.capabilitiesService); - attachTodropdwon.render(attachToContainer); - attachSelectBoxStyler(attachTodropdwon, this.themeService); - + attachToDropdown.render(attachToContainer); + attachSelectBoxStyler(attachToDropdown, this.themeService); let addCodeCellButton = new AddCellAction('notebook.AddCodeCell', localize('code', 'Code'), 'notebook-button icon-add'); addCodeCellButton.cellType = CellTypes.Code; diff --git a/src/sql/parts/notebook/notebookActions.ts b/src/sql/parts/notebook/notebookActions.ts index b546aba939..016183ba11 100644 --- a/src/sql/parts/notebook/notebookActions.ts +++ b/src/sql/parts/notebook/notebookActions.ts @@ -336,14 +336,14 @@ export class AttachToDropdown extends SelectBox { await this._connectionDialogService.openDialogAndWait(this._connectionManagementService, { connectionType: 1, providers: this.model.getApplicableConnectionProviderIds(this.model.clientSession.kernel.name) }).then(connection => { let attachToConnections = this.values; if (!connection) { - this.loadAttachToDropdown(this.model, this.model.clientSession.kernel.name); + this.loadAttachToDropdown(this.model, this.getKernelDisplayName()); return; } let connectionProfile = new ConnectionProfile(this._capabilitiesService, connection); let connectedServer = connectionProfile.serverName; //Check to see if the same server is already there in dropdown. We only have server names in dropdown if (attachToConnections.some(val => val === connectedServer)) { - this.loadAttachToDropdown(this.model, this.model.clientSession.kernel.name); + this.loadAttachToDropdown(this.model, this.getKernelDisplayName()); this.doChangeContext(); return; }