mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-18 17:22:45 -05:00
Update server tree action contributions (#15525)
* Update server tree action contributions * Fix test
This commit is contained in:
@@ -10,12 +10,7 @@ import { IContextMenuService } from 'vs/platform/contextview/browser/contextView
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { IViewletViewOptions } from 'vs/workbench/browser/parts/views/viewsViewlet';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { IAction } from 'vs/base/common/actions';
|
||||
import { ServerTreeView } from 'sql/workbench/contrib/objectExplorer/browser/serverTreeView';
|
||||
import {
|
||||
ActiveConnectionsFilterAction,
|
||||
AddServerAction, AddServerGroupAction
|
||||
} from 'sql/workbench/services/objectExplorer/browser/connectionTreeAction';
|
||||
import { IObjectExplorerService } from 'sql/workbench/services/objectExplorer/browser/objectExplorerService';
|
||||
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { ViewPane, IViewPaneOptions } from 'vs/workbench/browser/parts/views/viewPane';
|
||||
@@ -33,9 +28,6 @@ export class ConnectionViewletPanel extends ViewPane {
|
||||
|
||||
private _root?: HTMLElement;
|
||||
private _serverTreeView: ServerTreeView;
|
||||
private _addServerAction: IAction;
|
||||
private _addServerGroupAction: IAction;
|
||||
private _activeConnectionsFilterAction: ActiveConnectionsFilterAction;
|
||||
|
||||
constructor(
|
||||
private options: IViewletViewOptions,
|
||||
@@ -52,18 +44,11 @@ export class ConnectionViewletPanel extends ViewPane {
|
||||
@ITelemetryService telemetryService: ITelemetryService,
|
||||
) {
|
||||
super({ ...(options as IViewPaneOptions) }, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, opener, themeService, telemetryService);
|
||||
this._addServerAction = this.instantiationService.createInstance(AddServerAction,
|
||||
AddServerAction.ID,
|
||||
AddServerAction.LABEL);
|
||||
this._addServerGroupAction = this.instantiationService.createInstance(AddServerGroupAction,
|
||||
AddServerGroupAction.ID,
|
||||
AddServerGroupAction.LABEL);
|
||||
this._serverTreeView = <any>this.objectExplorerService.getServerTreeView() as ServerTreeView;
|
||||
this._serverTreeView = this.objectExplorerService.getServerTreeView() as ServerTreeView;
|
||||
if (!this._serverTreeView) {
|
||||
this._serverTreeView = this.instantiationService.createInstance(ServerTreeView);
|
||||
this.objectExplorerService.registerServerTreeView(this._serverTreeView);
|
||||
}
|
||||
this._activeConnectionsFilterAction = this._serverTreeView.activeConnectionsFilterAction;
|
||||
}
|
||||
|
||||
protected renderHeader(container: HTMLElement): void {
|
||||
@@ -114,14 +99,6 @@ export class ConnectionViewletPanel extends ViewPane {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public getActions(): IAction[] {
|
||||
return [
|
||||
this._addServerAction,
|
||||
this._addServerGroupAction,
|
||||
this._activeConnectionsFilterAction
|
||||
];
|
||||
}
|
||||
|
||||
public clearSearch() {
|
||||
this._serverTreeView.refreshTree();
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@ import { ViewPaneContainer } from 'vs/workbench/browser/parts/views/viewPaneCont
|
||||
import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors';
|
||||
import { Viewlet } from 'vs/workbench/browser/viewlet';
|
||||
import { KeyCode, KeyMod } from 'vs/base/common/keyCodes';
|
||||
import { SqlIconId } from 'sql/base/common/codicons';
|
||||
|
||||
export const VIEWLET_ID = 'workbench.view.connections';
|
||||
|
||||
@@ -132,8 +133,6 @@ export class DataExplorerViewPaneContainer extends ViewPaneContainer {
|
||||
}
|
||||
}
|
||||
|
||||
export const dataExplorerIconId = 'dataExplorer';
|
||||
|
||||
export const VIEW_CONTAINER = Registry.as<IViewContainersRegistry>(ViewContainerExtensions.ViewContainersRegistry).registerViewContainer({
|
||||
id: VIEWLET_ID,
|
||||
title: localize('dataexplorer.name', "Connections"),
|
||||
@@ -144,7 +143,7 @@ export const VIEW_CONTAINER = Registry.as<IViewContainersRegistry>(ViewContainer
|
||||
keybindings: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_D },
|
||||
order: 0
|
||||
},
|
||||
icon: { id: 'dataExplorer' },
|
||||
icon: { id: SqlIconId.dataExplorer },
|
||||
order: 0,
|
||||
storageId: `${VIEWLET_ID}.state`
|
||||
}, ViewContainerLocation.Sidebar, { isDefault: true });
|
||||
|
||||
Reference in New Issue
Block a user