mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Fixed cancel connectionDialog from attach to shows dup "select connection" (#4865)
This commit is contained in:
@@ -668,7 +668,6 @@ export class NotebookModel extends Disposable implements INotebookModel {
|
||||
});
|
||||
} else {
|
||||
this._onValidConnectionSelected.fire(false);
|
||||
throw new Error('No valid connection');
|
||||
}
|
||||
} catch (err) {
|
||||
let msg = notebookUtils.getErrorMessage(err);
|
||||
|
||||
@@ -387,7 +387,9 @@ export class AttachToDropdown extends SelectBox {
|
||||
this.selectWithOptionName(msgSelectConnection);
|
||||
}
|
||||
else {
|
||||
connections.push(msgAddNewConnection);
|
||||
if (!connections.includes(msgAddNewConnection)) {
|
||||
connections.push(msgAddNewConnection);
|
||||
}
|
||||
}
|
||||
this.setOptions(connections);
|
||||
}
|
||||
@@ -396,9 +398,13 @@ export class AttachToDropdown extends SelectBox {
|
||||
|
||||
private loadWithSelectConnection(connections: string[]): string[] {
|
||||
if (connections && connections.length > 0) {
|
||||
connections.unshift(msgSelectConnection);
|
||||
if (!connections.includes(msgSelectConnection)) {
|
||||
connections.unshift(msgSelectConnection);
|
||||
}
|
||||
this.selectWithOptionName(msgSelectConnection);
|
||||
connections.push(msgAddNewConnection);
|
||||
if (!connections.includes(msgAddNewConnection)) {
|
||||
connections.push(msgAddNewConnection);
|
||||
}
|
||||
this.setOptions(connections);
|
||||
}
|
||||
return connections;
|
||||
@@ -470,7 +476,7 @@ export class AttachToDropdown extends SelectBox {
|
||||
}
|
||||
let connectionUri = this._connectionManagementService.getConnectionUri(connection);
|
||||
let connectionProfile = new ConnectionProfile(this._capabilitiesService, connection);
|
||||
let connectedServer = connectionProfile.title? connectionProfile.title : connectionProfile.serverName;
|
||||
let connectedServer = connectionProfile.title ? connectionProfile.title : 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.getKernelDisplayName());
|
||||
|
||||
Reference in New Issue
Block a user