mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
Fixes issue where wrong property was checked for deployment type (#10933)
* Fixes issue where wrong property was checked for deployment type * improve error message
This commit is contained in:
@@ -87,6 +87,7 @@ export const databaseNameRequired = localize('databaseNameRequired', "Database n
|
|||||||
export const invalidDataSchemaProvider = localize('invalidDataSchemaProvider', "Invalid DSP in .sqlproj file");
|
export const invalidDataSchemaProvider = localize('invalidDataSchemaProvider', "Invalid DSP in .sqlproj file");
|
||||||
export const invalidDatabaseReference = localize('invalidDatabaseReference', "Invalid database reference in .sqlproj file");
|
export const invalidDatabaseReference = localize('invalidDatabaseReference', "Invalid database reference in .sqlproj file");
|
||||||
export const databaseSelectionRequired = localize('databaseSelectionRequired', "Database selection is required to import a project");
|
export const databaseSelectionRequired = localize('databaseSelectionRequired', "Database selection is required to import a project");
|
||||||
|
export const unableToCreateDeploymentConnection = localize('unableToCreateDeploymentConnection', "Unable to construct connection");
|
||||||
export function projectAlreadyOpened(path: string) { return localize('projectAlreadyOpened', "Project '{0}' is already opened.", path); }
|
export function projectAlreadyOpened(path: string) { return localize('projectAlreadyOpened', "Project '{0}' is already opened.", path); }
|
||||||
export function projectAlreadyExists(name: string, path: string) { return localize('projectAlreadyExists', "A project named {0} already exists in {1}.", name, path); }
|
export function projectAlreadyExists(name: string, path: string) { return localize('projectAlreadyExists', "A project named {0} already exists in {1}.", name, path); }
|
||||||
export function noFileExist(fileName: string) { return localize('noFileExist', "File {0} doesn't exist", fileName); }
|
export function noFileExist(fileName: string) { return localize('noFileExist', "File {0} doesn't exist", fileName); }
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
import * as azdata from 'azdata';
|
import * as azdata from 'azdata';
|
||||||
import * as vscode from 'vscode';
|
import * as vscode from 'vscode';
|
||||||
import * as constants from '../common/constants';
|
import * as constants from '../common/constants';
|
||||||
|
import * as utils from '../common/utils';
|
||||||
|
|
||||||
import { Project } from '../models/project';
|
import { Project } from '../models/project';
|
||||||
import { SqlConnectionDataSource } from '../models/dataSources/sqlConnectionStringSource';
|
import { SqlConnectionDataSource } from '../models/dataSources/sqlConnectionStringSource';
|
||||||
@@ -115,10 +116,11 @@ export class DeployDatabaseDialog {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public async getConnectionUri(): Promise<string> {
|
public async getConnectionUri(): Promise<string> {
|
||||||
|
try {
|
||||||
// if target connection is a data source, have to check if already connected or if connection dialog needs to be opened
|
// if target connection is a data source, have to check if already connected or if connection dialog needs to be opened
|
||||||
let connId: string;
|
let connId: string;
|
||||||
|
|
||||||
if (this.dataSourcesRadioButton?.checked) {
|
if (this.connectionIsDataSource) {
|
||||||
const dataSource = (this.dataSourcesDropDown!.value! as DataSourceDropdownValue).dataSource;
|
const dataSource = (this.dataSourcesDropDown!.value! as DataSourceDropdownValue).dataSource;
|
||||||
|
|
||||||
const connProfile: azdata.IConnectionProfile = {
|
const connProfile: azdata.IConnectionProfile = {
|
||||||
@@ -152,6 +154,10 @@ export class DeployDatabaseDialog {
|
|||||||
|
|
||||||
return await this.apiWrapper.getUriForConnection(connId);
|
return await this.apiWrapper.getUriForConnection(connId);
|
||||||
}
|
}
|
||||||
|
catch (err) {
|
||||||
|
throw new Error(constants.unableToCreateDeploymentConnection + ': ' + utils.getErrorMessage(err));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public async deployClick(): Promise<void> {
|
public async deployClick(): Promise<void> {
|
||||||
const profile: IDeploymentProfile = {
|
const profile: IDeploymentProfile = {
|
||||||
|
|||||||
Reference in New Issue
Block a user