fix default connection group by changing ordering of groups (#11303)

This commit is contained in:
Anthony Dresser
2020-07-13 13:25:05 -07:00
committed by GitHub
parent 286c021df9
commit 351ab2f40f

View File

@@ -147,9 +147,6 @@ export class ConnectionController implements IConnectionComponentController {
private getAllServerGroups(providers?: string[]): IConnectionProfileGroup[] {
let connectionGroupRoot = this._connectionManagementService.getConnectionGroups(providers);
let allGroups: IConnectionProfileGroup[] = [];
if (connectionGroupRoot && connectionGroupRoot.length > 0) {
this.flattenGroups(connectionGroupRoot[0], allGroups);
}
let defaultGroupId: string;
if (connectionGroupRoot && connectionGroupRoot.length > 0 && ConnectionProfileGroup.isRoot(connectionGroupRoot[0].name)) {
defaultGroupId = connectionGroupRoot[0].id;
@@ -158,6 +155,9 @@ export class ConnectionController implements IConnectionComponentController {
}
allGroups.push(assign({}, this._connectionWidget.DefaultServerGroup, { id: defaultGroupId }));
allGroups.push(this._connectionWidget.NoneServerGroup);
if (connectionGroupRoot && connectionGroupRoot.length > 0) {
this.flattenGroups(connectionGroupRoot[0], allGroups);
}
connectionGroupRoot.forEach(cpg => cpg.dispose());
return allGroups;
}