mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-17 09:35:37 -05:00
add sorting option for saved connections (#15229)
* add sort by name option for saved connections and groups
This commit is contained in:
@@ -12,6 +12,7 @@ import { ConnectionProfile } from 'sql/platform/connection/common/connectionProf
|
||||
import { ConnectionProfileGroup } from 'sql/platform/connection/common/connectionProfileGroup';
|
||||
import { attachInputBoxStyler } from 'sql/platform/theme/common/styler';
|
||||
import { ITreeItem } from 'sql/workbench/common/views';
|
||||
import { CONNECTIONS_SORT_BY_CONFIG_KEY } from 'sql/platform/connection/common/connectionConfig';
|
||||
import { IConnectionTreeDescriptor, IConnectionTreeService } from 'sql/workbench/services/connection/common/connectionTreeService';
|
||||
import { AsyncRecentConnectionTreeDataSource } from 'sql/workbench/services/objectExplorer/browser/asyncRecentConnectionTreeDataSource';
|
||||
import { ServerTreeElement } from 'sql/workbench/services/objectExplorer/browser/asyncServerTree';
|
||||
@@ -91,7 +92,8 @@ export class ConnectionBrowserView extends Disposable implements IPanelView {
|
||||
@ICommandService private readonly commandService: ICommandService,
|
||||
@IContextMenuService private readonly contextMenuService: IContextMenuService,
|
||||
@IConnectionManagementService private readonly connectionManagementService: IConnectionManagementService,
|
||||
@ICapabilitiesService private readonly capabilitiesService: ICapabilitiesService
|
||||
@ICapabilitiesService private readonly capabilitiesService: ICapabilitiesService,
|
||||
@IConfigurationService private readonly configurationService: IConfigurationService,
|
||||
) {
|
||||
super();
|
||||
this.connectionTreeService.setView(this);
|
||||
@@ -224,6 +226,13 @@ export class ConnectionBrowserView extends Disposable implements IPanelView {
|
||||
this._register(this.themeService.onDidColorThemeChange(async () => {
|
||||
await this.refresh();
|
||||
}));
|
||||
|
||||
this._register(this.configurationService.onDidChangeConfiguration(e => {
|
||||
if (e.affectsConfiguration(CONNECTIONS_SORT_BY_CONFIG_KEY)) {
|
||||
this.updateSavedConnectionsNode();
|
||||
}
|
||||
}));
|
||||
|
||||
}
|
||||
|
||||
private handleTreeElementSelection(selectedNode: TreeElement, connect: boolean): void {
|
||||
|
||||
Reference in New Issue
Block a user