mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-16 17:22:29 -05:00
Create project from database UI dialog (#13179)
* UI hook up * Add tests * Add back the missing statement for opening project * Fix failures * Add a few more tests * Fix test failure * Addressed comments * Update UI to match the mocks * Update UI to match updated mockups * Addressed comments to match UI with mockup * Updated all import strings to be called as Create Project From Database strings * Fix a couple of test failures and one comment addressed * Update one missed import string * Skipping a failing test for now * Fix failures. Fix alignment of icons * Addressed PR comments * Addressed couple more PR comments
This commit is contained in:
26
extensions/sql-database-projects/src/dialogs/utils.ts
Normal file
26
extensions/sql-database-projects/src/dialogs/utils.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as constants from '../common/constants';
|
||||
|
||||
/**
|
||||
* Gets connection name from connection object if there is one,
|
||||
* otherwise set connection name in format that shows in OE
|
||||
*/
|
||||
export function getConnectionName(connection: any): string {
|
||||
let connectionName: string;
|
||||
if (connection.options['connectionName']) {
|
||||
connectionName = connection.options['connectionName'];
|
||||
} else {
|
||||
let user = connection.options['user'];
|
||||
if (!user) {
|
||||
user = constants.defaultUser;
|
||||
}
|
||||
|
||||
connectionName = `${connection.options['server']} (${user})`;
|
||||
}
|
||||
|
||||
return connectionName;
|
||||
}
|
||||
Reference in New Issue
Block a user