Fixing async server tree (#22511)

* Changing look of new OE

* Fixing styling

* Fixing moving of connected profile

* Fixing drag and drop where treenodes delete connection nodes

* Fixing Deleting and disconnecting in AsyncServerTree

* Adding constant for OE timeout

* Updated interfaces

* Removing test compilation errors

* Fixing most events in async server tree

* Fixing connection pane styling

* Fixing find node function

* Fixing some more operations

* Fixing some ops

* All operations done

* Fixed active connections

* Fixed data source

* Adding support for setting parents

* code cleanup

* Fixing icon styling issues

* Fix errors

* Fixing comment

* Fixing spacing

* Adding explanation to OE service.

* Reverting server delegate changes

* Reverting styling

* reverting more styling change

* reverting more styling

* Fixing has children

* Fixing drag and drop to tree nodes

* fixing drag and drop

* reverting timing

* fixing drag and drop

* cleaning some code

* Fixed server and group moving

* spell check

* consolidating some logic

* Fixed whitespace

* fixing moving to root group
This commit is contained in:
Aasim Khan
2023-03-29 13:59:35 -07:00
committed by GitHub
parent 7ecbbdf398
commit 2a9705c495
8 changed files with 641 additions and 107 deletions

View File

@@ -85,6 +85,17 @@ export const SERVICE_ID = 'connectionManagementService';
export const IConnectionManagementService = createDecorator<IConnectionManagementService>(SERVICE_ID);
export interface ConnectionElementMovedParams {
source: ConnectionProfile | ConnectionProfileGroup;
oldGroupId: string;
newGroupId: string;
}
export interface ConnectionProfileEditedParams {
profile: ConnectionProfile;
oldProfileId: string;
}
export interface IConnectionManagementService {
_serviceBrand: undefined;
@@ -96,6 +107,25 @@ export interface IConnectionManagementService {
onConnectionChanged: Event<IConnectionParams>;
onLanguageFlavorChanged: Event<azdata.DidChangeLanguageFlavorParams>;
// Event Emitters for async tree
/**
* Connection Profile events.
*/
onConnectionProfileCreated: Event<ConnectionProfile>;
onConnectionProfileEdited: Event<ConnectionProfileEditedParams>;
onConnectionProfileDeleted: Event<ConnectionProfile>;
onConnectionProfileMoved: Event<ConnectionElementMovedParams>;
onConnectionProfileConnected: Event<ConnectionProfile>;
onConnectionProfileDisconnected: Event<ConnectionProfile>;
/**
* Connection Profile Group events.
*/
onConnectionProfileGroupCreated: Event<ConnectionProfileGroup>;
onConnectionProfileGroupEdited: Event<ConnectionProfileGroup>;
onConnectionProfileGroupDeleted: Event<ConnectionProfileGroup>;
onConnectionProfileGroupMoved: Event<ConnectionElementMovedParams>;
// End of Event Emitters for async tree
// Properties
providerNameToDisplayNameMap: { [providerDisplayName: string]: string };
@@ -159,6 +189,8 @@ export interface IConnectionManagementService {
getConnectionGroups(providers?: string[]): ConnectionProfileGroup[];
getConnectionGroupById(id: string): ConnectionProfileGroup | undefined;
getRecentConnections(providers?: string[]): ConnectionProfile[];
clearRecentConnectionsList(): void;

View File

@@ -126,6 +126,8 @@ export class ConnectionProfileGroup extends Disposable implements IConnectionPro
public getChildren(): (ConnectionProfile | ConnectionProfileGroup)[] {
let allChildren: (ConnectionProfile | ConnectionProfileGroup)[] = [];
this._childConnections.forEach((conn) => {
conn.parent = this;
conn.groupId = this.id;
allChildren.push(conn);
});
@@ -234,4 +236,8 @@ export class ConnectionProfileGroup extends Disposable implements IConnectionPro
}
return subgroups;
}
public static createConnectionProfileGroup(group: IConnectionProfileGroup, parentGroup: ConnectionProfileGroup | undefined): ConnectionProfileGroup {
return new ConnectionProfileGroup(group.name, parentGroup, group.id, group.color, group.description);
}
}

View File

@@ -26,6 +26,17 @@ export class TestConnectionManagementService implements IConnectionManagementSer
onDeleteConnectionProfile = undefined!;
onLanguageFlavorChanged = undefined!;
public onConnectionProfileCreated: Event<any> = Event.None;
public onConnectionProfileEdited: Event<any> = Event.None;
public onConnectionProfileDeleted: Event<any> = Event.None;
public onConnectionProfileMoved: Event<any> = Event.None;
public onConnectionProfileConnected: Event<any> = Event.None;
public onConnectionProfileDisconnected: Event<any> = Event.None;
public onConnectionProfileGroupCreated: Event<any> = Event.None;
public onConnectionProfileGroupEdited: Event<any> = Event.None;
public onConnectionProfileGroupDeleted: Event<any> = Event.None;
public onConnectionProfileGroupMoved: Event<any> = Event.None;
public get onConnect(): Event<any> {
return Event.None;
}
@@ -90,6 +101,10 @@ export class TestConnectionManagementService implements IConnectionManagementSer
return [];
}
getConnectionGroupById(id: string): ConnectionProfileGroup | undefined {
return undefined;
}
getActiveConnections(providers?: string[]): ConnectionProfile[] {
return [];
}