Fix Issue when OE connection Disconnects on Notebook Close (#4425)

* Fix OE connection closing when notebook closes

* handle connections created through Add new connection
This commit is contained in:
Chris LaFreniere
2019-03-13 11:32:12 -07:00
committed by GitHub
parent 2c7b5578e7
commit 17901fbf3d
4 changed files with 34 additions and 6 deletions

View File

@@ -379,7 +379,7 @@ export class ConnectionManagementService extends Disposable implements IConnecti
* otherwise tries to make a connection and returns the owner uri when connection is complete
* The purpose is connection by default
*/
public connectIfNotConnected(connection: IConnectionProfile, purpose?: 'dashboard' | 'insights' | 'connection', saveConnection: boolean = false): Promise<string> {
public connectIfNotConnected(connection: IConnectionProfile, purpose?: 'dashboard' | 'insights' | 'connection' | 'notebook', saveConnection: boolean = false): Promise<string> {
return new Promise<string>((resolve, reject) => {
let ownerUri: string = Utils.generateUri(connection, purpose);
if (this._connectionStatusManager.isConnected(ownerUri)) {
@@ -1156,7 +1156,7 @@ export class ConnectionManagementService extends Disposable implements IConnecti
* Finds existing connection for given profile and purpose is any exists.
* The purpose is connection by default
*/
public findExistingConnection(connection: IConnectionProfile, purpose?: 'dashboard' | 'insights' | 'connection'): ConnectionProfile {
public findExistingConnection(connection: IConnectionProfile, purpose?: 'dashboard' | 'insights' | 'connection' | 'notebook'): ConnectionProfile {
let connectionUri = Utils.generateUri(connection, purpose);
let existingConnection = this._connectionStatusManager.findConnection(connectionUri);
if (existingConnection && this._connectionStatusManager.isConnected(connectionUri)) {

View File

@@ -17,7 +17,8 @@ export const uriPrefixes = {
default: 'connection://',
connection: 'connection://',
dashboard: 'dashboard://',
insights: 'insights://'
insights: 'insights://',
notebook: 'notebook://'
};