mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-18 09:35:39 -05:00
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:
@@ -83,6 +83,30 @@ export class RefreshAction extends Action {
|
||||
}
|
||||
}
|
||||
|
||||
export class EditConnectionAction extends Action {
|
||||
public static ID = 'registeredServers.editConnection';
|
||||
public static LABEL = localize('connectionTree.editConnection', "Edit Connection");
|
||||
|
||||
constructor(
|
||||
id: string,
|
||||
label: string,
|
||||
private _connectionProfile: ConnectionProfile,
|
||||
@IConnectionManagementService private _connectionManagementService: IConnectionManagementService
|
||||
) {
|
||||
super(id, label);
|
||||
this.class = 'edit-server-action';
|
||||
}
|
||||
|
||||
public async run(): Promise<boolean> {
|
||||
if (!this._connectionProfile) {
|
||||
return false;
|
||||
}
|
||||
|
||||
await this._connectionManagementService.showEditConnectionDialog(this._connectionProfile);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
export class DisconnectConnectionAction extends Action {
|
||||
public static ID = 'objectExplorer.disconnect';
|
||||
public static LABEL = localize('DisconnectAction', "Disconnect");
|
||||
|
||||
@@ -9,7 +9,7 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti
|
||||
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
|
||||
|
||||
import {
|
||||
DisconnectConnectionAction, AddServerAction,
|
||||
DisconnectConnectionAction, AddServerAction, EditConnectionAction,
|
||||
DeleteConnectionAction, RefreshAction, EditServerGroupAction
|
||||
} from 'sql/workbench/services/objectExplorer/browser/connectionTreeAction';
|
||||
import { TreeNode } from 'sql/workbench/services/objectExplorer/common/treeNode';
|
||||
@@ -129,6 +129,7 @@ export class ServerTreeActionProvider {
|
||||
if (this._connectionManagementService.isProfileConnected(context.profile)) {
|
||||
actions.push(this._instantiationService.createInstance(DisconnectConnectionAction, DisconnectConnectionAction.ID, DisconnectConnectionAction.LABEL, context.profile));
|
||||
}
|
||||
actions.push(this._instantiationService.createInstance(EditConnectionAction, EditConnectionAction.ID, EditConnectionAction.LABEL, context.profile));
|
||||
actions.push(this._instantiationService.createInstance(DeleteConnectionAction, DeleteConnectionAction.ID, DeleteConnectionAction.DELETE_CONNECTION_LABEL, context.profile));
|
||||
|
||||
// Contribute refresh action for scriptable objects via contribution
|
||||
|
||||
Reference in New Issue
Block a user