mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-23 09:35:39 -05:00
Update publish dialog UI (#11996)
* change svgs * change label to server and get rid of connection string * fix user for windows auth * move blue icons out of dark and light folders
This commit is contained in:
@@ -17,7 +17,7 @@ import { SqlConnectionDataSource } from '../dataSources/sqlConnectionStringSourc
|
||||
export interface PublishProfile {
|
||||
databaseName: string;
|
||||
connectionId: string;
|
||||
connectionString: string;
|
||||
connection: string;
|
||||
sqlCmdVariables: Record<string, string>;
|
||||
options?: mssql.DeploymentOptions;
|
||||
}
|
||||
@@ -46,38 +46,46 @@ export async function load(profileUri: Uri, dacfxService: mssql.IDacFxService):
|
||||
return {
|
||||
databaseName: targetDbName,
|
||||
connectionId: connectionInfo.connectionId,
|
||||
connectionString: connectionInfo.connectionString,
|
||||
connection: connectionInfo.connection,
|
||||
sqlCmdVariables: sqlCmdVariables,
|
||||
options: optionsResult.deploymentOptions
|
||||
};
|
||||
}
|
||||
|
||||
async function readConnectionString(xmlDoc: any): Promise<{ connectionId: string, connectionString: string }> {
|
||||
let targetConnectionString: string = '';
|
||||
async function readConnectionString(xmlDoc: any): Promise<{ connectionId: string, connection: string }> {
|
||||
let targetConnection: string = '';
|
||||
let connId: string = '';
|
||||
|
||||
if (xmlDoc.documentElement.getElementsByTagName(constants.targetConnectionString).length > 0) {
|
||||
targetConnectionString = xmlDoc.documentElement.getElementsByTagName(constants.TargetConnectionString)[0].textContent;
|
||||
const targetConnectionString = xmlDoc.documentElement.getElementsByTagName(constants.TargetConnectionString)[0].textContent;
|
||||
const dataSource = new SqlConnectionDataSource('temp', targetConnectionString);
|
||||
let server: string = '';
|
||||
let username: string = '';
|
||||
const connectionProfile = dataSource.getConnectionProfile();
|
||||
|
||||
try {
|
||||
if (dataSource.integratedSecurity) {
|
||||
connId = (await azdata.connection.connect(connectionProfile, false, false)).connectionId;
|
||||
const connection = await azdata.connection.connect(connectionProfile, false, false);
|
||||
connId = connection.connectionId;
|
||||
server = dataSource.server;
|
||||
username = constants.defaultUser;
|
||||
}
|
||||
else {
|
||||
connId = (await azdata.connection.openConnectionDialog(undefined, connectionProfile)).connectionId;
|
||||
const connection = await azdata.connection.openConnectionDialog(undefined, connectionProfile);
|
||||
connId = connection.connectionId;
|
||||
server = connection.options['server'];
|
||||
username = connection.options['username'];
|
||||
}
|
||||
|
||||
targetConnection = `${server} (${username})`;
|
||||
} catch (err) {
|
||||
throw new Error(constants.unableToCreatePublishConnection(utils.getErrorMessage(err)));
|
||||
}
|
||||
}
|
||||
|
||||
// mask password in connection string
|
||||
targetConnectionString = await azdata.connection.getConnectionString(connId, false);
|
||||
|
||||
return {
|
||||
connectionId: connId,
|
||||
connectionString: targetConnectionString
|
||||
connection: targetConnection
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user