Files
azuredatastudio/extensions/sql-database-projects/src/dialogs/utils.ts
Sakshi Sharma 749989cd0b 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
2020-11-20 09:38:16 -08:00

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;
}