mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-15 17:22:25 -05:00
* 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
27 lines
926 B
TypeScript
27 lines
926 B
TypeScript
/*---------------------------------------------------------------------------------------------
|
|
* 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;
|
|
}
|