mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-16 09:35:36 -05:00
add sorting option for saved connections (#15229)
* add sort by name option for saved connections and groups
This commit is contained in:
@@ -11,6 +11,7 @@ import { Extensions, IConfigurationRegistry } from 'vs/platform/configuration/co
|
||||
import { DataExplorerContainerExtensionHandler } from 'sql/workbench/contrib/dataExplorer/browser/dataExplorerExtensionPoint';
|
||||
import { IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions } from 'vs/workbench/common/contributions';
|
||||
import { DataExplorerViewletViewsContribution } from 'sql/workbench/contrib/dataExplorer/browser/dataExplorerViewlet';
|
||||
import { GROUPS_CONFIG_KEY, CONNECTIONS_CONFIG_KEY, CONNECTIONS_SORT_BY_CONFIG_KEY, ConnectionsSortBy } from 'sql/platform/connection/common/connectionConfig';
|
||||
|
||||
const workbenchRegistry = Registry.as<IWorkbenchContributionsRegistry>(WorkbenchExtensions.Workbench);
|
||||
workbenchRegistry.registerWorkbenchContribution(DataExplorerViewletViewsContribution, LifecyclePhase.Starting);
|
||||
@@ -22,13 +23,23 @@ configurationRegistry.registerConfiguration({
|
||||
'title': localize('databaseConnections', "Database Connections"),
|
||||
'type': 'object',
|
||||
'properties': {
|
||||
'datasource.connections': {
|
||||
[CONNECTIONS_CONFIG_KEY]: {
|
||||
'description': localize('datasource.connections', "data source connections"),
|
||||
'type': 'array'
|
||||
},
|
||||
'datasource.connectionGroups': {
|
||||
[GROUPS_CONFIG_KEY]: {
|
||||
'description': localize('datasource.connectionGroups', "data source groups"),
|
||||
'type': 'array'
|
||||
},
|
||||
[CONNECTIONS_SORT_BY_CONFIG_KEY]: {
|
||||
'type': 'string',
|
||||
'enum': [ConnectionsSortBy.dateAdded, ConnectionsSortBy.displayName],
|
||||
'enumDescriptions': [
|
||||
localize('connections.sortBy.dateAdded', 'Saved connections are sorted by the dates they were added.'),
|
||||
localize('connections.sortBy.displayName', 'Saved connections are sorted by their display names alphabetically.')
|
||||
],
|
||||
'default': ConnectionsSortBy.dateAdded,
|
||||
'description': localize('datasource.connections.sortBy', "Order used for sorting saved connections and connection groups")
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user