Fix importing new project from server dashboard (#11766)

* fix importing new project from server dashboard

* also fix not showing list of dbs if the connection from connection dialog already specified the db
This commit is contained in:
Kim Santiago
2020-08-11 18:08:13 -07:00
committed by GitHub
parent 207a9a6a25
commit 86a019842f

View File

@@ -689,19 +689,19 @@ export class ProjectsController {
if (connection.options['database']) {
database = connection.options['database'];
}
}
// choose database if connection was to a server or master
if (!model.database || model.database === constants.master) {
const databaseList = await azdata.connection.listDatabases(connectionId);
database = (await vscode.window.showQuickPick(databaseList.map(dbName => { return { label: dbName }; }),
{
canPickMany: false,
placeHolder: constants.extractDatabaseSelection
}))?.label;
// choose database if connection was to a server or master
if (!database || database === constants.master) {
const databaseList = await azdata.connection.listDatabases(connectionId);
database = (await vscode.window.showQuickPick(databaseList.map(dbName => { return { label: dbName }; }),
{
canPickMany: false,
placeHolder: constants.extractDatabaseSelection
}))?.label;
if (!database) {
throw new Error(constants.databaseSelectionRequired);
}
if (!database) {
throw new Error(constants.databaseSelectionRequired);
}
}