mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -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 pages: Map<number, ImportPage> = new Map<number, ImportPage>();
|
||||||
|
|
||||||
let connectionId = (await azdata.connection.getCurrentConnection())?.connectionId ??
|
let currentConnection = await azdata.connection.getCurrentConnection();
|
||||||
(await azdata.connection.openConnectionDialog())?.connectionId;
|
|
||||||
|
|
||||||
if (!connectionId) {
|
let connectionId: string;
|
||||||
vscode.window.showErrorMessage(localize('import.needConnection', "Please connect to a server before using this wizard."));
|
|
||||||
return;
|
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;
|
model.serverId = connectionId;
|
||||||
|
|
||||||
this.wizard = azdata.window.createWizard(localize('flatFileImport.wizardName', "Import flat file wizard"));
|
this.wizard = azdata.window.createWizard(localize('flatFileImport.wizardName', "Import flat file wizard"));
|
||||||
|
|||||||
Reference in New Issue
Block a user