mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-30 17:23:29 -05:00
remove circular dependency between server group and connection management (#6916)
This commit is contained in:
@@ -80,16 +80,6 @@ export interface IConnectionManagementService {
|
||||
*/
|
||||
showConnectionDialog(params?: INewConnectionParams, options?: IConnectionCompletionOptions, model?: IConnectionProfile, connectionResult?: IConnectionResult): Promise<void>;
|
||||
|
||||
/**
|
||||
* Opens the add server group dialog
|
||||
*/
|
||||
showCreateServerGroupDialog(callbacks?: IServerGroupDialogCallbacks): Promise<void>;
|
||||
|
||||
/**
|
||||
* Opens the edit server group dialog
|
||||
*/
|
||||
showEditServerGroupDialog(group: ConnectionProfileGroup): Promise<void>;
|
||||
|
||||
/**
|
||||
* Load the password and opens a new connection
|
||||
*/
|
||||
|
||||
@@ -77,7 +77,6 @@ export class ConnectionManagementService extends Disposable implements IConnecti
|
||||
private _connectionStore: ConnectionStore,
|
||||
private _connectionStatusManager: ConnectionStatusManager,
|
||||
@IConnectionDialogService private _connectionDialogService: IConnectionDialogService,
|
||||
@IServerGroupController private _serverGroupController: IServerGroupController,
|
||||
@IInstantiationService private _instantiationService: IInstantiationService,
|
||||
@IEditorService private _editorService: IEditorService,
|
||||
@ITelemetryService private _telemetryService: ITelemetryService,
|
||||
@@ -202,34 +201,6 @@ export class ConnectionManagementService extends Disposable implements IConnecti
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Opens the add server group dialog
|
||||
*/
|
||||
public showCreateServerGroupDialog(callbacks?: IServerGroupDialogCallbacks): Promise<void> {
|
||||
let self = this;
|
||||
return new Promise<void>((resolve, reject) => {
|
||||
self._serverGroupController.showCreateGroupDialog(self, callbacks).then(() => {
|
||||
resolve();
|
||||
}, error => {
|
||||
reject();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Opens the edit server group dialog
|
||||
*/
|
||||
public showEditServerGroupDialog(group: ConnectionProfileGroup): Promise<void> {
|
||||
let self = this;
|
||||
return new Promise<void>((resolve, reject) => {
|
||||
self._serverGroupController.showEditGroupDialog(self, group).then(() => {
|
||||
resolve();
|
||||
}, error => {
|
||||
reject();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Load the password for the profile
|
||||
* @param connectionProfile Connection Profile
|
||||
|
||||
@@ -149,7 +149,6 @@ suite('SQL ConnectionManagementService tests', () => {
|
||||
connectionStore.object,
|
||||
undefined,
|
||||
connectionDialogService.object,
|
||||
undefined, // IServerGroupController
|
||||
undefined, // IInstantiationService
|
||||
workbenchEditorService.object,
|
||||
undefined, // ITelemetryService
|
||||
@@ -946,7 +945,7 @@ suite('SQL ConnectionManagementService tests', () => {
|
||||
connectionStoreMock.setup(x => x.getConnectionProfileGroups(TypeMoq.It.isAny(), undefined)).returns(() => {
|
||||
return [group1];
|
||||
});
|
||||
const connectionManagementService = new ConnectionManagementService(connectionStoreMock.object, connectionStatusManagerMock.object, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined);
|
||||
const connectionManagementService = new ConnectionManagementService(connectionStoreMock.object, connectionStatusManagerMock.object, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined);
|
||||
|
||||
// dupe connections have been seeded the numbers below already reflected the de-duped results
|
||||
|
||||
|
||||
Reference in New Issue
Block a user