mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -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>;
|
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
|
* Load the password and opens a new connection
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -77,7 +77,6 @@ export class ConnectionManagementService extends Disposable implements IConnecti
|
|||||||
private _connectionStore: ConnectionStore,
|
private _connectionStore: ConnectionStore,
|
||||||
private _connectionStatusManager: ConnectionStatusManager,
|
private _connectionStatusManager: ConnectionStatusManager,
|
||||||
@IConnectionDialogService private _connectionDialogService: IConnectionDialogService,
|
@IConnectionDialogService private _connectionDialogService: IConnectionDialogService,
|
||||||
@IServerGroupController private _serverGroupController: IServerGroupController,
|
|
||||||
@IInstantiationService private _instantiationService: IInstantiationService,
|
@IInstantiationService private _instantiationService: IInstantiationService,
|
||||||
@IEditorService private _editorService: IEditorService,
|
@IEditorService private _editorService: IEditorService,
|
||||||
@ITelemetryService private _telemetryService: ITelemetryService,
|
@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
|
* Load the password for the profile
|
||||||
* @param connectionProfile Connection Profile
|
* @param connectionProfile Connection Profile
|
||||||
|
|||||||
@@ -149,7 +149,6 @@ suite('SQL ConnectionManagementService tests', () => {
|
|||||||
connectionStore.object,
|
connectionStore.object,
|
||||||
undefined,
|
undefined,
|
||||||
connectionDialogService.object,
|
connectionDialogService.object,
|
||||||
undefined, // IServerGroupController
|
|
||||||
undefined, // IInstantiationService
|
undefined, // IInstantiationService
|
||||||
workbenchEditorService.object,
|
workbenchEditorService.object,
|
||||||
undefined, // ITelemetryService
|
undefined, // ITelemetryService
|
||||||
@@ -946,7 +945,7 @@ suite('SQL ConnectionManagementService tests', () => {
|
|||||||
connectionStoreMock.setup(x => x.getConnectionProfileGroups(TypeMoq.It.isAny(), undefined)).returns(() => {
|
connectionStoreMock.setup(x => x.getConnectionProfileGroups(TypeMoq.It.isAny(), undefined)).returns(() => {
|
||||||
return [group1];
|
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
|
// dupe connections have been seeded the numbers below already reflected the de-duped results
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,6 @@
|
|||||||
|
|
||||||
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
|
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
|
||||||
|
|
||||||
import { IConnectionManagementService } from 'sql/platform/connection/common/connectionManagement';
|
|
||||||
import { ConnectionProfileGroup } from 'sql/platform/connection/common/connectionProfileGroup';
|
import { ConnectionProfileGroup } from 'sql/platform/connection/common/connectionProfileGroup';
|
||||||
|
|
||||||
export interface IServerGroupDialogCallbacks {
|
export interface IServerGroupDialogCallbacks {
|
||||||
@@ -15,6 +14,6 @@ export interface IServerGroupDialogCallbacks {
|
|||||||
export const IServerGroupController = createDecorator<IServerGroupController>('serverGroupController');
|
export const IServerGroupController = createDecorator<IServerGroupController>('serverGroupController');
|
||||||
export interface IServerGroupController {
|
export interface IServerGroupController {
|
||||||
_serviceBrand: any;
|
_serviceBrand: any;
|
||||||
showCreateGroupDialog(connectionManagementService: IConnectionManagementService, callbacks?: IServerGroupDialogCallbacks): Promise<void>;
|
showCreateGroupDialog(callbacks?: IServerGroupDialogCallbacks): Promise<void>;
|
||||||
showEditGroupDialog(connectionManagementService: IConnectionManagementService, group: ConnectionProfileGroup): Promise<void>;
|
showEditGroupDialog(group: ConnectionProfileGroup): Promise<void>;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ import { ObjectExplorerActionsContext } from 'sql/workbench/parts/objectExplorer
|
|||||||
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
|
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
|
||||||
import { IErrorMessageService } from 'sql/platform/errorMessage/common/errorMessageService';
|
import { IErrorMessageService } from 'sql/platform/errorMessage/common/errorMessageService';
|
||||||
import { UNSAVED_GROUP_ID } from 'sql/platform/connection/common/constants';
|
import { UNSAVED_GROUP_ID } from 'sql/platform/connection/common/constants';
|
||||||
|
import { IServerGroupController } from 'sql/platform/serverGroup/common/serverGroupController';
|
||||||
|
|
||||||
export class RefreshAction extends Action {
|
export class RefreshAction extends Action {
|
||||||
|
|
||||||
@@ -173,14 +174,14 @@ export class AddServerGroupAction extends Action {
|
|||||||
constructor(
|
constructor(
|
||||||
id: string,
|
id: string,
|
||||||
label: string,
|
label: string,
|
||||||
@IConnectionManagementService private _connectionManagementService: IConnectionManagementService
|
@IServerGroupController private readonly serverGroupController: IServerGroupController
|
||||||
) {
|
) {
|
||||||
super(id, label);
|
super(id, label);
|
||||||
this.class = 'add-server-group-action';
|
this.class = 'add-server-group-action';
|
||||||
}
|
}
|
||||||
|
|
||||||
public run(): Promise<boolean> {
|
public run(): Promise<boolean> {
|
||||||
this._connectionManagementService.showCreateServerGroupDialog();
|
this.serverGroupController.showCreateGroupDialog();
|
||||||
return Promise.resolve(true);
|
return Promise.resolve(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -196,14 +197,14 @@ export class EditServerGroupAction extends Action {
|
|||||||
id: string,
|
id: string,
|
||||||
label: string,
|
label: string,
|
||||||
private _group: ConnectionProfileGroup,
|
private _group: ConnectionProfileGroup,
|
||||||
@IConnectionManagementService private _connectionManagementService: IConnectionManagementService
|
@IServerGroupController private readonly serverGroupController: IServerGroupController
|
||||||
) {
|
) {
|
||||||
super(id, label);
|
super(id, label);
|
||||||
this.class = 'edit-server-group-action';
|
this.class = 'edit-server-group-action';
|
||||||
}
|
}
|
||||||
|
|
||||||
public run(): Promise<boolean> {
|
public run(): Promise<boolean> {
|
||||||
this._connectionManagementService.showEditServerGroupDialog(this._group);
|
this.serverGroupController.showEditGroupDialog(this._group);
|
||||||
return Promise.resolve(true);
|
return Promise.resolve(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -231,8 +232,7 @@ export class ActiveConnectionsFilterAction extends Action {
|
|||||||
constructor(
|
constructor(
|
||||||
id: string,
|
id: string,
|
||||||
label: string,
|
label: string,
|
||||||
private view: ServerTreeView,
|
private view: ServerTreeView
|
||||||
@IConnectionManagementService private _connectionManagementService: IConnectionManagementService
|
|
||||||
) {
|
) {
|
||||||
super(id, label);
|
super(id, label);
|
||||||
this.class = ActiveConnectionsFilterAction.enabledClass;
|
this.class = ActiveConnectionsFilterAction.enabledClass;
|
||||||
|
|||||||
@@ -220,7 +220,7 @@ suite('SQL Connection Tree Action tests', () => {
|
|||||||
let serverTreeView = TypeMoq.Mock.ofType(ServerTreeView, TypeMoq.MockBehavior.Strict, undefined, instantiationService.object, undefined, undefined, undefined, undefined, capabilitiesService);
|
let serverTreeView = TypeMoq.Mock.ofType(ServerTreeView, TypeMoq.MockBehavior.Strict, undefined, instantiationService.object, undefined, undefined, undefined, undefined, capabilitiesService);
|
||||||
serverTreeView.setup(x => x.showFilteredTree(TypeMoq.It.isAnyString()));
|
serverTreeView.setup(x => x.showFilteredTree(TypeMoq.It.isAnyString()));
|
||||||
serverTreeView.setup(x => x.refreshTree());
|
serverTreeView.setup(x => x.refreshTree());
|
||||||
let connectionTreeAction: ActiveConnectionsFilterAction = new ActiveConnectionsFilterAction(ActiveConnectionsFilterAction.ID, ActiveConnectionsFilterAction.LABEL, serverTreeView.object, connectionManagementService.object);
|
let connectionTreeAction: ActiveConnectionsFilterAction = new ActiveConnectionsFilterAction(ActiveConnectionsFilterAction.ID, ActiveConnectionsFilterAction.LABEL, serverTreeView.object);
|
||||||
connectionTreeAction.run().then((value) => {
|
connectionTreeAction.run().then((value) => {
|
||||||
serverTreeView.verify(x => x.showFilteredTree('active'), TypeMoq.Times.once());
|
serverTreeView.verify(x => x.showFilteredTree('active'), TypeMoq.Times.once());
|
||||||
}).then(() => done(), (err) => done(err));
|
}).then(() => done(), (err) => done(err));
|
||||||
@@ -237,7 +237,7 @@ suite('SQL Connection Tree Action tests', () => {
|
|||||||
let serverTreeView = TypeMoq.Mock.ofType(ServerTreeView, TypeMoq.MockBehavior.Strict, undefined, instantiationService.object, undefined, undefined, undefined, undefined, capabilitiesService);
|
let serverTreeView = TypeMoq.Mock.ofType(ServerTreeView, TypeMoq.MockBehavior.Strict, undefined, instantiationService.object, undefined, undefined, undefined, undefined, capabilitiesService);
|
||||||
serverTreeView.setup(x => x.showFilteredTree(TypeMoq.It.isAnyString()));
|
serverTreeView.setup(x => x.showFilteredTree(TypeMoq.It.isAnyString()));
|
||||||
serverTreeView.setup(x => x.refreshTree());
|
serverTreeView.setup(x => x.refreshTree());
|
||||||
let connectionTreeAction: ActiveConnectionsFilterAction = new ActiveConnectionsFilterAction(ActiveConnectionsFilterAction.ID, ActiveConnectionsFilterAction.LABEL, serverTreeView.object, connectionManagementService.object);
|
let connectionTreeAction: ActiveConnectionsFilterAction = new ActiveConnectionsFilterAction(ActiveConnectionsFilterAction.ID, ActiveConnectionsFilterAction.LABEL, serverTreeView.object);
|
||||||
connectionTreeAction.isSet = true;
|
connectionTreeAction.isSet = true;
|
||||||
connectionTreeAction.run().then((value) => {
|
connectionTreeAction.run().then((value) => {
|
||||||
serverTreeView.verify(x => x.refreshTree(), TypeMoq.Times.once());
|
serverTreeView.verify(x => x.refreshTree(), TypeMoq.Times.once());
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti
|
|||||||
import { ConnectionProviderProperties } from 'sql/workbench/parts/connection/common/connectionProviderExtension';
|
import { ConnectionProviderProperties } from 'sql/workbench/parts/connection/common/connectionProviderExtension';
|
||||||
import { ConnectionController } from 'sql/workbench/services/connection/browser/connectionController';
|
import { ConnectionController } from 'sql/workbench/services/connection/browser/connectionController';
|
||||||
import { CmsConnectionWidget } from 'sql/workbench/services/connection/browser/cmsConnectionWidget';
|
import { CmsConnectionWidget } from 'sql/workbench/services/connection/browser/cmsConnectionWidget';
|
||||||
|
import { IServerGroupController } from 'sql/platform/serverGroup/common/serverGroupController';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Connection Controller for CMS Connections
|
* Connection Controller for CMS Connections
|
||||||
@@ -16,12 +17,14 @@ import { CmsConnectionWidget } from 'sql/workbench/services/connection/browser/c
|
|||||||
export class CmsConnectionController extends ConnectionController {
|
export class CmsConnectionController extends ConnectionController {
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
connectionManagementService: IConnectionManagementService,
|
|
||||||
connectionProperties: ConnectionProviderProperties,
|
connectionProperties: ConnectionProviderProperties,
|
||||||
callback: IConnectionComponentCallbacks,
|
callback: IConnectionComponentCallbacks,
|
||||||
providerName: string,
|
providerName: string,
|
||||||
@IInstantiationService _instantiationService: IInstantiationService) {
|
@IConnectionManagementService _connectionManagementService: IConnectionManagementService,
|
||||||
super(connectionManagementService, connectionProperties, callback, providerName, _instantiationService);
|
@IInstantiationService _instantiationService: IInstantiationService,
|
||||||
|
@IServerGroupController _serverGroupController: IServerGroupController
|
||||||
|
) {
|
||||||
|
super(connectionProperties, callback, providerName, _connectionManagementService, _instantiationService, _serverGroupController);
|
||||||
let specialOptions = this._providerOptions.filter(
|
let specialOptions = this._providerOptions.filter(
|
||||||
(property) => (property.specialValueType !== null && property.specialValueType !== undefined));
|
(property) => (property.specialValueType !== null && property.specialValueType !== undefined));
|
||||||
this._connectionWidget = this._instantiationService.createInstance(CmsConnectionWidget, specialOptions, {
|
this._connectionWidget = this._instantiationService.createInstance(CmsConnectionWidget, specialOptions, {
|
||||||
@@ -40,4 +43,4 @@ export class CmsConnectionController extends ConnectionController {
|
|||||||
this._databaseCache = new Map<string, string[]>();
|
this._databaseCache = new Map<string, string[]>();
|
||||||
this._connectionWidget.createConnectionWidget(container, authTypeChanged);
|
this._connectionWidget.createConnectionWidget(container, authTypeChanged);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,9 +15,9 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti
|
|||||||
import { ConnectionOptionSpecialType } from 'sql/workbench/api/common/sqlExtHostTypes';
|
import { ConnectionOptionSpecialType } from 'sql/workbench/api/common/sqlExtHostTypes';
|
||||||
import { ConnectionProviderProperties } from 'sql/workbench/parts/connection/common/connectionProviderExtension';
|
import { ConnectionProviderProperties } from 'sql/workbench/parts/connection/common/connectionProviderExtension';
|
||||||
import { ConnectionWidget } from 'sql/workbench/services/connection/browser/connectionWidget';
|
import { ConnectionWidget } from 'sql/workbench/services/connection/browser/connectionWidget';
|
||||||
|
import { IServerGroupController } from 'sql/platform/serverGroup/common/serverGroupController';
|
||||||
|
|
||||||
export class ConnectionController implements IConnectionComponentController {
|
export class ConnectionController implements IConnectionComponentController {
|
||||||
private _connectionManagementService: IConnectionManagementService;
|
|
||||||
private _advancedController: AdvancedPropertiesController;
|
private _advancedController: AdvancedPropertiesController;
|
||||||
private _model: IConnectionProfile;
|
private _model: IConnectionProfile;
|
||||||
private _providerName: string;
|
private _providerName: string;
|
||||||
@@ -28,12 +28,13 @@ export class ConnectionController implements IConnectionComponentController {
|
|||||||
protected _databaseCache = new Map<string, string[]>();
|
protected _databaseCache = new Map<string, string[]>();
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
connectionManagementService: IConnectionManagementService,
|
|
||||||
connectionProperties: ConnectionProviderProperties,
|
connectionProperties: ConnectionProviderProperties,
|
||||||
callback: IConnectionComponentCallbacks,
|
callback: IConnectionComponentCallbacks,
|
||||||
providerName: string,
|
providerName: string,
|
||||||
@IInstantiationService protected _instantiationService: IInstantiationService) {
|
@IConnectionManagementService protected readonly _connectionManagementService: IConnectionManagementService,
|
||||||
this._connectionManagementService = connectionManagementService;
|
@IInstantiationService protected readonly _instantiationService: IInstantiationService,
|
||||||
|
@IServerGroupController protected readonly _serverGroupController: IServerGroupController
|
||||||
|
) {
|
||||||
this._callback = callback;
|
this._callback = callback;
|
||||||
this._providerOptions = connectionProperties.connectionOptions;
|
this._providerOptions = connectionProperties.connectionOptions;
|
||||||
let specialOptions = this._providerOptions.filter(
|
let specialOptions = this._providerOptions.filter(
|
||||||
@@ -89,7 +90,7 @@ export class ConnectionController implements IConnectionComponentController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected onCreateNewServerGroup(): void {
|
protected onCreateNewServerGroup(): void {
|
||||||
this._connectionManagementService.showCreateServerGroupDialog({
|
this._serverGroupController.showCreateGroupDialog({
|
||||||
onAddGroup: (groupName) => this._connectionWidget.updateServerGroup(this.getAllServerGroups(), groupName),
|
onAddGroup: (groupName) => this._connectionWidget.updateServerGroup(this.getAllServerGroups(), groupName),
|
||||||
onClose: () => this._connectionWidget.focusOnServerGroup()
|
onClose: () => this._connectionWidget.focusOnServerGroup()
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -276,14 +276,12 @@ export class ConnectionDialogService implements IConnectionDialogService {
|
|||||||
if (providerName === Constants.cmsProviderName) {
|
if (providerName === Constants.cmsProviderName) {
|
||||||
this._connectionControllerMap[providerName] =
|
this._connectionControllerMap[providerName] =
|
||||||
this._instantiationService.createInstance(CmsConnectionController,
|
this._instantiationService.createInstance(CmsConnectionController,
|
||||||
this._connectionManagementService,
|
|
||||||
this._capabilitiesService.getCapabilities(providerName).connection, {
|
this._capabilitiesService.getCapabilities(providerName).connection, {
|
||||||
onSetConnectButton: (enable: boolean) => this.handleSetConnectButtonEnable(enable)
|
onSetConnectButton: (enable: boolean) => this.handleSetConnectButtonEnable(enable)
|
||||||
}, providerName);
|
}, providerName);
|
||||||
} else {
|
} else {
|
||||||
this._connectionControllerMap[providerName] =
|
this._connectionControllerMap[providerName] =
|
||||||
this._instantiationService.createInstance(ConnectionController,
|
this._instantiationService.createInstance(ConnectionController,
|
||||||
this._connectionManagementService,
|
|
||||||
this._capabilitiesService.getCapabilities(providerName).connection, {
|
this._capabilitiesService.getCapabilities(providerName).connection, {
|
||||||
onSetConnectButton: (enable: boolean) => this.handleSetConnectButtonEnable(enable)
|
onSetConnectButton: (enable: boolean) => this.handleSetConnectButtonEnable(enable)
|
||||||
}, providerName);
|
}, providerName);
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ export class ServerGroupController implements IServerGroupController {
|
|||||||
_serviceBrand: any;
|
_serviceBrand: any;
|
||||||
|
|
||||||
private _serverGroupDialog: ServerGroupDialog;
|
private _serverGroupDialog: ServerGroupDialog;
|
||||||
private _connectionManagementService: IConnectionManagementService;
|
|
||||||
private _callbacks: IServerGroupDialogCallbacks;
|
private _callbacks: IServerGroupDialogCallbacks;
|
||||||
private _group: ConnectionProfileGroup;
|
private _group: ConnectionProfileGroup;
|
||||||
private _viewModel: ServerGroupViewModel;
|
private _viewModel: ServerGroupViewModel;
|
||||||
@@ -27,7 +26,8 @@ export class ServerGroupController implements IServerGroupController {
|
|||||||
constructor(
|
constructor(
|
||||||
@IErrorMessageService private _errorMessageService: IErrorMessageService,
|
@IErrorMessageService private _errorMessageService: IErrorMessageService,
|
||||||
@IInstantiationService private _instantiationService: IInstantiationService,
|
@IInstantiationService private _instantiationService: IInstantiationService,
|
||||||
@IConfigurationService private _configurationService: IConfigurationService
|
@IConfigurationService private _configurationService: IConfigurationService,
|
||||||
|
@IConnectionManagementService private readonly connectionManagementService: IConnectionManagementService
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -37,7 +37,7 @@ export class ServerGroupController implements IServerGroupController {
|
|||||||
this._group.name = this._viewModel.groupName;
|
this._group.name = this._viewModel.groupName;
|
||||||
this._group.color = this._viewModel.groupColor;
|
this._group.color = this._viewModel.groupColor;
|
||||||
this._group.description = this._viewModel.groupDescription;
|
this._group.description = this._viewModel.groupDescription;
|
||||||
this._connectionManagementService.editGroup(this._group).then(() => {
|
this.connectionManagementService.editGroup(this._group).then(() => {
|
||||||
this._serverGroupDialog.close();
|
this._serverGroupDialog.close();
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
// rollback changes made
|
// rollback changes made
|
||||||
@@ -53,7 +53,7 @@ export class ServerGroupController implements IServerGroupController {
|
|||||||
color: this._viewModel.groupColor,
|
color: this._viewModel.groupColor,
|
||||||
description: this._viewModel.groupDescription
|
description: this._viewModel.groupDescription
|
||||||
};
|
};
|
||||||
this._connectionManagementService.saveProfileGroup(newGroup).then(groupId => {
|
this.connectionManagementService.saveProfileGroup(newGroup).then(groupId => {
|
||||||
if (this._callbacks) {
|
if (this._callbacks) {
|
||||||
this._callbacks.onAddGroup(this._serverGroupDialog.groupName);
|
this._callbacks.onAddGroup(this._serverGroupDialog.groupName);
|
||||||
}
|
}
|
||||||
@@ -75,16 +75,14 @@ export class ServerGroupController implements IServerGroupController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public showCreateGroupDialog(connectionManagementService: IConnectionManagementService, callbacks?: IServerGroupDialogCallbacks): Promise<void> {
|
public showCreateGroupDialog(callbacks?: IServerGroupDialogCallbacks): Promise<void> {
|
||||||
this._connectionManagementService = connectionManagementService;
|
|
||||||
this._group = null;
|
this._group = null;
|
||||||
this._viewModel = new ServerGroupViewModel(undefined, this._configurationService.getValue(SERVER_GROUP_CONFIG)[SERVER_GROUP_COLORS_CONFIG]);
|
this._viewModel = new ServerGroupViewModel(undefined, this._configurationService.getValue(SERVER_GROUP_CONFIG)[SERVER_GROUP_COLORS_CONFIG]);
|
||||||
this._callbacks = callbacks ? callbacks : undefined;
|
this._callbacks = callbacks ? callbacks : undefined;
|
||||||
return this.openServerGroupDialog();
|
return this.openServerGroupDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
public showEditGroupDialog(connectionManagementService: IConnectionManagementService, group: ConnectionProfileGroup): Promise<void> {
|
public showEditGroupDialog(group: ConnectionProfileGroup): Promise<void> {
|
||||||
this._connectionManagementService = connectionManagementService;
|
|
||||||
this._group = group;
|
this._group = group;
|
||||||
this._viewModel = new ServerGroupViewModel(group, this._configurationService.getValue(SERVER_GROUP_CONFIG)[SERVER_GROUP_COLORS_CONFIG]);
|
this._viewModel = new ServerGroupViewModel(group, this._configurationService.getValue(SERVER_GROUP_CONFIG)[SERVER_GROUP_COLORS_CONFIG]);
|
||||||
return this.openServerGroupDialog();
|
return this.openServerGroupDialog();
|
||||||
|
|||||||
Reference in New Issue
Block a user