mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 11:01:37 -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 {
|
} else {
|
||||||
this._onValidConnectionSelected.fire(false);
|
this._onValidConnectionSelected.fire(false);
|
||||||
throw new Error('No valid connection');
|
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
let msg = notebookUtils.getErrorMessage(err);
|
let msg = notebookUtils.getErrorMessage(err);
|
||||||
|
|||||||
@@ -387,8 +387,10 @@ export class AttachToDropdown extends SelectBox {
|
|||||||
this.selectWithOptionName(msgSelectConnection);
|
this.selectWithOptionName(msgSelectConnection);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
if (!connections.includes(msgAddNewConnection)) {
|
||||||
connections.push(msgAddNewConnection);
|
connections.push(msgAddNewConnection);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
this.setOptions(connections);
|
this.setOptions(connections);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -396,9 +398,13 @@ export class AttachToDropdown extends SelectBox {
|
|||||||
|
|
||||||
private loadWithSelectConnection(connections: string[]): string[] {
|
private loadWithSelectConnection(connections: string[]): string[] {
|
||||||
if (connections && connections.length > 0) {
|
if (connections && connections.length > 0) {
|
||||||
|
if (!connections.includes(msgSelectConnection)) {
|
||||||
connections.unshift(msgSelectConnection);
|
connections.unshift(msgSelectConnection);
|
||||||
|
}
|
||||||
this.selectWithOptionName(msgSelectConnection);
|
this.selectWithOptionName(msgSelectConnection);
|
||||||
|
if (!connections.includes(msgAddNewConnection)) {
|
||||||
connections.push(msgAddNewConnection);
|
connections.push(msgAddNewConnection);
|
||||||
|
}
|
||||||
this.setOptions(connections);
|
this.setOptions(connections);
|
||||||
}
|
}
|
||||||
return connections;
|
return connections;
|
||||||
@@ -470,7 +476,7 @@ export class AttachToDropdown extends SelectBox {
|
|||||||
}
|
}
|
||||||
let connectionUri = this._connectionManagementService.getConnectionUri(connection);
|
let connectionUri = this._connectionManagementService.getConnectionUri(connection);
|
||||||
let connectionProfile = new ConnectionProfile(this._capabilitiesService, 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
|
//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)) {
|
if (attachToConnections.some(val => val === connectedServer)) {
|
||||||
this.loadAttachToDropdown(this.model, this.getKernelDisplayName());
|
this.loadAttachToDropdown(this.model, this.getKernelDisplayName());
|
||||||
|
|||||||
Reference in New Issue
Block a user