mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Change the wizard setup (#8845)
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
"name": "import",
|
"name": "import",
|
||||||
"displayName": "SQL Server Import",
|
"displayName": "SQL Server Import",
|
||||||
"description": "SQL Server Import for Azure Data Studio supports importing CSV or JSON files into SQL Server.",
|
"description": "SQL Server Import for Azure Data Studio supports importing CSV or JSON files into SQL Server.",
|
||||||
"version": "0.12.0",
|
"version": "0.13.0",
|
||||||
"publisher": "Microsoft",
|
"publisher": "Microsoft",
|
||||||
"preview": true,
|
"preview": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||||
*--------------------------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------------------------*/
|
||||||
'use strict';
|
|
||||||
|
|
||||||
import * as vscode from 'vscode';
|
import * as vscode from 'vscode';
|
||||||
import * as nls from 'vscode-nls';
|
import * as nls from 'vscode-nls';
|
||||||
import * as azdata from 'azdata';
|
import * as azdata from 'azdata';
|
||||||
@@ -29,9 +27,9 @@ export class FlatFileWizard {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public async start(p: any, ...args: any[]) {
|
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) {
|
if (profile) {
|
||||||
model.serverId = profile.id;
|
model.serverId = profile.id;
|
||||||
model.database = profile.databaseName;
|
model.database = profile.databaseName;
|
||||||
@@ -39,15 +37,15 @@ 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 ??
|
||||||
|
(await azdata.connection.openConnectionDialog())?.connectionId;
|
||||||
|
|
||||||
let connections = await azdata.connection.getActiveConnections();
|
if (!connectionId) {
|
||||||
if (!connections || connections.length === 0) {
|
|
||||||
vscode.window.showErrorMessage(localize('import.needConnection', "Please connect to a server before using this wizard."));
|
vscode.window.showErrorMessage(localize('import.needConnection', "Please connect to a server before using this wizard."));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let currentConnection = await azdata.connection.getCurrentConnection();
|
model.serverId = connectionId;
|
||||||
model.serverId = currentConnection.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"));
|
||||||
let page1 = azdata.window.createWizardPage(localize('flatFileImport.page1Name', "Specify Input File"));
|
let page1 = azdata.window.createWizardPage(localize('flatFileImport.page1Name', "Specify Input File"));
|
||||||
|
|||||||
Reference in New Issue
Block a user