Use connection Id from result for fetching database list (#24017)

This commit is contained in:
Cheena Malhotra
2023-07-31 10:23:22 -07:00
committed by GitHub
parent 5b70fd1afe
commit 77ac63741f
4 changed files with 45 additions and 7 deletions

View File

@@ -64,7 +64,12 @@ export class CreateProjectFromDatabaseDialog {
if (!result.connected) {
// if can't connect automatically, open connection dialog with the info from the profile
const connection = await getAzdataApi()!.connection.openConnectionDialog(undefined, this.profile);
const connection = await getAzdataApi()!.connection.openConnectionDialog(undefined, this.profile, {
saveConnection: false,
showDashboard: false,
showConnectionDialogOnError: true,
showFirewallRuleOnError: true
});
connected = !!connection;
// update these fields if connection was successful, to ensure they match the connection made
@@ -74,6 +79,9 @@ export class CreateProjectFromDatabaseDialog {
this.profile.serverName = connection.options['server'];
this.profile.userName = connection.options['user'];
}
} else {
// Successfully connectted, update connection Id as received.
this.profile.id = result.connectionId!;
}
}
}
@@ -248,7 +256,12 @@ export class CreateProjectFromDatabaseDialog {
}).component();
this.selectConnectionButton.onDidClick(async () => {
let connection = await getAzdataApi()!.connection.openConnectionDialog();
let connection = await getAzdataApi()!.connection.openConnectionDialog(undefined, undefined, {
saveConnection: false,
showDashboard: false,
showConnectionDialogOnError: true,
showFirewallRuleOnError: true
});
this.connectionId = connection.connectionId;
let connectionTextboxValue: string;

View File

@@ -214,7 +214,12 @@ export class PublishDatabaseDialog {
connId = connResult.connectionId!;
}
else {
connId = (await utils.getAzdataApi()!.connection.openConnectionDialog(undefined, connProfile)).connectionId;
connId = (await utils.getAzdataApi()!.connection.openConnectionDialog(undefined, connProfile, {
saveConnection: false,
showDashboard: false,
showConnectionDialogOnError: true,
showFirewallRuleOnError: true
})).connectionId;
}
}
else {
@@ -742,7 +747,12 @@ export class PublishDatabaseDialog {
}).component();
this.selectConnectionButton.onDidClick(async () => {
let connection = await utils.getAzdataApi()!.connection.openConnectionDialog();
let connection = await utils.getAzdataApi()!.connection.openConnectionDialog(undefined, undefined, {
saveConnection: false,
showDashboard: false,
showConnectionDialogOnError: true,
showFirewallRuleOnError: true
});
this.connectionId = connection.connectionId;
this.serverName = connection.options['server'];

View File

@@ -365,7 +365,12 @@ export class UpdateProjectFromDatabaseDialog {
}
private async connectionButtonClick() {
let connection = await getAzdataApi()!.connection.openConnectionDialog();
let connection = await getAzdataApi()!.connection.openConnectionDialog(undefined, undefined, {
saveConnection: false,
showDashboard: false,
showConnectionDialogOnError: true,
showFirewallRuleOnError: true
});
if (connection) {
this.connectionId = connection.connectionId;
await this.populateServerDropdown();

View File

@@ -94,7 +94,12 @@ async function readConnectionString(xmlDoc: any): Promise<{ connectionId: string
if (azdataApi) {
const connectionResult = await utils.getAzdataApi()!.connection.connect(connectionProfile, false, false);
if (!connectionResult.connected) {
const connection = await utils.getAzdataApi()!.connection.openConnectionDialog(undefined, connectionProfile);
const connection = await utils.getAzdataApi()!.connection.openConnectionDialog(undefined, connectionProfile, {
saveConnection: false,
showDashboard: false,
showConnectionDialogOnError: true,
showFirewallRuleOnError: true
});
connId = connection.connectionId;
} else {
connId = connectionResult.connectionId!;
@@ -107,7 +112,12 @@ async function readConnectionString(xmlDoc: any): Promise<{ connectionId: string
}
else {
if (azdataApi) {
const connection = await utils.getAzdataApi()!.connection.openConnectionDialog(undefined, connectionProfile);
const connection = await utils.getAzdataApi()!.connection.openConnectionDialog(undefined, connectionProfile, {
saveConnection: false,
showDashboard: false,
showConnectionDialogOnError: true,
showFirewallRuleOnError: true
});
connId = connection.connectionId;
server = connection.options['server'];
username = connection.options['user'];