Fix getUriForConnection API returning wrong URIs (#2202)

* Fix connection URI api to return working URI

* run tsfmt

* Keep using hand-built connection string for now in import

* Use connection ID instead of URI to get connection string
This commit is contained in:
Matt Irvine
2018-08-20 12:41:06 -07:00
committed by Karl Burtram
parent efa3658ced
commit 3001640eec
7 changed files with 26 additions and 21 deletions

View File

@@ -649,9 +649,9 @@ export class ConnectionManagementService extends Disposable implements IConnecti
}
public getConnectionUriFromId(connectionId: string): string {
let connection = this.getActiveConnections().find(connection => connection.id === connectionId);
if (connection) {
return this.getConnectionUri(connection);
let connectionInfo = this._connectionStatusManager.findConnectionByProfileId(connectionId);
if (connectionInfo) {
return connectionInfo.ownerUri;
} else {
return undefined;
}
@@ -1348,9 +1348,11 @@ export class ConnectionManagementService extends Disposable implements IConnecti
}
/**
* Get the connection string for the provided connection profile
* Get the connection string for the provided connection ID
*/
public getConnectionString(ownerUri: string, includePassword: boolean = false): Thenable<string> {
public getConnectionString(connectionId: string, includePassword: boolean = false): Thenable<string> {
let ownerUri = this.getConnectionUriFromId(connectionId);
if (!ownerUri) {
return Promise.resolve(undefined);
}