mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-16 09:35:36 -05:00
Remove ApiWrapper from sql-database-projects (#11345)
* Remove ApiWrapper * fix compile error * Use .resolves * Check error messages * Check for not called * FIx global beforeEach/afterEach
This commit is contained in:
@@ -10,7 +10,6 @@ import * as utils from '../common/utils';
|
||||
|
||||
import { Project } from '../models/project';
|
||||
import { SqlConnectionDataSource } from '../models/dataSources/sqlConnectionStringSource';
|
||||
import { ApiWrapper } from '../common/apiWrapper';
|
||||
import { IPublishSettings, IGenerateScriptSettings } from '../models/IPublishSettings';
|
||||
|
||||
interface DataSourceDropdownValue extends azdata.CategoryValue {
|
||||
@@ -42,7 +41,7 @@ export class PublishDatabaseDialog {
|
||||
public generateScript: ((proj: Project, profile: IGenerateScriptSettings) => any) | undefined;
|
||||
public readPublishProfile: ((profileUri: vscode.Uri) => any) | undefined;
|
||||
|
||||
constructor(private apiWrapper: ApiWrapper, private project: Project) {
|
||||
constructor(private project: Project) {
|
||||
this.dialog = azdata.window.createModelViewDialog(constants.publishDialogName);
|
||||
this.publishTab = azdata.window.createTab(constants.publishDialogName);
|
||||
}
|
||||
@@ -172,10 +171,10 @@ export class PublishDatabaseDialog {
|
||||
};
|
||||
|
||||
if (dataSource.integratedSecurity) {
|
||||
connId = (await this.apiWrapper.connectionConnect(connProfile, false, false)).connectionId;
|
||||
connId = (await azdata.connection.connect(connProfile, false, false)).connectionId;
|
||||
}
|
||||
else {
|
||||
connId = (await this.apiWrapper.openConnectionDialog(undefined, connProfile)).connectionId;
|
||||
connId = (await azdata.connection.openConnectionDialog(undefined, connProfile)).connectionId;
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -186,7 +185,7 @@ export class PublishDatabaseDialog {
|
||||
connId = this.connection?.connectionId;
|
||||
}
|
||||
|
||||
return await this.apiWrapper.getUriForConnection(connId);
|
||||
return await azdata.connection.getUriForConnection(connId);
|
||||
}
|
||||
catch (err) {
|
||||
throw new Error(constants.unableToCreatePublishConnection + ': ' + utils.getErrorMessage(err));
|
||||
@@ -202,7 +201,7 @@ export class PublishDatabaseDialog {
|
||||
sqlCmdVariables: sqlCmdVars
|
||||
};
|
||||
|
||||
this.apiWrapper.closeDialog(this.dialog);
|
||||
azdata.window.closeDialog(this.dialog);
|
||||
await this.publish!(this.project, settings);
|
||||
|
||||
this.dispose();
|
||||
@@ -216,7 +215,7 @@ export class PublishDatabaseDialog {
|
||||
sqlCmdVariables: sqlCmdVars
|
||||
};
|
||||
|
||||
this.apiWrapper.closeDialog(this.dialog);
|
||||
azdata.window.closeDialog(this.dialog);
|
||||
|
||||
if (this.generateScript) {
|
||||
await this.generateScript!(this.project, settings);
|
||||
@@ -360,7 +359,7 @@ export class PublishDatabaseDialog {
|
||||
}).component();
|
||||
|
||||
editConnectionButton.onDidClick(async () => {
|
||||
this.connection = await this.apiWrapper.openConnectionDialog();
|
||||
this.connection = await azdata.connection.openConnectionDialog();
|
||||
|
||||
// show connection name if there is one, otherwise show connection string
|
||||
if (this.connection.options['connectionName']) {
|
||||
@@ -401,7 +400,7 @@ export class PublishDatabaseDialog {
|
||||
}).component();
|
||||
|
||||
loadProfileButton.onDidClick(async () => {
|
||||
const fileUris = await this.apiWrapper.showOpenDialog(
|
||||
const fileUris = await vscode.window.showOpenDialog(
|
||||
{
|
||||
canSelectFiles: true,
|
||||
canSelectFolders: false,
|
||||
|
||||
Reference in New Issue
Block a user