mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-20 17:22:51 -05:00
Removed PG connections and the refresh button from the import wizard. (#10248)
* - Removed PG connections in the new connection wizard - If a PG database is active sending an error - Removed refresh button #6611 * Added back the refresh * -Using getConnection only once. * -Fixed the error message -Fixed the bugs mentioned in the PR Co-authored-by: Aasim Khan <aaskhan@microsoft.com>
This commit is contained in:
@@ -38,14 +38,25 @@ export class FlatFileWizard {
|
||||
|
||||
let pages: Map<number, ImportPage> = new Map<number, ImportPage>();
|
||||
|
||||
let connectionId = (await azdata.connection.getCurrentConnection())?.connectionId ??
|
||||
(await azdata.connection.openConnectionDialog())?.connectionId;
|
||||
let currentConnection = await azdata.connection.getCurrentConnection();
|
||||
|
||||
if (!connectionId) {
|
||||
vscode.window.showErrorMessage(localize('import.needConnection', "Please connect to a server before using this wizard."));
|
||||
return;
|
||||
let connectionId: string;
|
||||
|
||||
if (!currentConnection) {
|
||||
connectionId = (await azdata.connection.openConnectionDialog(['MSSQL'])).connectionId;
|
||||
if (!connectionId) {
|
||||
vscode.window.showErrorMessage(localize('import.needConnection', "Please connect to a server before using this wizard."));
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
if (currentConnection.providerId !== 'MSSQL') {
|
||||
vscode.window.showErrorMessage(localize('import.needSQLConnection', "SQL Server Import extension does not support this type of connection"));
|
||||
return;
|
||||
}
|
||||
connectionId = currentConnection.connectionId;
|
||||
}
|
||||
|
||||
|
||||
model.serverId = connectionId;
|
||||
|
||||
this.wizard = azdata.window.createWizard(localize('flatFileImport.wizardName', "Import flat file wizard"));
|
||||
|
||||
Reference in New Issue
Block a user