Edit Connection Feature added, edit existing connection in connection tree. (#10214)

* Added Edit Connection Command

* Wip changes for new connection dialog

* Testing

* WIP commit

* added ID check to ensure connection

* wip commit

* model id check implemented

* addfooterbutton now accepts events

* wip commit

* message explaining check

* temporary change

* connectionManagementService restored

* Revert "connectionManagementService restored"

This reverts commit 9704a63184a06a33bee2648ef0a899229d117cc0.

* formatting test

* editConnection promise testing

* edit existing connection command added

* WIP Connection Edit

* disconnect added to editConnection promise

* WIP on editExistingConnection

* changed isEdit to true

* Amir/edit connection (#10112)

* Get edit connection working

* Delete unused code

* check for isEdit as well

* connection tree test added

* WIP connection management tests

* comment out test to find out what's wrong

* fix for one error

* added note about test skipped

* changed signature of saveprofile

* saveprofile fixed

* wrote working test

* added additional test

* changed message

* Fixes made

* fix for matcher

Co-authored-by: Amir Omidi <amomidi@microsoft.com>
This commit is contained in:
Alex Ma
2020-05-05 13:21:05 -07:00
committed by GitHub
parent 5fe72d318b
commit 921e546fd7
12 changed files with 234 additions and 59 deletions

View File

@@ -89,7 +89,7 @@ export class ConnectionDialogService implements IConnectionDialogService {
@IConfigurationService private _configurationService: IConfigurationService,
@IClipboardService private _clipboardService: IClipboardService,
@ICommandService private _commandService: ICommandService,
@ILogService private _logService: ILogService
@ILogService private _logService: ILogService,
) {
this.initializeConnectionProviders();
}
@@ -355,6 +355,7 @@ export class ConnectionDialogService implements IConnectionDialogService {
}
private updateModelServerCapabilities(model: IConnectionProfile) {
if (this._model) {
this._model.dispose();
}
@@ -410,32 +411,32 @@ export class ConnectionDialogService implements IConnectionDialogService {
return this._dialogDeferredPromise.promise;
}
public showDialog(
public async showDialog(
connectionManagementService: IConnectionManagementService,
params?: INewConnectionParams,
model?: IConnectionProfile,
connectionResult?: IConnectionResult,
connectionOptions?: IConnectionCompletionOptions): Promise<void> {
connectionOptions?: IConnectionCompletionOptions,
): Promise<void> {
this._connectionManagementService = connectionManagementService;
this._options = connectionOptions;
this._params = params;
this._inputModel = model;
return new Promise<void>((resolve, reject) => {
this.updateModelServerCapabilities(model);
// If connecting from a query editor set "save connection" to false
if (params && (params.input && params.connectionType === ConnectionType.editor ||
params.connectionType === ConnectionType.temporary)) {
this._model.saveProfile = false;
}
resolve(this.showDialogWithModel().then(() => {
if (connectionResult && connectionResult.errorMessage) {
this.showErrorDialog(Severity.Error, this._connectionErrorTitle, connectionResult.errorMessage, connectionResult.callStack);
}
}));
});
this.updateModelServerCapabilities(model);
// If connecting from a query editor set "save connection" to false
if (params && (params.input && params.connectionType === ConnectionType.editor ||
params.connectionType === ConnectionType.temporary)) {
this._model.saveProfile = false;
}
await this.showDialogWithModel();
if (connectionResult && connectionResult.errorMessage) {
this.showErrorDialog(Severity.Error, this._connectionErrorTitle, connectionResult.errorMessage, connectionResult.callStack);
}
}
private async doShowDialog(params: INewConnectionParams): Promise<void> {