diff --git a/src/sql/media/actionBarLabel.css b/src/sql/media/actionBarLabel.css index 37b50a4903..1fbdad6eb1 100644 --- a/src/sql/media/actionBarLabel.css +++ b/src/sql/media/actionBarLabel.css @@ -3,12 +3,6 @@ * Licensed under the Source EULA. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -/* Activity Bar - connection */ -.monaco-workbench > .activitybar .monaco-action-bar .action-label.connectionViewlet { - -webkit-mask: url('icons/server_page_inverse.svg') no-repeat 50% 50%; - -webkit-mask-size: 25px 25px; -} - /* Activity Bar - task history */ .monaco-workbench > .activitybar .monaco-action-bar .action-label.taskHistoryViewlet { -webkit-mask: url('icons/run_history_inverse.svg') no-repeat 50% 50%; diff --git a/src/sql/parts/objectExplorer/viewlet/connectionTreeAction.ts b/src/sql/parts/objectExplorer/viewlet/connectionTreeAction.ts index 4663e0c26b..94553dd3bf 100644 --- a/src/sql/parts/objectExplorer/viewlet/connectionTreeAction.ts +++ b/src/sql/parts/objectExplorer/viewlet/connectionTreeAction.ts @@ -10,7 +10,6 @@ import { IConnectionManagementService } from 'sql/platform/connection/common/con import { ICapabilitiesService } from 'sql/platform/capabilities/common/capabilitiesService'; import { IQueryEditorService } from 'sql/workbench/services/queryEditor/common/queryEditorService'; import { ServerTreeView } from 'sql/parts/objectExplorer/viewlet/serverTreeView'; -import { ConnectionViewlet } from 'sql/workbench/parts/connection/electron-browser/connectionViewlet'; import { IConnectionProfile } from 'sql/platform/connection/common/interfaces'; import { ConnectionProfileGroup } from 'sql/platform/connection/common/connectionProfileGroup'; import * as TaskUtilities from 'sql/workbench/common/taskUtilities'; @@ -377,27 +376,3 @@ export class DeleteConnectionAction extends Action { return Promise.resolve(true); } } - -/** - * Action to clear search results - */ -export class ClearSearchAction extends Action { - public static ID = 'registeredServers.clearSearch'; - public static LABEL = localize('clearSearch', 'Clear Search'); - - constructor( - id: string, - label: string, - private _viewlet: ConnectionViewlet | ConnectionViewletPanel, - @IConnectionManagementService private _connectionManagementService: IConnectionManagementService - ) { - super(id, label); - this.class = 'icon close'; - this.enabled = false; - } - - public run(): Promise { - this._viewlet.clearSearch(); - return Promise.resolve(true); - } -} diff --git a/src/sql/workbench/parts/connection/electron-browser/connectionViewlet.ts b/src/sql/workbench/parts/connection/electron-browser/connectionViewlet.ts deleted file mode 100644 index d03465d199..0000000000 --- a/src/sql/workbench/parts/connection/electron-browser/connectionViewlet.ts +++ /dev/null @@ -1,107 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the Source EULA. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -import 'vs/css!./media/connectionViewlet'; -import * as DOM from 'vs/base/browser/dom'; -import { Viewlet } from 'vs/workbench/browser/viewlet'; -import { IAction } from 'vs/base/common/actions'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { IThemeService } from 'vs/platform/theme/common/themeService'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { VIEWLET_ID } from 'sql/platform/connection/common/connectionManagement'; -import { ServerTreeView } from 'sql/parts/objectExplorer/viewlet/serverTreeView'; -import { IDisposable, dispose } from 'vs/base/common/lifecycle'; -import { AddServerAction, AddServerGroupAction, ActiveConnectionsFilterAction } from 'sql/parts/objectExplorer/viewlet/connectionTreeAction'; -import { warn } from 'sql/base/common/log'; -import { IObjectExplorerService } from 'sql/workbench/services/objectExplorer/common/objectExplorerService'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { IStorageService } from 'vs/platform/storage/common/storage'; -import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService'; - -export class ConnectionViewlet extends Viewlet { - - private _root: HTMLElement; - private _toDisposeViewlet: IDisposable[] = []; - private _serverTreeView: ServerTreeView; - private _addServerAction: IAction; - private _addServerGroupAction: IAction; - private _activeConnectionsFilterAction: ActiveConnectionsFilterAction; - - constructor( - @ITelemetryService telemetryService: ITelemetryService, - @IThemeService themeService: IThemeService, - @IInstantiationService private _instantiationService: IInstantiationService, - @IObjectExplorerService private objectExplorerService: IObjectExplorerService, - @IWorkbenchLayoutService layoutService: IWorkbenchLayoutService, - @IConfigurationService configurationService: IConfigurationService, - @IStorageService storageService: IStorageService - ) { - - super(VIEWLET_ID, configurationService, layoutService, telemetryService, themeService, storageService); - - this._addServerAction = this._instantiationService.createInstance(AddServerAction, - AddServerAction.ID, - AddServerAction.LABEL); - this._addServerGroupAction = this._instantiationService.createInstance(AddServerGroupAction, - AddServerGroupAction.ID, - AddServerGroupAction.LABEL); - this._serverTreeView = this._instantiationService.createInstance(ServerTreeView); - this._activeConnectionsFilterAction = this._serverTreeView.activeConnectionsFilterAction; - this.objectExplorerService.registerServerTreeView(this._serverTreeView); - } - - public create(parent: HTMLElement): void { - super.create(parent); - this._root = parent; - const viewletContainer = DOM.append(parent, DOM.$('div.server-explorer-viewlet')); - const viewContainer = DOM.append(viewletContainer, DOM.$('div.object-explorer-view')); - this._serverTreeView.renderBody(viewContainer).then(undefined, error => { - warn('render registered servers: ' + error); - }); - } - - public search(value: string): void { - if (value) { - this._serverTreeView.searchTree(value); - } else { - this.clearSearch(); - } - } - - public setVisible(visible: boolean): void { - super.setVisible(visible); - this._serverTreeView.setVisible(visible); - } - - /** - * Return actions for the viewlet - */ - public getActions(): IAction[] { - return [this._addServerAction, this._addServerGroupAction, this._activeConnectionsFilterAction]; - } - - public focus(): void { - super.focus(); - } - - public layout({ height, width }: DOM.Dimension): void { - this._serverTreeView.layout(height - 36); // account for search box - DOM.toggleClass(this._root, 'narrow', width <= 350); - } - - public getOptimalWidth(): number { - return 400; - } - - public clearSearch() { - this._serverTreeView.refreshTree(); - } - - public dispose(): void { - this._serverTreeView.dispose(); - this._toDisposeViewlet = dispose(this._toDisposeViewlet); - } - -} diff --git a/src/sql/workbench/parts/dataExplorer/browser/connectionViewletPanel.ts b/src/sql/workbench/parts/dataExplorer/browser/connectionViewletPanel.ts index 97b2430927..c4465d526a 100644 --- a/src/sql/workbench/parts/dataExplorer/browser/connectionViewletPanel.ts +++ b/src/sql/workbench/parts/dataExplorer/browser/connectionViewletPanel.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ 'use strict'; -import { localize } from 'vs/nls'; +import 'vs/css!./media/connectionViewletPanel'; import * as DOM from 'vs/base/browser/dom'; import { dispose, IDisposable } from 'vs/base/common/lifecycle'; import { IExtensionTipsService, IExtensionManagementServerService } from 'vs/platform/extensionManagement/common/extensionManagement'; @@ -12,17 +12,15 @@ import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { IThemeService } from 'vs/platform/theme/common/themeService'; -import { attachInputBoxStyler } from 'vs/platform/theme/common/styler'; import { IViewletViewOptions } from 'vs/workbench/browser/parts/views/viewsViewlet'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { INotificationService } from 'vs/platform/notification/common/notification'; import { ViewletPanel, IViewletPanelOptions } from 'vs/workbench/browser/parts/views/panelViewlet'; import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; -import { InputBox } from 'vs/base/browser/ui/inputbox/inputBox'; import { IAction } from 'vs/base/common/actions'; import { ServerTreeView } from 'sql/parts/objectExplorer/viewlet/serverTreeView'; import { - ClearSearchAction, ActiveConnectionsFilterAction, + ActiveConnectionsFilterAction, AddServerAction, AddServerGroupAction } from 'sql/parts/objectExplorer/viewlet/connectionTreeAction'; import { IObjectExplorerService } from 'sql/workbench/services/objectExplorer/common/objectExplorerService'; @@ -52,7 +50,6 @@ export class ConnectionViewletPanel extends ViewletPanel { @IObjectExplorerService private objectExplorerService: IObjectExplorerService ) { super({ ...(options as IViewletPanelOptions), ariaHeaderLabel: options.title }, keybindingService, contextMenuService, configurationService); - //this._clearSearchAction = this.instantiationService.createInstance(ClearSearchAction, ClearSearchAction.ID, ClearSearchAction.LABEL, this); this._addServerAction = this.instantiationService.createInstance(AddServerAction, AddServerAction.ID, AddServerAction.LABEL); @@ -83,7 +80,7 @@ export class ConnectionViewletPanel extends ViewletPanel { } layoutBody(size: number): void { - this._serverTreeView.layout(size - 46); // account for search box and horizontal scroll bar + this._serverTreeView.layout(size); DOM.toggleClass(this._root, 'narrow', this._root.clientWidth < 300); } diff --git a/src/sql/workbench/parts/dataExplorer/browser/dataExplorerViewlet.ts b/src/sql/workbench/parts/dataExplorer/browser/dataExplorerViewlet.ts index 0decf2bf15..aa2e73a648 100644 --- a/src/sql/workbench/parts/dataExplorer/browser/dataExplorerViewlet.ts +++ b/src/sql/workbench/parts/dataExplorer/browser/dataExplorerViewlet.ts @@ -73,7 +73,6 @@ export class DataExplorerViewlet extends ViewContainerViewlet { @IConfigurationService configurationService: IConfigurationService ) { super(VIEWLET_ID, `${VIEWLET_ID}.state`, true, configurationService, layoutService, telemetryService, storageService, instantiationService, themeService, contextMenuService, extensionService, contextService); - this.disposables.push(this.viewletService.onDidViewletOpen(this.onViewletOpen, this, this.disposables)); } create(parent: HTMLElement): void { @@ -114,7 +113,6 @@ export class DataExplorerViewlet extends ViewContainerViewlet { protected onDidAddViews(added: IAddedViewDescriptorRef[]): ViewletPanel[] { const addedViews = super.onDidAddViews(added); - Promise.all(addedViews); return addedViews; } @@ -122,12 +120,6 @@ export class DataExplorerViewlet extends ViewContainerViewlet { return this.instantiationService.createInstance(viewDescriptor.ctorDescriptor.ctor, options) as ViewletPanel; } - private onViewletOpen(viewlet: IViewlet): void { - if (!viewlet || viewlet.getId() === VIEWLET_ID) { - return; - } - } - dispose(): void { this.disposables = dispose(this.disposables); super.dispose(); diff --git a/src/sql/workbench/parts/connection/electron-browser/media/collapsed-dark.svg b/src/sql/workbench/parts/dataExplorer/browser/media/collapsed-dark.svg similarity index 100% rename from src/sql/workbench/parts/connection/electron-browser/media/collapsed-dark.svg rename to src/sql/workbench/parts/dataExplorer/browser/media/collapsed-dark.svg diff --git a/src/sql/workbench/parts/connection/electron-browser/media/connected_active_server.svg b/src/sql/workbench/parts/dataExplorer/browser/media/connected_active_server.svg similarity index 100% rename from src/sql/workbench/parts/connection/electron-browser/media/connected_active_server.svg rename to src/sql/workbench/parts/dataExplorer/browser/media/connected_active_server.svg diff --git a/src/sql/workbench/parts/connection/electron-browser/media/connected_active_server_inverse.svg b/src/sql/workbench/parts/dataExplorer/browser/media/connected_active_server_inverse.svg similarity index 100% rename from src/sql/workbench/parts/connection/electron-browser/media/connected_active_server_inverse.svg rename to src/sql/workbench/parts/dataExplorer/browser/media/connected_active_server_inverse.svg diff --git a/src/sql/workbench/parts/connection/electron-browser/media/connectionViewlet.css b/src/sql/workbench/parts/dataExplorer/browser/media/connectionViewletPanel.css similarity index 99% rename from src/sql/workbench/parts/connection/electron-browser/media/connectionViewlet.css rename to src/sql/workbench/parts/dataExplorer/browser/media/connectionViewletPanel.css index bdf8f0b80a..49e7b4edf7 100644 --- a/src/sql/workbench/parts/connection/electron-browser/media/connectionViewlet.css +++ b/src/sql/workbench/parts/dataExplorer/browser/media/connectionViewletPanel.css @@ -29,7 +29,7 @@ } .server-explorer-viewlet .object-explorer-view { - height: calc(100% - 36px); + height: 100%; } .server-explorer-viewlet .server-group { diff --git a/src/sql/workbench/parts/connection/electron-browser/media/disconnected_server.svg b/src/sql/workbench/parts/dataExplorer/browser/media/disconnected_server.svg similarity index 100% rename from src/sql/workbench/parts/connection/electron-browser/media/disconnected_server.svg rename to src/sql/workbench/parts/dataExplorer/browser/media/disconnected_server.svg diff --git a/src/sql/workbench/parts/connection/electron-browser/media/disconnected_server_inverse.svg b/src/sql/workbench/parts/dataExplorer/browser/media/disconnected_server_inverse.svg similarity index 100% rename from src/sql/workbench/parts/connection/electron-browser/media/disconnected_server_inverse.svg rename to src/sql/workbench/parts/dataExplorer/browser/media/disconnected_server_inverse.svg diff --git a/src/sql/workbench/parts/connection/electron-browser/media/expanded-dark.svg b/src/sql/workbench/parts/dataExplorer/browser/media/expanded-dark.svg similarity index 100% rename from src/sql/workbench/parts/connection/electron-browser/media/expanded-dark.svg rename to src/sql/workbench/parts/dataExplorer/browser/media/expanded-dark.svg diff --git a/src/vs/workbench/workbench.main.ts b/src/vs/workbench/workbench.main.ts index 8e85486d86..6c90751fb2 100644 --- a/src/vs/workbench/workbench.main.ts +++ b/src/vs/workbench/workbench.main.ts @@ -448,7 +448,6 @@ import 'sql/workbench/parts/dataExplorer/browser/dataExplorerExtensionPoint'; import 'sql/workbench/parts/dataExplorer/electron-browser/nodeActions.contribution'; import 'sql/platform/telemetry/telemetry.contribution'; -import 'sql/workbench/parts/connection/electron-browser/connectionViewlet'; import 'sql/workbench/api/node/sqlExtHost.contribution'; import 'sql/workbench/parts/connection/browser/connection.contribution'; import 'sql/parts/query/common/query.contribution';