mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-26 09:35:38 -05:00
Change the wizard setup (#8845)
This commit is contained in:
@@ -2,8 +2,6 @@
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import * as vscode from 'vscode';
|
||||
import * as nls from 'vscode-nls';
|
||||
import * as azdata from 'azdata';
|
||||
@@ -29,9 +27,9 @@ export class FlatFileWizard {
|
||||
}
|
||||
|
||||
public async start(p: any, ...args: any[]) {
|
||||
let model = <ImportDataModel>{};
|
||||
let model = {} as ImportDataModel;
|
||||
|
||||
let profile = p ? <azdata.IConnectionProfile>p.connectionProfile : null;
|
||||
let profile = p?.connectionProfile as azdata.IConnectionProfile;
|
||||
if (profile) {
|
||||
model.serverId = profile.id;
|
||||
model.database = profile.databaseName;
|
||||
@@ -39,15 +37,15 @@ 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 connections = await azdata.connection.getActiveConnections();
|
||||
if (!connections || connections.length === 0) {
|
||||
if (!connectionId) {
|
||||
vscode.window.showErrorMessage(localize('import.needConnection', "Please connect to a server before using this wizard."));
|
||||
return;
|
||||
}
|
||||
|
||||
let currentConnection = await azdata.connection.getCurrentConnection();
|
||||
model.serverId = currentConnection.connectionId;
|
||||
model.serverId = connectionId;
|
||||
|
||||
this.wizard = azdata.window.createWizard(localize('flatFileImport.wizardName', "Import flat file wizard"));
|
||||
let page1 = azdata.window.createWizardPage(localize('flatFileImport.page1Name', "Specify Input File"));
|
||||
|
||||
Reference in New Issue
Block a user