mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-25 17:23:10 -05:00
No unused locals (#8231)
* add no unused local * fix strict null * fix compile errors * update vscode comments
This commit is contained in:
@@ -72,7 +72,6 @@ export class MainThreadModelView extends Disposable implements MainThreadModelVi
|
||||
}
|
||||
|
||||
$registerEvent(handle: number, componentId: string): Thenable<void> {
|
||||
let properties: { [key: string]: any; } = { eventName: this.onEvent };
|
||||
return this.execModelViewAction(handle, (modelView) => {
|
||||
this._register(modelView.onEvent(e => {
|
||||
if (e.componentId && e.componentId === componentId) {
|
||||
|
||||
@@ -16,7 +16,6 @@ import { ModelViewInput, ModelViewInputModel, ModeViewSaveHandler } from 'sql/wo
|
||||
|
||||
import * as vscode from 'vscode';
|
||||
import * as azdata from 'azdata';
|
||||
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
|
||||
@extHostNamedCustomer(SqlMainContext.MainThreadModelViewDialog)
|
||||
export class MainThreadModelViewDialog implements MainThreadModelViewDialogShape {
|
||||
@@ -33,8 +32,7 @@ export class MainThreadModelViewDialog implements MainThreadModelViewDialogShape
|
||||
constructor(
|
||||
context: IExtHostContext,
|
||||
@IInstantiationService private _instatiationService: IInstantiationService,
|
||||
@IEditorService private _editorService: IEditorService,
|
||||
@ITelemetryService private _telemetryService: ITelemetryService
|
||||
@IEditorService private _editorService: IEditorService
|
||||
) {
|
||||
this._proxy = context.getProxy(SqlExtHostContext.ExtHostModelViewDialog);
|
||||
this._dialogService = new CustomDialogService(_instatiationService);
|
||||
|
||||
@@ -8,7 +8,7 @@ import { Event, Emitter } from 'vs/base/common/event';
|
||||
|
||||
import * as azdata from 'azdata';
|
||||
|
||||
import { ExtHostDashboardShape, MainThreadDashboardShape, SqlMainContext } from './sqlExtHost.protocol';
|
||||
import { ExtHostDashboardShape } from './sqlExtHost.protocol';
|
||||
|
||||
export class ExtHostDashboard implements ExtHostDashboardShape {
|
||||
private _onDidOpenDashboard = new Emitter<azdata.DashboardDocument>();
|
||||
@@ -17,10 +17,7 @@ export class ExtHostDashboard implements ExtHostDashboardShape {
|
||||
private _onDidChangeToDashboard = new Emitter<azdata.DashboardDocument>();
|
||||
public readonly onDidChangeToDashboard: Event<azdata.DashboardDocument> = this._onDidChangeToDashboard.event;
|
||||
|
||||
private _proxy: MainThreadDashboardShape;
|
||||
|
||||
constructor(mainContext: IMainContext) {
|
||||
this._proxy = mainContext.getProxy(SqlMainContext.MainThreadDashboard);
|
||||
}
|
||||
|
||||
$onDidOpenDashboard(dashboard: azdata.DashboardDocument) {
|
||||
|
||||
@@ -24,7 +24,6 @@ class ModelBuilderImpl implements azdata.ModelBuilder {
|
||||
constructor(
|
||||
private readonly _proxy: MainThreadModelViewShape,
|
||||
private readonly _handle: number,
|
||||
private readonly _mainContext: IMainContext,
|
||||
private readonly _extHostModelViewTree: ExtHostModelViewTreeViewsShape,
|
||||
private readonly _extension: IExtensionDescription
|
||||
) {
|
||||
@@ -742,14 +741,6 @@ class ComponentWithIconWrapper extends ComponentWrapper {
|
||||
}
|
||||
}
|
||||
|
||||
class ContainerWrapper<T, U> extends ComponentWrapper implements azdata.Container<T, U> {
|
||||
|
||||
constructor(proxy: MainThreadModelViewShape, handle: number, type: ModelComponentTypes, id: string) {
|
||||
super(proxy, handle, type, id);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class CardWrapper extends ComponentWrapper implements azdata.CardComponent {
|
||||
|
||||
constructor(proxy: MainThreadModelViewShape, handle: number, id: string) {
|
||||
@@ -1580,11 +1571,10 @@ class ModelViewImpl implements azdata.ModelView {
|
||||
private readonly _handle: number,
|
||||
private readonly _connection: azdata.connection.Connection,
|
||||
private readonly _serverInfo: azdata.ServerInfo,
|
||||
private readonly mainContext: IMainContext,
|
||||
private readonly _extHostModelViewTree: ExtHostModelViewTreeViewsShape,
|
||||
_extension: IExtensionDescription
|
||||
) {
|
||||
this._modelBuilder = new ModelBuilderImpl(this._proxy, this._handle, this.mainContext, this._extHostModelViewTree, _extension);
|
||||
this._modelBuilder = new ModelBuilderImpl(this._proxy, this._handle, this._extHostModelViewTree, _extension);
|
||||
}
|
||||
|
||||
public get onClosed(): vscode.Event<any> {
|
||||
@@ -1637,7 +1627,7 @@ export class ExtHostModelView implements ExtHostModelViewShape {
|
||||
private readonly _handlers = new Map<string, (view: azdata.ModelView) => void>();
|
||||
private readonly _handlerToExtension = new Map<string, IExtensionDescription>();
|
||||
constructor(
|
||||
private _mainContext: IMainContext,
|
||||
_mainContext: IMainContext,
|
||||
private _extHostModelViewTree: ExtHostModelViewTreeViewsShape
|
||||
) {
|
||||
this._proxy = _mainContext.getProxy(SqlMainContext.MainThreadModelView);
|
||||
@@ -1657,7 +1647,7 @@ export class ExtHostModelView implements ExtHostModelViewShape {
|
||||
|
||||
$registerWidget(handle: number, id: string, connection: azdata.connection.Connection, serverInfo: azdata.ServerInfo): void {
|
||||
let extension = this._handlerToExtension.get(id);
|
||||
let view = new ModelViewImpl(this._proxy, handle, connection, serverInfo, this._mainContext, this._extHostModelViewTree, extension);
|
||||
let view = new ModelViewImpl(this._proxy, handle, connection, serverInfo, this._extHostModelViewTree, extension);
|
||||
this._modelViews.set(handle, view);
|
||||
this._handlers.get(id)(view);
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ export default class ButtonComponent extends ComponentWithIconBase implements IC
|
||||
@Input() descriptor: IComponentDescriptor;
|
||||
@Input() modelStore: IModelStore;
|
||||
private _button: Button;
|
||||
private fileType: string = '.sql';
|
||||
public fileType: string = '.sql';
|
||||
|
||||
@ViewChild('input', { read: ElementRef }) private _inputContainer: ElementRef;
|
||||
@ViewChild('fileInput', { read: ElementRef }) private _fileInputContainer: ElementRef;
|
||||
@@ -153,11 +153,11 @@ export default class ButtonComponent extends ComponentWithIconBase implements IC
|
||||
this.setPropertyFromUI<azdata.ButtonProperties, string>(this.setValueProperties, newValue);
|
||||
}
|
||||
|
||||
private get isFile(): boolean {
|
||||
public get isFile(): boolean {
|
||||
return this.getPropertyOrDefault<azdata.ButtonProperties, boolean>((props) => props.isFile, false);
|
||||
}
|
||||
|
||||
private set isFile(newValue: boolean) {
|
||||
public set isFile(newValue: boolean) {
|
||||
this.setPropertyFromUI<azdata.ButtonProperties, boolean>(this.setFileProperties, newValue);
|
||||
}
|
||||
|
||||
@@ -188,8 +188,4 @@ export default class ButtonComponent extends ComponentWithIconBase implements IC
|
||||
private set title(newValue: string) {
|
||||
this.setPropertyFromUI<azdata.ButtonProperties, string>((properties, title) => { properties.title = title; }, newValue);
|
||||
}
|
||||
|
||||
private setFileType(value: string) {
|
||||
this.properties.fileType = value;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -186,7 +186,7 @@ export default class CardComponent extends ComponentWithIconBase implements ICom
|
||||
this._changeRef.detectChanges();
|
||||
}
|
||||
|
||||
private onDidActionClick(action: ActionDescriptor): void {
|
||||
public onDidActionClick(action: ActionDescriptor): void {
|
||||
this.fireEvent({
|
||||
eventType: ComponentEventType.onDidClick,
|
||||
args: action
|
||||
|
||||
@@ -13,7 +13,6 @@ import * as azdata from 'azdata';
|
||||
import { ComponentBase } from 'sql/workbench/browser/modelComponents/componentBase';
|
||||
import { IComponent, IComponentDescriptor, IModelStore, ComponentEventType } from 'sql/workbench/browser/modelComponents/interfaces';
|
||||
import { Checkbox, ICheckboxOptions } from 'sql/base/browser/ui/checkbox/checkbox';
|
||||
import { CommonServiceInterface } from 'sql/workbench/services/bootstrap/browser/commonServiceInterface.service';
|
||||
import { attachCheckboxStyler } from 'sql/platform/theme/common/styler';
|
||||
import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService';
|
||||
|
||||
@@ -30,7 +29,6 @@ export default class CheckBoxComponent extends ComponentBase implements ICompone
|
||||
|
||||
@ViewChild('input', { read: ElementRef }) private _inputContainer: ElementRef;
|
||||
constructor(
|
||||
@Inject(forwardRef(() => CommonServiceInterface)) private _commonService: CommonServiceInterface,
|
||||
@Inject(forwardRef(() => ChangeDetectorRef)) changeRef: ChangeDetectorRef,
|
||||
@Inject(IWorkbenchThemeService) private themeService: IWorkbenchThemeService,
|
||||
@Inject(forwardRef(() => ElementRef)) el: ElementRef, ) {
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
import 'vs/css!./media/declarativeTable';
|
||||
|
||||
import {
|
||||
Component, Input, Inject, ChangeDetectorRef, forwardRef, ViewChild, ElementRef, OnDestroy, AfterViewInit
|
||||
Component, Input, Inject, ChangeDetectorRef, forwardRef, ElementRef, OnDestroy, AfterViewInit
|
||||
} from '@angular/core';
|
||||
|
||||
import * as azdata from 'azdata';
|
||||
@@ -39,8 +39,8 @@ export enum DeclarativeDataType {
|
||||
<ng-container *ngFor="let cellData of row;let c = index">
|
||||
<td class="declarative-table-cell" tabindex="-1" [style.width]="getColumnWidth(c)" [attr.aria-label]="getAriaLabel(r, c)" >
|
||||
<checkbox *ngIf="isCheckBox(c)" label="" (onChange)="onCheckBoxChanged($event,r,c)" [enabled]="isControlEnabled(c)" [checked]="isChecked(r,c)"></checkbox>
|
||||
<select-box *ngIf="isSelectBox(c)" [options]="GetOptions(c)" (onDidSelect)="onSelectBoxChanged($event,r,c)" [selectedOption]="GetSelectedOptionDisplayName(r,c)"></select-box>
|
||||
<editable-select-box *ngIf="isEditableSelectBox(c)" [options]="GetOptions(c)" (onDidSelect)="onSelectBoxChanged($event,r,c)" [selectedOption]="GetSelectedOptionDisplayName(r,c)"></editable-select-box>
|
||||
<select-box *ngIf="isSelectBox(c)" [options]="getOptions(c)" (onDidSelect)="onSelectBoxChanged($event,r,c)" [selectedOption]="getSelectedOptionDisplayName(r,c)"></select-box>
|
||||
<editable-select-box *ngIf="isEditableSelectBox(c)" [options]="getOptions(c)" (onDidSelect)="onSelectBoxChanged($event,r,c)" [selectedOption]="getSelectedOptionDisplayName(r,c)"></editable-select-box>
|
||||
<input-box *ngIf="isInputBox(c)" [value]="cellData" (onDidChange)="onInputBoxChanged($event,r,c)"></input-box>
|
||||
<ng-container *ngIf="isLabel(c)" >{{cellData}}</ng-container>
|
||||
</td>
|
||||
@@ -55,7 +55,6 @@ export default class DeclarativeTableComponent extends ComponentBase implements
|
||||
@Input() descriptor: IComponentDescriptor;
|
||||
@Input() modelStore: IModelStore;
|
||||
|
||||
@ViewChild('container', { read: ElementRef }) private _tableContainer: ElementRef;
|
||||
constructor(
|
||||
@Inject(forwardRef(() => ChangeDetectorRef)) changeRef: ChangeDetectorRef,
|
||||
@Inject(forwardRef(() => ElementRef)) el: ElementRef
|
||||
@@ -80,12 +79,12 @@ export default class DeclarativeTableComponent extends ComponentBase implements
|
||||
this.baseDestroy();
|
||||
}
|
||||
|
||||
private isCheckBox(cell: number): boolean {
|
||||
public isCheckBox(cell: number): boolean {
|
||||
let column: azdata.DeclarativeTableColumn = this.columns[cell];
|
||||
return column.valueType === DeclarativeDataType.boolean;
|
||||
}
|
||||
|
||||
private isControlEnabled(cell: number): boolean {
|
||||
public isControlEnabled(cell: number): boolean {
|
||||
let column: azdata.DeclarativeTableColumn = this.columns[cell];
|
||||
return !column.isReadOnly;
|
||||
}
|
||||
@@ -95,20 +94,20 @@ export default class DeclarativeTableComponent extends ComponentBase implements
|
||||
return column.isReadOnly && column.valueType === DeclarativeDataType.string;
|
||||
}
|
||||
|
||||
private isChecked(row: number, cell: number): boolean {
|
||||
public isChecked(row: number, cell: number): boolean {
|
||||
let cellData = this.data[row][cell];
|
||||
return cellData;
|
||||
}
|
||||
|
||||
private onInputBoxChanged(e: string, row: number, cell: number): void {
|
||||
public onInputBoxChanged(e: string, row: number, cell: number): void {
|
||||
this.onCellDataChanged(e, row, cell);
|
||||
}
|
||||
|
||||
private onCheckBoxChanged(e: boolean, row: number, cell: number): void {
|
||||
public onCheckBoxChanged(e: boolean, row: number, cell: number): void {
|
||||
this.onCellDataChanged(e, row, cell);
|
||||
}
|
||||
|
||||
private onSelectBoxChanged(e: ISelectData | string, row: number, cell: number): void {
|
||||
public onSelectBoxChanged(e: ISelectData | string, row: number, cell: number): void {
|
||||
|
||||
let column: azdata.DeclarativeTableColumn = this.columns[cell];
|
||||
if (column.categoryValues) {
|
||||
@@ -139,7 +138,7 @@ export default class DeclarativeTableComponent extends ComponentBase implements
|
||||
});
|
||||
}
|
||||
|
||||
private isSelectBox(cell: number): boolean {
|
||||
public isSelectBox(cell: number): boolean {
|
||||
let column: azdata.DeclarativeTableColumn = this.columns[cell];
|
||||
return column.valueType === DeclarativeDataType.category;
|
||||
}
|
||||
@@ -149,22 +148,22 @@ export default class DeclarativeTableComponent extends ComponentBase implements
|
||||
return column.valueType === DeclarativeDataType.editableCategory;
|
||||
}
|
||||
|
||||
private isInputBox(cell: number): boolean {
|
||||
public isInputBox(cell: number): boolean {
|
||||
let column: azdata.DeclarativeTableColumn = this.columns[cell];
|
||||
return column.valueType === DeclarativeDataType.string && !column.isReadOnly;
|
||||
}
|
||||
|
||||
private getColumnWidth(cell: number): string {
|
||||
public getColumnWidth(cell: number): string {
|
||||
let column: azdata.DeclarativeTableColumn = this.columns[cell];
|
||||
return this.convertSize(column.width, '30px');
|
||||
}
|
||||
|
||||
private GetOptions(cell: number): string[] {
|
||||
public getOptions(cell: number): string[] {
|
||||
let column: azdata.DeclarativeTableColumn = this.columns[cell];
|
||||
return column.categoryValues ? column.categoryValues.map(x => x.displayName) : [];
|
||||
}
|
||||
|
||||
private GetSelectedOptionDisplayName(row: number, cell: number): string {
|
||||
public getSelectedOptionDisplayName(row: number, cell: number): string {
|
||||
let column: azdata.DeclarativeTableColumn = this.columns[cell];
|
||||
let cellData = this.data[row][cell];
|
||||
if (cellData && column.categoryValues) {
|
||||
@@ -181,7 +180,7 @@ export default class DeclarativeTableComponent extends ComponentBase implements
|
||||
}
|
||||
}
|
||||
|
||||
private getAriaLabel(row: number, column: number): string {
|
||||
public getAriaLabel(row: number, column: number): string {
|
||||
const cellData = this.data[row][column];
|
||||
return this.isLabel(column) ? (cellData && cellData !== '' ? cellData : localize('blankValue', "blank")) : '';
|
||||
}
|
||||
|
||||
@@ -47,7 +47,6 @@ export default class DiffEditorComponent extends ComponentBase implements ICompo
|
||||
private _languageMode: string;
|
||||
private _isAutoResizable: boolean;
|
||||
private _minimumHeight: number;
|
||||
private _instancetiationService: IInstantiationService;
|
||||
protected _title: string;
|
||||
|
||||
constructor(
|
||||
|
||||
@@ -133,7 +133,7 @@ export default class DivContainer extends ContainerBase<azdata.DivItemLayout> im
|
||||
return this.getPropertyOrDefault<azdata.DivContainerProperties, boolean>((props) => props.clickable, false);
|
||||
}
|
||||
|
||||
private onKey(e: KeyboardEvent) {
|
||||
public onKey(e: KeyboardEvent) {
|
||||
let event = new StandardKeyboardEvent(e);
|
||||
if (event.equals(KeyCode.Enter) || event.equals(KeyCode.Space)) {
|
||||
this.onClick();
|
||||
@@ -141,10 +141,10 @@ export default class DivContainer extends ContainerBase<azdata.DivItemLayout> im
|
||||
}
|
||||
}
|
||||
|
||||
private getItemOrder(item: DivItem): number {
|
||||
public getItemOrder(item: DivItem): number {
|
||||
return item.config ? item.config.order : 0;
|
||||
}
|
||||
private getItemStyles(item: DivItem): { [key: string]: string } {
|
||||
public getItemStyles(item: DivItem): { [key: string]: string } {
|
||||
return item.config && item.config.CSSStyles ? item.config.CSSStyles : {};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -113,13 +113,13 @@ export default class FlexContainer extends ContainerBase<FlexItemLayout> impleme
|
||||
return this._flexWrap;
|
||||
}
|
||||
|
||||
private getItemFlex(item: FlexItem): string {
|
||||
public getItemFlex(item: FlexItem): string {
|
||||
return item.config ? item.config.flex : '1 1 auto';
|
||||
}
|
||||
private getItemOrder(item: FlexItem): number {
|
||||
public getItemOrder(item: FlexItem): number {
|
||||
return item.config ? item.config.order : 0;
|
||||
}
|
||||
private getItemStyles(item: FlexItem): { [key: string]: string } {
|
||||
public getItemStyles(item: FlexItem): { [key: string]: string } {
|
||||
return item.config && item.config.CSSStyles ? item.config.CSSStyles : {};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,14 +6,13 @@ import 'vs/css!./media/formLayout';
|
||||
|
||||
import {
|
||||
Component, Input, Inject, ChangeDetectorRef, forwardRef,
|
||||
ViewChild, ElementRef, OnDestroy, AfterViewInit
|
||||
ElementRef, OnDestroy, AfterViewInit
|
||||
} from '@angular/core';
|
||||
|
||||
import { IComponent, IComponentDescriptor, IModelStore } from 'sql/workbench/browser/modelComponents/interfaces';
|
||||
import { FormLayout, FormItemLayout } from 'azdata';
|
||||
|
||||
import { ContainerBase } from 'sql/workbench/browser/modelComponents/componentBase';
|
||||
import { CommonServiceInterface } from 'sql/workbench/services/bootstrap/browser/commonServiceInterface.service';
|
||||
import { find } from 'vs/base/common/arrays';
|
||||
|
||||
export interface TitledFormItemLayout {
|
||||
@@ -95,10 +94,7 @@ export default class FormContainer extends ContainerBase<FormItemLayout> impleme
|
||||
private _alignContent: string;
|
||||
private _formLayout: FormLayout;
|
||||
|
||||
@ViewChild('container', { read: ElementRef }) private _container: ElementRef;
|
||||
|
||||
constructor(
|
||||
@Inject(forwardRef(() => CommonServiceInterface)) private _commonService: CommonServiceInterface,
|
||||
@Inject(forwardRef(() => ChangeDetectorRef)) changeRef: ChangeDetectorRef,
|
||||
@Inject(forwardRef(() => ElementRef)) el: ElementRef) {
|
||||
super(changeRef, el);
|
||||
@@ -129,39 +125,39 @@ export default class FormContainer extends ContainerBase<FormItemLayout> impleme
|
||||
return this._alignContent;
|
||||
}
|
||||
|
||||
private getFormWidth(): string {
|
||||
public getFormWidth(): string {
|
||||
return this.convertSize(this._formLayout && this._formLayout.width, '');
|
||||
}
|
||||
|
||||
private getFormPadding(): string {
|
||||
public getFormPadding(): string {
|
||||
return this._formLayout && this._formLayout.padding ? this._formLayout.padding : '10px 30px 0px 30px';
|
||||
}
|
||||
|
||||
private getFormHeight(): string {
|
||||
public getFormHeight(): string {
|
||||
return this.convertSize(this._formLayout && this._formLayout.height, '');
|
||||
}
|
||||
|
||||
private getComponentWidth(item: FormItem): string {
|
||||
public getComponentWidth(item: FormItem): string {
|
||||
let itemConfig = item.config;
|
||||
return (itemConfig && itemConfig.componentWidth) ? this.convertSize(itemConfig.componentWidth, '') : '';
|
||||
}
|
||||
|
||||
private getRowHeight(item: FormItem): string {
|
||||
public getRowHeight(item: FormItem): string {
|
||||
let itemConfig = item.config;
|
||||
return (itemConfig && itemConfig.componentHeight) ? this.convertSize(itemConfig.componentHeight, '') : '';
|
||||
}
|
||||
|
||||
private isItemRequired(item: FormItem): boolean {
|
||||
public isItemRequired(item: FormItem): boolean {
|
||||
let itemConfig = item.config;
|
||||
return itemConfig && itemConfig.required;
|
||||
}
|
||||
|
||||
private getItemInfo(item: FormItem): string {
|
||||
public getItemInfo(item: FormItem): string {
|
||||
let itemConfig = item.config;
|
||||
return itemConfig && itemConfig.info;
|
||||
}
|
||||
|
||||
private itemHasInfo(item: FormItem): boolean {
|
||||
public itemHasInfo(item: FormItem): boolean {
|
||||
let itemConfig = item.config;
|
||||
return itemConfig && itemConfig.info !== undefined;
|
||||
}
|
||||
@@ -172,11 +168,11 @@ export default class FormContainer extends ContainerBase<FormItemLayout> impleme
|
||||
return itemConfig ? itemConfig.title : '';
|
||||
}
|
||||
|
||||
private hasItemTitle(item: FormItem): boolean {
|
||||
public hasItemTitle(item: FormItem): boolean {
|
||||
return this.getItemTitle(item) !== '';
|
||||
}
|
||||
|
||||
private getItemTitleFontSize(item: FormItem): string {
|
||||
public getItemTitleFontSize(item: FormItem): string {
|
||||
let defaultFontSize = '14px';
|
||||
if (this.isInGroup(item)) {
|
||||
defaultFontSize = '12px';
|
||||
@@ -185,7 +181,7 @@ export default class FormContainer extends ContainerBase<FormItemLayout> impleme
|
||||
return itemConfig && itemConfig.titleFontSize ? this.convertSize(itemConfig.titleFontSize, defaultFontSize) : defaultFontSize;
|
||||
}
|
||||
|
||||
private getActionComponents(item: FormItem): FormItem[] {
|
||||
public getActionComponents(item: FormItem): FormItem[] {
|
||||
let items = this.items;
|
||||
let itemConfig = item.config;
|
||||
if (itemConfig && itemConfig.actions) {
|
||||
@@ -200,7 +196,7 @@ export default class FormContainer extends ContainerBase<FormItemLayout> impleme
|
||||
return [];
|
||||
}
|
||||
|
||||
private isGroupLabel(item: FormItem): boolean {
|
||||
public isGroupLabel(item: FormItem): boolean {
|
||||
return item && item.config && item.config.isGroupLabel;
|
||||
}
|
||||
|
||||
@@ -208,11 +204,11 @@ export default class FormContainer extends ContainerBase<FormItemLayout> impleme
|
||||
return item && item.config && item.config.isInGroup;
|
||||
}
|
||||
|
||||
private isFormComponent(item: FormItem): boolean {
|
||||
public isFormComponent(item: FormItem): boolean {
|
||||
return item && item.config && item.config.isFormComponent;
|
||||
}
|
||||
|
||||
private itemHasActions(item: FormItem): boolean {
|
||||
public itemHasActions(item: FormItem): boolean {
|
||||
let itemConfig = item.config;
|
||||
return itemConfig && itemConfig.actions !== undefined && itemConfig.actions.length > 0;
|
||||
}
|
||||
@@ -222,11 +218,11 @@ export default class FormContainer extends ContainerBase<FormItemLayout> impleme
|
||||
this.layout();
|
||||
}
|
||||
|
||||
private isHorizontal(item: FormItem): boolean {
|
||||
public isHorizontal(item: FormItem): boolean {
|
||||
return item && item.config && item.config.horizontal;
|
||||
}
|
||||
|
||||
private isVertical(item: FormItem): boolean {
|
||||
public isVertical(item: FormItem): boolean {
|
||||
return item && item.config && !item.config.horizontal;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import 'vs/css!./media/groupLayout';
|
||||
|
||||
import {
|
||||
Component, Input, Inject, ChangeDetectorRef, forwardRef,
|
||||
ViewChild, ElementRef, OnDestroy, AfterViewInit
|
||||
ElementRef, OnDestroy, AfterViewInit
|
||||
} from '@angular/core';
|
||||
|
||||
import { IComponent, IComponentDescriptor, IModelStore } from 'sql/workbench/browser/modelComponents/interfaces';
|
||||
@@ -39,8 +39,6 @@ export default class GroupContainer extends ContainerBase<GroupLayout> implement
|
||||
|
||||
private _containerLayout: GroupLayout;
|
||||
|
||||
@ViewChild('container', { read: ElementRef }) private _container: ElementRef;
|
||||
|
||||
constructor(
|
||||
@Inject(forwardRef(() => ChangeDetectorRef)) changeRef: ChangeDetectorRef,
|
||||
@Inject(forwardRef(() => ElementRef)) el: ElementRef) {
|
||||
@@ -83,7 +81,7 @@ export default class GroupContainer extends ContainerBase<GroupLayout> implement
|
||||
return this.hasHeader() && this._containerLayout.collapsible === true;
|
||||
}
|
||||
|
||||
private getContainerWidth(): string {
|
||||
public getContainerWidth(): string {
|
||||
if (this._containerLayout && this._containerLayout.width) {
|
||||
let width: string = this._containerLayout.width.toString();
|
||||
if (!endsWith(width, '%') && !endsWith(width.toLowerCase(), 'px')) {
|
||||
@@ -95,11 +93,11 @@ export default class GroupContainer extends ContainerBase<GroupLayout> implement
|
||||
}
|
||||
}
|
||||
|
||||
private getContainerDisplayStyle(): string {
|
||||
public getContainerDisplayStyle(): string {
|
||||
return !this.isCollapsible() || !this.collapsed ? 'block' : 'none';
|
||||
}
|
||||
|
||||
private getHeaderClass(): string {
|
||||
public getHeaderClass(): string {
|
||||
if (this.isCollapsible()) {
|
||||
let modifier = this.collapsed ? 'collapsed' : 'expanded';
|
||||
return `modelview-group-header-collapsible ${modifier}`;
|
||||
@@ -108,7 +106,7 @@ export default class GroupContainer extends ContainerBase<GroupLayout> implement
|
||||
}
|
||||
}
|
||||
|
||||
private changeState(): void {
|
||||
public changeState(): void {
|
||||
if (this.isCollapsible()) {
|
||||
this.collapsed = !this.collapsed;
|
||||
this._changeRef.detectChanges();
|
||||
|
||||
@@ -65,7 +65,7 @@ export default class ImageComponent extends ComponentWithIconBase implements ICo
|
||||
/**
|
||||
* Helper to get the size string for the background-size CSS property
|
||||
*/
|
||||
private getImageSize(): string {
|
||||
public getImageSize(): string {
|
||||
return `${this.getIconWidth()} ${this.getIconHeight()}`;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ import * as nls from 'vs/nls';
|
||||
`
|
||||
})
|
||||
export default class LoadingComponent extends ComponentBase implements IComponent, OnDestroy, AfterViewInit {
|
||||
private readonly _loadingTitle = nls.localize('loadingMessage', "Loading");
|
||||
public readonly _loadingTitle = nls.localize('loadingMessage', "Loading");
|
||||
private _component: IComponentDescriptor;
|
||||
|
||||
@Input() descriptor: IComponentDescriptor;
|
||||
|
||||
@@ -17,7 +17,7 @@ import * as nls from 'vs/nls';
|
||||
`
|
||||
})
|
||||
export default class LoadingSpinner {
|
||||
private readonly _loadingTitle = nls.localize('loadingMessage', "Loading");
|
||||
public readonly _loadingTitle = nls.localize('loadingMessage', "Loading");
|
||||
|
||||
@Input() loading: boolean;
|
||||
}
|
||||
|
||||
@@ -15,7 +15,6 @@ class ComponentDescriptor implements IComponentDescriptor {
|
||||
}
|
||||
|
||||
export class ModelStore implements IModelStore {
|
||||
private static baseId = 0;
|
||||
|
||||
private _descriptorMappings: { [x: string]: IComponentDescriptor } = {};
|
||||
private _componentMappings: { [x: string]: IComponent } = {};
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
import { Component, forwardRef, Input, OnInit, Inject, ChangeDetectorRef } from '@angular/core';
|
||||
|
||||
import { Event, Emitter } from 'vs/base/common/event';
|
||||
import { IDisposable } from 'vs/base/common/lifecycle';
|
||||
import { addDisposableListener, EventType } from 'vs/base/browser/dom';
|
||||
import { memoize } from 'vs/base/common/decorators';
|
||||
|
||||
@@ -34,8 +33,6 @@ export class ModelViewContent extends ViewBase implements OnInit, IModelView {
|
||||
private _onMessage = new Emitter<string>();
|
||||
public readonly onMessage: Event<string> = this._onMessage.event;
|
||||
|
||||
private _onMessageDisposable: IDisposable;
|
||||
|
||||
constructor(
|
||||
@Inject(forwardRef(() => CommonServiceInterface)) private _commonService: CommonServiceInterface,
|
||||
@Inject(forwardRef(() => ChangeDetectorRef)) changeRef: ChangeDetectorRef,
|
||||
|
||||
@@ -162,13 +162,13 @@ export default class SplitViewContainer extends ContainerBase<FlexItemLayout> im
|
||||
return this._orientation.toString();
|
||||
}
|
||||
|
||||
private getItemFlex(item: FlexItem): string {
|
||||
public getItemFlex(item: FlexItem): string {
|
||||
return item.config ? item.config.flex : '1 1 auto';
|
||||
}
|
||||
private getItemOrder(item: FlexItem): number {
|
||||
public getItemOrder(item: FlexItem): number {
|
||||
return item.config ? item.config.order : 0;
|
||||
}
|
||||
private getItemStyles(item: FlexItem): { [key: string]: string } {
|
||||
public getItemStyles(item: FlexItem): { [key: string]: string } {
|
||||
return item.config && item.config.CSSStyles ? item.config.CSSStyles : {};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ export default class TextComponent extends TitledComponent implements IComponent
|
||||
return this.requiredIndicator || !!this.description;
|
||||
}
|
||||
|
||||
private onClick() {
|
||||
public onClick() {
|
||||
this.fireEvent({
|
||||
eventType: ComponentEventType.onDidClick,
|
||||
args: undefined
|
||||
|
||||
@@ -6,7 +6,7 @@ import 'vs/css!./media/toolbarLayout';
|
||||
|
||||
import {
|
||||
Component, Input, Inject, ChangeDetectorRef, forwardRef,
|
||||
ViewChild, ElementRef, OnDestroy, AfterViewInit
|
||||
ElementRef, OnDestroy, AfterViewInit
|
||||
} from '@angular/core';
|
||||
|
||||
import { Orientation, ToolbarLayout } from 'sql/workbench/api/common/sqlExtHostTypes';
|
||||
@@ -14,7 +14,6 @@ import { Orientation, ToolbarLayout } from 'sql/workbench/api/common/sqlExtHostT
|
||||
import { IComponent, IComponentDescriptor, IModelStore } from 'sql/workbench/browser/modelComponents/interfaces';
|
||||
|
||||
import { ContainerBase } from 'sql/workbench/browser/modelComponents/componentBase';
|
||||
import { CommonServiceInterface } from 'sql/workbench/services/bootstrap/browser/commonServiceInterface.service';
|
||||
|
||||
export interface ToolbarItemConfig {
|
||||
title?: string;
|
||||
@@ -49,12 +48,9 @@ export default class ToolbarContainer extends ContainerBase<ToolbarItemConfig> i
|
||||
@Input() descriptor: IComponentDescriptor;
|
||||
@Input() modelStore: IModelStore;
|
||||
|
||||
@ViewChild('container', { read: ElementRef }) private _container: ElementRef;
|
||||
|
||||
private _orientation: Orientation;
|
||||
|
||||
constructor(
|
||||
@Inject(forwardRef(() => CommonServiceInterface)) private _commonService: CommonServiceInterface,
|
||||
@Inject(forwardRef(() => ChangeDetectorRef)) changeRef: ChangeDetectorRef,
|
||||
@Inject(forwardRef(() => ElementRef)) el: ElementRef) {
|
||||
super(changeRef, el);
|
||||
|
||||
@@ -14,11 +14,9 @@ import * as azdata from 'azdata';
|
||||
import { ComponentBase } from 'sql/workbench/browser/modelComponents/componentBase';
|
||||
import { IComponent, IComponentDescriptor, IModelStore } from 'sql/workbench/browser/modelComponents/interfaces';
|
||||
import { Tree } from 'vs/base/parts/tree/browser/treeImpl';
|
||||
import { CommonServiceInterface } from 'sql/workbench/services/bootstrap/browser/commonServiceInterface.service';
|
||||
import { TreeComponentRenderer } from 'sql/workbench/browser/modelComponents/treeComponentRenderer';
|
||||
import { TreeComponentDataSource } from 'sql/workbench/browser/modelComponents/treeDataSource';
|
||||
import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService';
|
||||
import { IContextViewService } from 'vs/platform/contextview/browser/contextView';
|
||||
import { attachListStyler } from 'vs/platform/theme/common/styler';
|
||||
import { DefaultFilter, DefaultAccessibilityProvider, DefaultController } from 'vs/base/parts/tree/browser/treeDefaults';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
@@ -55,10 +53,8 @@ export default class TreeComponent extends ComponentBase implements IComponent,
|
||||
|
||||
@ViewChild('input', { read: ElementRef }) private _inputContainer: ElementRef;
|
||||
constructor(
|
||||
@Inject(forwardRef(() => CommonServiceInterface)) private _commonService: CommonServiceInterface,
|
||||
@Inject(forwardRef(() => ChangeDetectorRef)) changeRef: ChangeDetectorRef,
|
||||
@Inject(IWorkbenchThemeService) private themeService: IWorkbenchThemeService,
|
||||
@Inject(IContextViewService) private contextViewService: IContextViewService,
|
||||
@Inject(IInstantiationService) private _instantiationService: IInstantiationService,
|
||||
@Inject(forwardRef(() => ElementRef)) el: ElementRef
|
||||
) {
|
||||
|
||||
@@ -7,13 +7,9 @@ import { localize } from 'vs/nls';
|
||||
import { Action } from 'vs/base/common/actions';
|
||||
import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet';
|
||||
import { IExtensionsWorkbenchService, VIEWLET_ID, IExtensionsViewlet } from 'vs/workbench/contrib/extensions/common/extensions';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { IExtensionRecommendation, IExtensionManagementServerService } from 'vs/workbench/services/extensionManagement/common/extensionManagement';
|
||||
import { INotificationService } from 'vs/platform/notification/common/notification';
|
||||
import { IOpenerService } from 'vs/platform/opener/common/opener';
|
||||
import { IExtensionRecommendation } from 'vs/workbench/services/extensionManagement/common/extensionManagement';
|
||||
import { CancellationToken } from 'vs/base/common/cancellation';
|
||||
import { PagedModel } from 'vs/base/common/paging';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
|
||||
function getScenarioID(scenarioType: string) {
|
||||
return 'workbench.extensions.action.show' + scenarioType;
|
||||
@@ -46,12 +42,7 @@ export class InstallRecommendedExtensionsByScenarioAction extends Action {
|
||||
private readonly scenarioType: string,
|
||||
recommendations: IExtensionRecommendation[],
|
||||
@IViewletService private readonly viewletService: IViewletService,
|
||||
@INotificationService private readonly notificationService: INotificationService,
|
||||
@IInstantiationService private readonly instantiationService: IInstantiationService,
|
||||
@IOpenerService private readonly openerService: IOpenerService,
|
||||
@IExtensionsWorkbenchService private readonly extensionWorkbenchService: IExtensionsWorkbenchService,
|
||||
@IConfigurationService private readonly configurationService: IConfigurationService,
|
||||
@IExtensionManagementServerService private readonly extensionManagementServerService: IExtensionManagementServerService
|
||||
@IExtensionsWorkbenchService private readonly extensionWorkbenchService: IExtensionsWorkbenchService
|
||||
) {
|
||||
super(getScenarioID(scenarioType), localize('Install Extensions', "Install Extensions"), 'extension-action');
|
||||
this.recommendations = recommendations;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
import * as azdata from 'azdata';
|
||||
import * as TypeMoq from 'typemoq';
|
||||
import { Emitter, Event } from 'vs/base/common/event';
|
||||
import { Emitter } from 'vs/base/common/event';
|
||||
import { IConnectionProfile } from 'sql/platform/connection/common/interfaces';
|
||||
import { FirewallRuleDialog } from 'sql/workbench/parts/accounts/browser/firewallRuleDialog';
|
||||
import { FirewallRuleViewModel } from 'sql/platform/accounts/common/firewallRuleViewModel';
|
||||
|
||||
@@ -28,7 +28,6 @@ import * as strings from 'vs/base/common/strings';
|
||||
import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService';
|
||||
import { IContextViewService } from 'vs/platform/contextview/browser/contextView';
|
||||
import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { ISelectOptionItem } from 'vs/base/browser/ui/selectBox/selectBox';
|
||||
import { KeyCode } from 'vs/base/common/keyCodes';
|
||||
import { ITheme } from 'vs/platform/theme/common/themeService';
|
||||
@@ -148,7 +147,6 @@ export class BackupComponent extends AngularDisposable {
|
||||
private localizedStrings = LocalizedStrings;
|
||||
|
||||
private _uri: string;
|
||||
private _advancedHeaderSize = 32;
|
||||
|
||||
private connection: IConnectionProfile;
|
||||
private databaseName: string;
|
||||
@@ -158,16 +156,15 @@ export class BackupComponent extends AngularDisposable {
|
||||
private containsBackupToUrl: boolean;
|
||||
|
||||
// UI element disable flag
|
||||
private disableFileComponent: boolean;
|
||||
private disableTlog: boolean;
|
||||
public disableTlog: boolean;
|
||||
|
||||
private selectedBackupComponent: string;
|
||||
public selectedBackupComponent: string;
|
||||
private selectedFilesText: string;
|
||||
private selectedInitOption: string;
|
||||
private isTruncateChecked: boolean;
|
||||
private isTaillogChecked: boolean;
|
||||
private isFormatChecked: boolean;
|
||||
private isEncryptChecked: boolean;
|
||||
public isEncryptChecked: boolean;
|
||||
// Key: backup path, Value: device type
|
||||
private backupPathTypePairs: { [path: string]: number };
|
||||
|
||||
@@ -198,7 +195,6 @@ export class BackupComponent extends AngularDisposable {
|
||||
private continueOnErrorCheckBox: Checkbox;
|
||||
|
||||
constructor(
|
||||
@Inject(forwardRef(() => ElementRef)) private _el: ElementRef,
|
||||
@Inject(forwardRef(() => ChangeDetectorRef)) private _changeDetectorRef: ChangeDetectorRef,
|
||||
@Inject(IWorkbenchThemeService) private themeService: IWorkbenchThemeService,
|
||||
@Inject(IContextViewService) private contextViewService: IContextViewService,
|
||||
@@ -207,7 +203,6 @@ export class BackupComponent extends AngularDisposable {
|
||||
@Inject(IBackupService) private _backupService: IBackupService,
|
||||
@Inject(IClipboardService) private clipboardService: IClipboardService,
|
||||
@Inject(IConnectionManagementService) private connectionManagementService: IConnectionManagementService,
|
||||
@Inject(IInstantiationService) private instantiationService: IInstantiationService
|
||||
) {
|
||||
super();
|
||||
this._backupUiService.onShowBackupEvent((param) => this.onGetBackupConfigInfo(param));
|
||||
@@ -602,7 +597,7 @@ export class BackupComponent extends AngularDisposable {
|
||||
this.resetDialog();
|
||||
}
|
||||
|
||||
private onChangeTlog(): void {
|
||||
public onChangeTlog(): void {
|
||||
this.isTruncateChecked = !this.isTruncateChecked;
|
||||
this.isTaillogChecked = !this.isTaillogChecked;
|
||||
this.detectChange();
|
||||
@@ -727,9 +722,6 @@ export class BackupComponent extends AngularDisposable {
|
||||
private setControlsForRecoveryModel(): void {
|
||||
if (this.recoveryModel === BackupConstants.recoveryModelSimple) {
|
||||
this.selectedBackupComponent = BackupConstants.labelDatabase;
|
||||
this.disableFileComponent = true;
|
||||
} else {
|
||||
this.disableFileComponent = false;
|
||||
}
|
||||
|
||||
this.populateBackupTypes();
|
||||
@@ -778,20 +770,6 @@ export class BackupComponent extends AngularDisposable {
|
||||
}
|
||||
}
|
||||
|
||||
private isBackupToFile(controllerType: number): boolean {
|
||||
let isfile = false;
|
||||
if (controllerType === 102) {
|
||||
isfile = true;
|
||||
} else if (controllerType === 105) {
|
||||
isfile = false;
|
||||
} else if (controllerType === BackupConstants.backupDeviceTypeDisk) {
|
||||
isfile = true;
|
||||
} else if (controllerType === BackupConstants.backupDeviceTypeTape || controllerType === BackupConstants.backupDeviceTypeURL) {
|
||||
isfile = false;
|
||||
}
|
||||
return isfile;
|
||||
}
|
||||
|
||||
private enableMediaInput(enable: boolean): void {
|
||||
if (enable) {
|
||||
this.mediaNameBox.enable();
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { CommandsRegistry, ICommandService } from 'vs/platform/commands/common/commands';
|
||||
import { ConnectedContext } from 'azdata';
|
||||
import { TreeViewItemHandleArg } from 'sql/workbench/common/views';
|
||||
import { BackupAction } from 'sql/workbench/parts/backup/browser/backupActions';
|
||||
import { MenuRegistry, MenuId } from 'vs/platform/actions/common/actions';
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
import { Dimension } from 'vs/base/browser/dom';
|
||||
import { mixin } from 'sql/base/common/objects';
|
||||
import * as types from 'vs/base/common/types';
|
||||
import { Color } from 'vs/base/common/color';
|
||||
import { IInsightOptions, InsightType, ChartType } from 'sql/workbench/parts/charts/common/interfaces';
|
||||
|
||||
export interface IPointDataSet {
|
||||
|
||||
@@ -526,10 +526,8 @@ suite('commandLineService tests', () => {
|
||||
connectionManagementService.setup((c) => c.showConnectionDialog()).verifiable(TypeMoq.Times.never());
|
||||
connectionManagementService.setup(c => c.hasRegisteredServers()).returns(() => true).verifiable(TypeMoq.Times.atMostOnce());
|
||||
connectionManagementService.setup(c => c.getConnectionGroups(TypeMoq.It.isAny())).returns(() => []);
|
||||
let originalProfile: IConnectionProfile = undefined;
|
||||
connectionManagementService.setup(c => c.connectIfNotConnected(TypeMoq.It.is<ConnectionProfile>(p => p.serverName === 'myserver' && p.authenticationType === Constants.sqlLogin), 'connection', true))
|
||||
.returns((conn) => {
|
||||
originalProfile = conn;
|
||||
return Promise.resolve('unused');
|
||||
})
|
||||
.verifiable(TypeMoq.Times.once());
|
||||
|
||||
@@ -17,7 +17,6 @@ import { EditDataInput } from 'sql/workbench/parts/editData/browser/editDataInpu
|
||||
import { DashboardInput } from 'sql/workbench/parts/dashboard/browser/dashboardInput';
|
||||
import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService';
|
||||
import { IQuickInputService } from 'vs/platform/quickinput/common/quickInput';
|
||||
import { IObjectExplorerService } from 'sql/workbench/services/objectExplorer/browser/objectExplorerService';
|
||||
import { find } from 'vs/base/common/arrays';
|
||||
|
||||
/**
|
||||
@@ -147,7 +146,6 @@ export class GetCurrentConnectionStringAction extends Action {
|
||||
label: string,
|
||||
@IConnectionManagementService private _connectionManagementService: IConnectionManagementService,
|
||||
@IEditorService private _editorService: IEditorService,
|
||||
@IObjectExplorerService private _objectExplorerService: IObjectExplorerService,
|
||||
@INotificationService private readonly _notificationService: INotificationService,
|
||||
@IClipboardService private _clipboardService: IClipboardService,
|
||||
) {
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
import 'vs/css!./dashboardControlHostContainer';
|
||||
|
||||
import { Component, forwardRef, Input, AfterContentInit, ViewChild, OnChanges } from '@angular/core';
|
||||
import { Component, forwardRef, Input, AfterContentInit, ViewChild } from '@angular/core';
|
||||
|
||||
import { Event, Emitter } from 'vs/base/common/event';
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ export class DashboardGridContainer extends DashboardTab implements OnDestroy {
|
||||
public readonly onResize: Event<void> = this._onResize.event;
|
||||
private cellWidth: number = 270;
|
||||
private cellHeight: number = 270;
|
||||
private ScrollbarVisibility = ScrollbarVisibility;
|
||||
public ScrollbarVisibility = ScrollbarVisibility;
|
||||
|
||||
protected SKELETON_WIDTH = 5;
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ export class DashboardHomeContainer extends DashboardWidgetContainer {
|
||||
@ViewChild('propertiesClass') private _propertiesClass: DashboardWidgetWrapper;
|
||||
@ContentChild(ScrollableDirective) private _scrollable: ScrollableDirective;
|
||||
|
||||
private ScrollbarVisibility = ScrollbarVisibility;
|
||||
public ScrollbarVisibility = ScrollbarVisibility;
|
||||
|
||||
constructor(
|
||||
@Inject(forwardRef(() => ChangeDetectorRef)) _cd: ChangeDetectorRef,
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
import 'vs/css!./dashboardNavSection';
|
||||
|
||||
import { Component, Inject, Input, forwardRef, ViewChild, ElementRef, ViewChildren, QueryList, OnDestroy, ChangeDetectorRef, OnChanges, AfterContentInit } from '@angular/core';
|
||||
import { Component, Inject, Input, forwardRef, ViewChild, ViewChildren, QueryList, OnDestroy, ChangeDetectorRef, OnChanges, AfterContentInit } from '@angular/core';
|
||||
|
||||
import { CommonServiceInterface, SingleConnectionManagementService } from 'sql/workbench/services/bootstrap/browser/commonServiceInterface.service';
|
||||
import { WidgetConfig, TabConfig, NavSectionConfig } from 'sql/workbench/parts/dashboard/browser/core/dashboardWidget';
|
||||
|
||||
@@ -6,9 +6,7 @@
|
||||
import { IExtensionPointUser } from 'vs/workbench/services/extensions/common/extensionsRegistry';
|
||||
import { IJSONSchema } from 'vs/base/common/jsonSchema';
|
||||
import * as nls from 'vs/nls';
|
||||
import { join } from 'vs/base/common/path';
|
||||
import { createCSSRule, asCSSUrl } from 'vs/base/browser/dom';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { IdGenerator } from 'vs/base/common/idGenerator';
|
||||
import * as resources from 'vs/base/common/resources';
|
||||
|
||||
|
||||
@@ -5,10 +5,9 @@
|
||||
|
||||
import 'vs/css!./controlHostContent';
|
||||
|
||||
import { Component, forwardRef, Input, OnInit, Inject, ChangeDetectorRef, ElementRef, ViewChild } from '@angular/core';
|
||||
import { Component, forwardRef, Input, Inject, ChangeDetectorRef, ViewChild } from '@angular/core';
|
||||
|
||||
import { Event, Emitter } from 'vs/base/common/event';
|
||||
import { IDisposable } from 'vs/base/common/lifecycle';
|
||||
import { CommonServiceInterface } from 'sql/workbench/services/bootstrap/browser/commonServiceInterface.service';
|
||||
|
||||
import * as azdata from 'azdata';
|
||||
@@ -27,7 +26,6 @@ export class ControlHostContent {
|
||||
private _onMessage = new Emitter<string>();
|
||||
public readonly onMessage: Event<string> = this._onMessage.event;
|
||||
|
||||
private _onMessageDisposable: IDisposable;
|
||||
private _type: string;
|
||||
|
||||
/* Children components */
|
||||
@@ -35,8 +33,7 @@ export class ControlHostContent {
|
||||
|
||||
constructor(
|
||||
@Inject(forwardRef(() => CommonServiceInterface)) private _dashboardService: CommonServiceInterface,
|
||||
@Inject(forwardRef(() => ChangeDetectorRef)) private _changeRef: ChangeDetectorRef,
|
||||
@Inject(forwardRef(() => ElementRef)) private _el: ElementRef
|
||||
@Inject(forwardRef(() => ChangeDetectorRef)) private _changeRef: ChangeDetectorRef
|
||||
) {
|
||||
}
|
||||
|
||||
|
||||
@@ -52,9 +52,6 @@ export abstract class DashboardPage extends AngularDisposable implements IConfig
|
||||
|
||||
private _originalConfig: WidgetConfig[];
|
||||
|
||||
private _widgetConfigLocation: string;
|
||||
private _propertiesConfigLocation: string;
|
||||
|
||||
protected panelActions: Action[];
|
||||
private _tabsDispose: Array<IDisposable> = [];
|
||||
private _tabSettingConfigs: Array<TabSettingConfig> = [];
|
||||
@@ -115,7 +112,6 @@ export abstract class DashboardPage extends AngularDisposable implements IConfig
|
||||
});
|
||||
} else {
|
||||
let tempWidgets = this.dashboardService.getSettings<Array<WidgetConfig>>([this.context, 'widgets'].join('.'));
|
||||
this._widgetConfigLocation = 'default';
|
||||
this._originalConfig = objects.deepClone(tempWidgets);
|
||||
let properties = this.getProperties();
|
||||
this._configModifiers.forEach((cb) => {
|
||||
@@ -302,7 +298,6 @@ export abstract class DashboardPage extends AngularDisposable implements IConfig
|
||||
|
||||
private getProperties(): Array<WidgetConfig> {
|
||||
const properties = this.dashboardService.getSettings<IPropertiesConfig[] | string | boolean>([this.context, 'properties'].join('.'));
|
||||
this._propertiesConfigLocation = 'default';
|
||||
if (types.isUndefinedOrNull(properties)) {
|
||||
return [this.propertiesWidget];
|
||||
} else if (types.isBoolean(properties)) {
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
import 'vs/css!./dashboard';
|
||||
|
||||
import { OnInit, Component, Inject, forwardRef, ElementRef, ChangeDetectorRef, ViewChild } from '@angular/core';
|
||||
import { OnInit, Component, Inject, forwardRef, ElementRef, ViewChild } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
|
||||
import { CommonServiceInterface } from 'sql/workbench/services/bootstrap/browser/commonServiceInterface.service';
|
||||
@@ -38,7 +38,6 @@ export class DashboardComponent extends AngularDisposable implements OnInit {
|
||||
constructor(
|
||||
@Inject(forwardRef(() => CommonServiceInterface)) private _bootstrapService: CommonServiceInterface,
|
||||
@Inject(forwardRef(() => Router)) private _router: Router,
|
||||
@Inject(forwardRef(() => ChangeDetectorRef)) private _changeRef: ChangeDetectorRef,
|
||||
@Inject(IWorkbenchThemeService) private themeService: IWorkbenchThemeService
|
||||
) {
|
||||
super();
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import { IConfigurationRegistry, Extensions as ConfigurationExtension } from 'vs/platform/configuration/common/configurationRegistry';
|
||||
import { IJSONSchema, IJSONSchemaMap } from 'vs/base/common/jsonSchema';
|
||||
import { IJSONSchema } from 'vs/base/common/jsonSchema';
|
||||
import * as nls from 'vs/nls';
|
||||
import { IExtensionPointUser, ExtensionsRegistry } from 'vs/workbench/services/extensions/common/extensionsRegistry';
|
||||
|
||||
@@ -42,7 +42,6 @@ class DashboardRegistry implements IDashboardRegistry {
|
||||
private _properties = new Map<string, ProviderProperties>();
|
||||
private _tabs = new Array<IDashboardTab>();
|
||||
private _configurationRegistry = Registry.as<IConfigurationRegistry>(ConfigurationExtension.Configuration);
|
||||
private _dashboardTabContentSchemaProperties: IJSONSchemaMap = {};
|
||||
|
||||
/**
|
||||
* Register a dashboard widget
|
||||
|
||||
@@ -60,7 +60,7 @@ export class InsightsWidget extends DashboardWidget implements IDashboardWidget,
|
||||
|
||||
private _typeKey: string;
|
||||
private _init: boolean = false;
|
||||
private _loading: boolean = true;
|
||||
public _loading: boolean = true;
|
||||
private _intervalTimer: IntervalTimer;
|
||||
|
||||
public error: string;
|
||||
|
||||
@@ -247,7 +247,7 @@ export abstract class ChartInsight extends Disposable implements IInsightsView {
|
||||
|
||||
|
||||
@ChartInsight.MEMOIZER
|
||||
private get colors(): { backgroundColor: string[] }[] {
|
||||
public get colors(): { backgroundColor: string[] }[] {
|
||||
if (this._config && this._config.colorMap) {
|
||||
const backgroundColor = this.labels.map((item) => {
|
||||
return this._config.colorMap[item];
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { Component, Input, Inject, ChangeDetectorRef, forwardRef, ElementRef, OnInit } from '@angular/core';
|
||||
import { Component, Input, Inject, forwardRef, ElementRef, OnInit } from '@angular/core';
|
||||
|
||||
import { getContentHeight, getContentWidth, Dimension } from 'vs/base/browser/dom';
|
||||
import { Disposable } from 'vs/base/common/lifecycle';
|
||||
@@ -25,7 +25,6 @@ export default class TableInsight extends Disposable implements IInsightsView, O
|
||||
private columns: Slick.Column<any>[];
|
||||
|
||||
constructor(
|
||||
@Inject(forwardRef(() => ChangeDetectorRef)) private _changeRef: ChangeDetectorRef,
|
||||
@Inject(forwardRef(() => ElementRef)) private _elementRef: ElementRef,
|
||||
@Inject(IWorkbenchThemeService) private themeService: IWorkbenchThemeService
|
||||
) {
|
||||
|
||||
@@ -64,7 +64,7 @@ export interface DisplayProperty {
|
||||
export class PropertiesWidgetComponent extends DashboardWidget implements IDashboardWidget, OnInit {
|
||||
private _connection: ConnectionManagementInfo;
|
||||
private _databaseInfo: DatabaseInfo;
|
||||
private _clipped: boolean;
|
||||
public _clipped: boolean;
|
||||
private properties: Array<DisplayProperty>;
|
||||
private _hasInit = false;
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
|
||||
import 'vs/css!./media/connectionViewletPanel';
|
||||
import * as DOM from 'vs/base/browser/dom';
|
||||
import { IDisposable } from 'vs/base/common/lifecycle';
|
||||
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
|
||||
import { IContextMenuService } from 'vs/platform/contextview/browser/contextView';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
|
||||
@@ -55,8 +55,6 @@ export class EditDataComponent extends GridParentComponent implements OnInit, On
|
||||
// All datasets
|
||||
private dataSet: IGridDataSet;
|
||||
private firstRender = true;
|
||||
private totalElapsedTimeSpan: number;
|
||||
private complete = false;
|
||||
// Current selected cell state
|
||||
private currentCell: { row: number, column: number, isEditable: boolean, isDirty: boolean };
|
||||
private currentEditCellValue: string;
|
||||
@@ -153,8 +151,6 @@ export class EditDataComponent extends GridParentComponent implements OnInit, On
|
||||
self.placeHolderDataSets = [];
|
||||
self.renderedDataSets = self.placeHolderDataSets;
|
||||
this._cd.detectChanges();
|
||||
self.totalElapsedTimeSpan = undefined;
|
||||
self.complete = false;
|
||||
|
||||
// Hooking up edit functions
|
||||
this.onIsCellEditValid = (row, column, value): boolean => {
|
||||
@@ -318,8 +314,6 @@ export class EditDataComponent extends GridParentComponent implements OnInit, On
|
||||
}
|
||||
|
||||
handleComplete(self: EditDataComponent, event: any): void {
|
||||
self.totalElapsedTimeSpan = event.data;
|
||||
self.complete = true;
|
||||
}
|
||||
|
||||
handleEditSessionReady(self, event): void {
|
||||
@@ -441,8 +435,6 @@ export class EditDataComponent extends GridParentComponent implements OnInit, On
|
||||
|
||||
protected tryHandleKeyEvent(e: StandardKeyboardEvent): boolean {
|
||||
let handled: boolean = false;
|
||||
// If the esc key was pressed while in a create session
|
||||
let currentNewRowIndex = this.dataSet.totalRows - 2;
|
||||
|
||||
if (e.keyCode === KeyCode.Escape) {
|
||||
this.revertCurrentRow();
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { Action, IActionViewItem, IActionRunner } from 'vs/base/common/actions';
|
||||
import { DisposableStore, Disposable } from 'vs/base/common/lifecycle';
|
||||
import { Disposable } from 'vs/base/common/lifecycle';
|
||||
import { IQueryModelService } from 'sql/platform/query/common/queryModel';
|
||||
import { SelectBox } from 'sql/base/browser/ui/selectBox/selectBox';
|
||||
import { IConnectionManagementService } from 'sql/platform/connection/common/connectionManagement';
|
||||
@@ -133,7 +133,6 @@ export class ChangeMaxRowsAction extends EditDataAction {
|
||||
public static ID = 'changeMaxRowsAction';
|
||||
|
||||
constructor(editor: EditDataEditor,
|
||||
@IQueryModelService private _queryModelService: IQueryModelService,
|
||||
@IConnectionManagementService _connectionManagementService: IConnectionManagementService
|
||||
) {
|
||||
super(editor, ChangeMaxRowsAction.ID, undefined, _connectionManagementService);
|
||||
@@ -158,7 +157,6 @@ export class ChangeMaxRowsActionItem extends Disposable implements IActionViewIt
|
||||
private container: HTMLElement;
|
||||
private start: HTMLElement;
|
||||
private selectBox: SelectBox;
|
||||
private context: any;
|
||||
private _options: string[];
|
||||
private _currentOptionsIndex: number;
|
||||
|
||||
@@ -183,7 +181,6 @@ export class ChangeMaxRowsActionItem extends Disposable implements IActionViewIt
|
||||
}
|
||||
|
||||
public setActionContext(context: any): void {
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
public isEnabled(): boolean {
|
||||
@@ -235,7 +232,6 @@ export class ShowQueryPaneAction extends EditDataAction {
|
||||
private readonly closeSqlLabel = nls.localize('editData.closeSql', "Close SQL Pane");
|
||||
|
||||
constructor(editor: EditDataEditor,
|
||||
@IQueryModelService private _queryModelService: IQueryModelService,
|
||||
@IConnectionManagementService _connectionManagementService: IConnectionManagementService
|
||||
) {
|
||||
super(editor, ShowQueryPaneAction.ID, ShowQueryPaneAction.EnabledClass, _connectionManagementService);
|
||||
|
||||
@@ -3,9 +3,7 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
import { Subject } from 'rxjs/Subject';
|
||||
import { Observer } from 'rxjs/Observer';
|
||||
|
||||
import { EditUpdateCellResult, EditSubsetResult, EditCreateRowResult } from 'azdata';
|
||||
import { IQueryModelService } from 'sql/platform/query/common/queryModel';
|
||||
|
||||
@@ -10,7 +10,6 @@ import { Component, Inject, forwardRef, ChangeDetectorRef, ViewChild, Injectable
|
||||
import { AgentJobInfo, AgentNotebookInfo } from 'azdata';
|
||||
import { PanelComponent, IPanelOptions, NavigationBarLayout } from 'sql/base/browser/ui/panel/panel.component';
|
||||
import { IJobManagementService } from 'sql/platform/jobManagement/common/interfaces';
|
||||
import { IDashboardService } from 'sql/platform/dashboard/browser/dashboardService';
|
||||
|
||||
|
||||
export const DASHBOARD_SELECTOR: string = 'agentview-component';
|
||||
@@ -40,14 +39,13 @@ export class AgentViewComponent {
|
||||
public proxiesIconClass: string = 'proxiesview-icon';
|
||||
public operatorsIconClass: string = 'operatorsview-icon';
|
||||
|
||||
private readonly jobsComponentTitle: string = nls.localize('jobview.Jobs', "Jobs");
|
||||
private readonly notebooksComponentTitle: string = nls.localize('jobview.Notebooks', "Notebooks");
|
||||
private readonly alertsComponentTitle: string = nls.localize('jobview.Alerts', "Alerts");
|
||||
private readonly proxiesComponentTitle: string = nls.localize('jobview.Proxies', "Proxies");
|
||||
private readonly operatorsComponentTitle: string = nls.localize('jobview.Operators', "Operators");
|
||||
public readonly jobsComponentTitle: string = nls.localize('jobview.Jobs', "Jobs");
|
||||
public readonly notebooksComponentTitle: string = nls.localize('jobview.Notebooks', "Notebooks");
|
||||
public readonly alertsComponentTitle: string = nls.localize('jobview.Alerts', "Alerts");
|
||||
public readonly proxiesComponentTitle: string = nls.localize('jobview.Proxies', "Proxies");
|
||||
public readonly operatorsComponentTitle: string = nls.localize('jobview.Operators', "Operators");
|
||||
|
||||
// tslint:disable-next-line:no-unused-variable
|
||||
private readonly panelOpt: IPanelOptions = {
|
||||
public readonly panelOpt: IPanelOptions = {
|
||||
showTabsWhenOne: true,
|
||||
layout: NavigationBarLayout.vertical,
|
||||
showIcon: true
|
||||
@@ -55,8 +53,7 @@ export class AgentViewComponent {
|
||||
|
||||
constructor(
|
||||
@Inject(forwardRef(() => ChangeDetectorRef)) private _cd: ChangeDetectorRef,
|
||||
@Inject(IJobManagementService) jobManagementService: IJobManagementService,
|
||||
@Inject(IDashboardService) dashboardService: IDashboardService, ) {
|
||||
@Inject(IJobManagementService) jobManagementService: IJobManagementService) {
|
||||
this._expanded = new Map<string, string>();
|
||||
|
||||
let self = this;
|
||||
|
||||
@@ -14,7 +14,7 @@ import { Table } from 'sql/base/browser/ui/table/table';
|
||||
import { AgentViewComponent } from 'sql/workbench/parts/jobManagement/browser/agentView.component';
|
||||
import { IJobManagementService } from 'sql/platform/jobManagement/common/interfaces';
|
||||
import { EditAlertAction, DeleteAlertAction, NewAlertAction } from 'sql/platform/jobManagement/browser/jobActions';
|
||||
import { JobManagementView, JobActionContext } from 'sql/workbench/parts/jobManagement/browser/jobManagementView';
|
||||
import { JobManagementView } from 'sql/workbench/parts/jobManagement/browser/jobManagementView';
|
||||
import { CommonServiceInterface } from 'sql/workbench/services/bootstrap/browser/commonServiceInterface.service';
|
||||
import { ICommandService } from 'vs/platform/commands/common/commands';
|
||||
import { IContextMenuService } from 'vs/platform/contextview/browser/contextView';
|
||||
@@ -58,7 +58,7 @@ export class AlertsViewComponent extends JobManagementView implements OnInit, On
|
||||
};
|
||||
|
||||
private dataView: any;
|
||||
private _isCloud: boolean;
|
||||
public _isCloud: boolean;
|
||||
private _alertsCacheObject: AlertsCacheObject;
|
||||
|
||||
private _didTabChange: boolean;
|
||||
@@ -69,7 +69,6 @@ export class AlertsViewComponent extends JobManagementView implements OnInit, On
|
||||
|
||||
constructor(
|
||||
@Inject(forwardRef(() => ChangeDetectorRef)) private _cd: ChangeDetectorRef,
|
||||
@Inject(forwardRef(() => ElementRef)) private _el: ElementRef,
|
||||
@Inject(forwardRef(() => AgentViewComponent)) _agentViewComponent: AgentViewComponent,
|
||||
@Inject(IJobManagementService) private _jobManagementService: IJobManagementService,
|
||||
@Inject(ICommandService) private _commandService: ICommandService,
|
||||
|
||||
@@ -53,17 +53,15 @@ export class JobHistoryComponent extends JobManagementView implements OnInit {
|
||||
private _treeFilter: JobHistoryFilter;
|
||||
|
||||
@ViewChild('table') private _tableContainer: ElementRef;
|
||||
@ViewChild('jobsteps') private _jobStepsView: ElementRef;
|
||||
|
||||
@Input() public agentJobInfo: azdata.AgentJobInfo = undefined;
|
||||
@Input() public agentJobHistories: azdata.AgentJobHistoryInfo[] = undefined;
|
||||
public agentJobHistoryInfo: azdata.AgentJobHistoryInfo = undefined;
|
||||
|
||||
private _isVisible: boolean = false;
|
||||
private _stepRows: JobStepsViewRow[] = [];
|
||||
private _showSteps: boolean = undefined;
|
||||
private _showPreviousRuns: boolean = undefined;
|
||||
private _runStatus: string = undefined;
|
||||
public _runStatus: string = undefined;
|
||||
private _jobCacheObject: JobCacheObject;
|
||||
private _agentJobInfo: azdata.AgentJobInfo;
|
||||
private _noJobsAvailable: boolean = false;
|
||||
@@ -268,7 +266,7 @@ export class JobHistoryComponent extends JobManagementView implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
private toggleCollapse(): void {
|
||||
public toggleCollapse(): void {
|
||||
let arrow: HTMLElement = jQuery('.resultsViewCollapsible').get(0);
|
||||
let checkbox: any = document.getElementById('accordion');
|
||||
if (arrow.className === 'resultsViewCollapsible' && checkbox.checked === false) {
|
||||
@@ -278,20 +276,10 @@ export class JobHistoryComponent extends JobManagementView implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
private goToJobs(): void {
|
||||
this._isVisible = false;
|
||||
public goToJobs(): void {
|
||||
this._agentViewComponent.showHistory = false;
|
||||
}
|
||||
|
||||
private convertToJobHistoryRow(historyInfo: azdata.AgentJobHistoryInfo): JobHistoryRow {
|
||||
let jobHistoryRow = new JobHistoryRow();
|
||||
jobHistoryRow.runDate = this.formatTime(historyInfo.runDate);
|
||||
jobHistoryRow.runStatus = JobManagementUtilities.convertToStatusString(historyInfo.runStatus);
|
||||
jobHistoryRow.instanceID = historyInfo.instanceId;
|
||||
jobHistoryRow.jobID = historyInfo.jobId;
|
||||
return jobHistoryRow;
|
||||
}
|
||||
|
||||
private formatTime(time: string): string {
|
||||
return time.replace('T', ' ');
|
||||
}
|
||||
|
||||
@@ -152,7 +152,6 @@ export class JobHistoryRenderer implements tree.IRenderer {
|
||||
}
|
||||
|
||||
export class JobHistoryFilter implements tree.IFilter {
|
||||
private _filterString: string;
|
||||
|
||||
public isVisible(tree: tree.ITree, element: JobHistoryRow): boolean {
|
||||
return this._isJobVisible();
|
||||
@@ -163,6 +162,5 @@ export class JobHistoryFilter implements tree.IFilter {
|
||||
}
|
||||
|
||||
public set filterString(val: string) {
|
||||
this._filterString = val;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
import 'vs/css!./media/jobStepsView';
|
||||
import * as nls from 'vs/nls';
|
||||
import * as dom from 'vs/base/browser/dom';
|
||||
import { OnInit, Component, Inject, forwardRef, ElementRef, ChangeDetectorRef, ViewChild, AfterContentChecked } from '@angular/core';
|
||||
import { OnInit, Component, Inject, forwardRef, ElementRef, ViewChild, AfterContentChecked } from '@angular/core';
|
||||
import { attachListStyler } from 'vs/platform/theme/common/styler';
|
||||
import { Tree } from 'vs/base/parts/tree/browser/treeImpl';
|
||||
import { ScrollbarVisibility } from 'vs/base/common/scrollable';
|
||||
@@ -44,8 +44,6 @@ export class JobStepsViewComponent extends JobManagementView implements OnInit,
|
||||
@ViewChild('table') private _tableContainer: ElementRef;
|
||||
|
||||
constructor(
|
||||
@Inject(forwardRef(() => ElementRef)) el: ElementRef,
|
||||
@Inject(forwardRef(() => ChangeDetectorRef)) private _cd: ChangeDetectorRef,
|
||||
@Inject(forwardRef(() => CommonServiceInterface)) commonService: CommonServiceInterface,
|
||||
@Inject(forwardRef(() => JobHistoryComponent)) private _jobHistoryComponent: JobHistoryComponent,
|
||||
@Inject(IWorkbenchThemeService) private themeService: IWorkbenchThemeService,
|
||||
|
||||
@@ -162,7 +162,6 @@ export class JobStepsViewRenderer implements tree.IRenderer {
|
||||
}
|
||||
|
||||
export class JobStepsViewFilter implements tree.IFilter {
|
||||
private _filterString: string;
|
||||
|
||||
public isVisible(tree: tree.ITree, element: JobStepsViewRow): boolean {
|
||||
return this._isJobVisible();
|
||||
@@ -173,6 +172,5 @@ export class JobStepsViewFilter implements tree.IFilter {
|
||||
}
|
||||
|
||||
public set filterString(val: string) {
|
||||
this._filterString = val;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ export class JobsViewComponent extends JobManagementView implements OnInit, OnDe
|
||||
private rowDetail: RowDetailView<IItem>;
|
||||
private filterPlugin: any;
|
||||
private dataView: any;
|
||||
private _isCloud: boolean;
|
||||
public _isCloud: boolean;
|
||||
private filterStylingMap: { [columnName: string]: [any]; } = {};
|
||||
private filterStack = ['start'];
|
||||
private filterValueMap: { [columnName: string]: string[]; } = {};
|
||||
@@ -98,7 +98,6 @@ export class JobsViewComponent extends JobManagementView implements OnInit, OnDe
|
||||
constructor(
|
||||
@Inject(forwardRef(() => CommonServiceInterface)) commonService: CommonServiceInterface,
|
||||
@Inject(forwardRef(() => ChangeDetectorRef)) private _cd: ChangeDetectorRef,
|
||||
@Inject(forwardRef(() => ElementRef)) private _el: ElementRef,
|
||||
@Inject(forwardRef(() => AgentViewComponent)) _agentViewComponent: AgentViewComponent,
|
||||
@Inject(IJobManagementService) private _jobManagementService: IJobManagementService,
|
||||
@Inject(IWorkbenchThemeService) private _themeService: IWorkbenchThemeService,
|
||||
|
||||
@@ -8,17 +8,14 @@ import 'vs/css!./media/jobHistory';
|
||||
import * as azdata from 'azdata';
|
||||
import * as nls from 'vs/nls';
|
||||
import * as dom from 'vs/base/browser/dom';
|
||||
import { OnInit, Component, Inject, Input, forwardRef, ElementRef, ChangeDetectorRef, ViewChild, ChangeDetectionStrategy, Injectable, PipeTransform, Pipe } from '@angular/core';
|
||||
import { OnInit, Component, Inject, Input, forwardRef, ElementRef, ChangeDetectorRef, ViewChild, ChangeDetectionStrategy, Injectable } from '@angular/core';
|
||||
import { Taskbar } from 'sql/base/browser/ui/taskbar/taskbar';
|
||||
import { AgentViewComponent } from 'sql/workbench/parts/jobManagement/browser/agentView.component';
|
||||
import { CommonServiceInterface } from 'sql/workbench/services/bootstrap/browser/commonServiceInterface.service';
|
||||
import { RunJobAction, StopJobAction, JobsRefreshAction, EditNotebookJobAction, EditJobAction, OpenMaterializedNotebookAction, OpenTemplateNotebookAction, RenameNotebookMaterializedAction, PinNotebookMaterializedAction, UnpinNotebookMaterializedAction, DeleteMaterializedNotebookAction } from 'sql/platform/jobManagement/browser/jobActions';
|
||||
import { RunJobAction, StopJobAction, JobsRefreshAction, EditNotebookJobAction, OpenMaterializedNotebookAction, OpenTemplateNotebookAction, RenameNotebookMaterializedAction, PinNotebookMaterializedAction, UnpinNotebookMaterializedAction, DeleteMaterializedNotebookAction } from 'sql/platform/jobManagement/browser/jobActions';
|
||||
import { NotebookCacheObject } from 'sql/platform/jobManagement/common/jobManagementService';
|
||||
import { JobManagementUtilities } from 'sql/platform/jobManagement/browser/jobManagementUtilities';
|
||||
import { IJobManagementService } from 'sql/platform/jobManagement/common/interfaces';
|
||||
import { JobHistoryRow } from 'sql/workbench/parts/jobManagement/browser/jobHistoryTree';
|
||||
import { JobStepsViewRow } from 'sql/workbench/parts/jobManagement/browser/jobStepsViewTree';
|
||||
import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { IAction } from 'vs/base/common/actions';
|
||||
import { IContextMenuService } from 'vs/platform/contextview/browser/contextView';
|
||||
@@ -30,7 +27,6 @@ import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
|
||||
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
import * as TelemetryKeys from 'sql/platform/telemetry/common/telemetryKeys';
|
||||
import { IQuickInputService } from 'vs/platform/quickinput/common/quickInput';
|
||||
import { find } from 'vs/base/common/arrays';
|
||||
|
||||
export const DASHBOARD_SELECTOR: string = 'notebookhistory-component';
|
||||
export class GridSection {
|
||||
@@ -48,23 +44,16 @@ export class GridSection {
|
||||
@Injectable()
|
||||
export class NotebookHistoryComponent extends JobManagementView implements OnInit {
|
||||
|
||||
|
||||
|
||||
@ViewChild('table') private _tableContainer: ElementRef;
|
||||
@ViewChild('jobsteps') private _jobStepsView: ElementRef;
|
||||
@ViewChild('notebookHistoryActionbarContainer') private _notebookHistoryActionbarView: ElementRef;
|
||||
@ViewChild('notebookgriditem') private _notebookGridItem: ElementRef;
|
||||
|
||||
@Input() public agentNotebookInfo: azdata.AgentNotebookInfo = undefined;
|
||||
@Input() public agentJobHistories: azdata.AgentJobHistoryInfo[] = undefined;
|
||||
public notebookHistories: azdata.AgentNotebookHistoryInfo[] = undefined;
|
||||
public agentNotebookHistoryInfo: azdata.AgentNotebookHistoryInfo = undefined;
|
||||
|
||||
private _isVisible: boolean = false;
|
||||
private _stepRows: JobStepsViewRow[] = [];
|
||||
private _showSteps: boolean = undefined;
|
||||
private _showPreviousRuns: boolean = undefined;
|
||||
private _runStatus: string = undefined;
|
||||
private _notebookCacheObject: NotebookCacheObject;
|
||||
private _agentNotebookInfo: azdata.AgentNotebookInfo;
|
||||
private _noJobsAvailable: boolean = false;
|
||||
@@ -87,7 +76,6 @@ export class NotebookHistoryComponent extends JobManagementView implements OnIni
|
||||
@Inject(forwardRef(() => ChangeDetectorRef)) private _cd: ChangeDetectorRef,
|
||||
@Inject(forwardRef(() => CommonServiceInterface)) commonService: CommonServiceInterface,
|
||||
@Inject(forwardRef(() => AgentViewComponent)) _agentViewComponent: AgentViewComponent,
|
||||
@Inject(IWorkbenchThemeService) private themeService: IWorkbenchThemeService,
|
||||
@Inject(IInstantiationService) private instantiationService: IInstantiationService,
|
||||
@Inject(IContextMenuService) contextMenuService: IContextMenuService,
|
||||
@Inject(IJobManagementService) private _jobManagementService: IJobManagementService,
|
||||
@@ -116,7 +104,6 @@ export class NotebookHistoryComponent extends JobManagementView implements OnIni
|
||||
this._parentComponent = this._agentViewComponent;
|
||||
this._agentNotebookInfo = this._agentViewComponent.agentNotebookInfo;
|
||||
this.initActionBar();
|
||||
const self = this;
|
||||
this._telemetryService.publicLog(TelemetryKeys.JobHistoryView);
|
||||
}
|
||||
|
||||
@@ -166,53 +153,7 @@ export class NotebookHistoryComponent extends JobManagementView implements OnIni
|
||||
});
|
||||
}
|
||||
|
||||
private setStepsTree(element: JobHistoryRow) {
|
||||
const self = this;
|
||||
let cachedHistory = self._notebookCacheObject.getNotebookHistory(element.jobID);
|
||||
if (cachedHistory) {
|
||||
self.agentNotebookHistoryInfo = find(cachedHistory,
|
||||
history => self.formatTime(history.runDate) === self.formatTime(element.runDate));
|
||||
}
|
||||
if (self.agentNotebookHistoryInfo) {
|
||||
self.agentNotebookHistoryInfo.runDate = self.formatTime(self.agentNotebookHistoryInfo.runDate);
|
||||
if (self.agentNotebookHistoryInfo.steps) {
|
||||
let jobStepStatus = this.didJobFail(self.agentNotebookHistoryInfo);
|
||||
self._stepRows = self.agentNotebookHistoryInfo.steps.map(step => {
|
||||
let stepViewRow = new JobStepsViewRow();
|
||||
stepViewRow.message = step.message;
|
||||
stepViewRow.runStatus = jobStepStatus ? JobManagementUtilities.convertToStatusString(0) :
|
||||
JobManagementUtilities.convertToStatusString(step.runStatus);
|
||||
self._runStatus = JobManagementUtilities.convertToStatusString(self.agentNotebookHistoryInfo.runStatus);
|
||||
stepViewRow.stepName = step.stepDetails.stepName;
|
||||
stepViewRow.stepId = step.stepDetails.id.toString();
|
||||
return stepViewRow;
|
||||
});
|
||||
self._stepRows.unshift(new JobStepsViewRow());
|
||||
self._stepRows[0].rowID = 'stepsColumn' + self._agentNotebookInfo.jobId;
|
||||
self._stepRows[0].stepId = nls.localize('stepRow.stepID', "Step ID");
|
||||
self._stepRows[0].stepName = nls.localize('stepRow.stepName', "Step Name");
|
||||
self._stepRows[0].message = nls.localize('stepRow.message', "Message");
|
||||
this._showSteps = self._stepRows.length > 1;
|
||||
} else {
|
||||
self._showSteps = false;
|
||||
}
|
||||
if (self._agentViewComponent.showNotebookHistory) {
|
||||
self._cd.detectChanges();
|
||||
this.collapseGrid();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private didJobFail(job: azdata.AgentJobHistoryInfo): boolean {
|
||||
for (let i = 0; i < job.steps.length; i++) {
|
||||
if (job.steps[i].runStatus === 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private toggleCollapse(): void {
|
||||
public toggleCollapse(): void {
|
||||
let arrow: HTMLElement = jQuery('.resultsViewCollapsible').get(0);
|
||||
let checkbox: any = document.getElementById('accordion');
|
||||
if (arrow.className === 'resultsViewCollapsible' && checkbox.checked === false) {
|
||||
@@ -223,7 +164,7 @@ export class NotebookHistoryComponent extends JobManagementView implements OnIni
|
||||
|
||||
}
|
||||
|
||||
private toggleGridCollapse(i): void {
|
||||
public toggleGridCollapse(i): void {
|
||||
let notebookGrid = document.getElementById('notebook-grid' + i);
|
||||
let checkbox: any = document.getElementById('accordion' + i);
|
||||
let arrow = document.getElementById('history-grid-icon' + i);
|
||||
@@ -239,35 +180,16 @@ export class NotebookHistoryComponent extends JobManagementView implements OnIni
|
||||
|
||||
}
|
||||
|
||||
private toggleHistoryDisplay(event): void {
|
||||
let header = event.srcElement.attributes;
|
||||
}
|
||||
|
||||
private goToJobs(): void {
|
||||
this._isVisible = false;
|
||||
public goToJobs(): void {
|
||||
this._agentViewComponent.showNotebookHistory = false;
|
||||
}
|
||||
|
||||
private convertToJobHistoryRow(historyInfo: azdata.AgentJobHistoryInfo): JobHistoryRow {
|
||||
let jobHistoryRow = new JobHistoryRow();
|
||||
jobHistoryRow.runDate = this.formatTime(historyInfo.runDate);
|
||||
jobHistoryRow.runStatus = JobManagementUtilities.convertToStatusString(historyInfo.runStatus);
|
||||
jobHistoryRow.instanceID = historyInfo.instanceId;
|
||||
jobHistoryRow.jobID = historyInfo.jobId;
|
||||
return jobHistoryRow;
|
||||
}
|
||||
|
||||
private formatTime(time: string): string {
|
||||
|
||||
return time.replace('T', ' ');
|
||||
}
|
||||
|
||||
private formatDateTimetoLocaleDate(time: string) {
|
||||
public formatDateTimetoLocaleDate(time: string) {
|
||||
let dateInstance = new Date(time);
|
||||
return dateInstance.toLocaleDateString();
|
||||
}
|
||||
|
||||
private formatDateTimetoLocaleTime(time: string) {
|
||||
public formatDateTimetoLocaleTime(time: string) {
|
||||
let dateInstance = new Date(time);
|
||||
return dateInstance.toLocaleTimeString();
|
||||
}
|
||||
@@ -294,7 +216,6 @@ export class NotebookHistoryComponent extends JobManagementView implements OnIni
|
||||
let notebookHistories = this._notebookCacheObject.notebookHistories[this._agentViewComponent.notebookId];
|
||||
if (notebookHistories) {
|
||||
if (notebookHistories.length > 0) {
|
||||
const self = this;
|
||||
this._noJobsAvailable = false;
|
||||
if (this._notebookCacheObject.prevJobID === this._agentViewComponent.notebookId || notebookHistories[0].jobId === this._agentViewComponent.notebookId) {
|
||||
this._showPreviousRuns = true;
|
||||
@@ -405,7 +326,6 @@ export class NotebookHistoryComponent extends JobManagementView implements OnIni
|
||||
let notebookRunName = (history.materializedNotebookName === '') ? defaultDateTime : history.materializedNotebookName;
|
||||
let ownerUri: string = this._commonService.connectionManagementService.connectionInfo.ownerUri;
|
||||
let targetDatabase = this._agentViewComponent.agentNotebookInfo.targetDatabase;
|
||||
let materializedNotebookId = history.materializedNotebookId;
|
||||
this._quickInputService.input({ placeHolder: notebookRunName }).then(async (value) => {
|
||||
if (value) {
|
||||
if (!/\S/.test(value)) {
|
||||
@@ -425,7 +345,6 @@ export class NotebookHistoryComponent extends JobManagementView implements OnIni
|
||||
public toggleNotebookPin(history: azdata.AgentNotebookHistoryInfo, pin: boolean) {
|
||||
let ownerUri: string = this._commonService.connectionManagementService.connectionInfo.ownerUri;
|
||||
let targetDatabase = this._agentViewComponent.agentNotebookInfo.targetDatabase;
|
||||
let materializedNotebookId = history.materializedNotebookId;
|
||||
this._jobManagementService.updateNotebookMaterializedPin(ownerUri, history, targetDatabase, pin).then(async (result) => {
|
||||
if (result) {
|
||||
history.materializedNotebookPin = pin;
|
||||
@@ -440,8 +359,6 @@ export class NotebookHistoryComponent extends JobManagementView implements OnIni
|
||||
x: event.clientX,
|
||||
y: event.clientY
|
||||
};
|
||||
let runDate = event.target['runDate'];
|
||||
let gridActions = this.getGridActions();
|
||||
let actionContext = {
|
||||
component: this,
|
||||
history: history
|
||||
|
||||
@@ -14,7 +14,7 @@ import { Table } from 'sql/base/browser/ui/table/table';
|
||||
import { AgentViewComponent } from 'sql/workbench/parts/jobManagement/browser/agentView.component';
|
||||
import { RowDetailView } from 'sql/base/browser/ui/table/plugins/rowDetailView';
|
||||
import { NotebookCacheObject } from 'sql/platform/jobManagement/common/jobManagementService';
|
||||
import { EditJobAction, NewNotebookJobAction, RunJobAction, EditNotebookJobAction, JobsRefreshAction, IJobActionInfo, DeleteNotebookAction, OpenLatestRunMaterializedNotebook } from 'sql/platform/jobManagement/browser/jobActions';
|
||||
import { NewNotebookJobAction, RunJobAction, EditNotebookJobAction, JobsRefreshAction, IJobActionInfo, DeleteNotebookAction, OpenLatestRunMaterializedNotebook } from 'sql/platform/jobManagement/browser/jobActions';
|
||||
import { JobManagementUtilities } from 'sql/platform/jobManagement/browser/jobManagementUtilities';
|
||||
import { HeaderFilter } from 'sql/base/browser/ui/table/plugins/headerFilter.plugin';
|
||||
import { IJobManagementService } from 'sql/platform/jobManagement/common/interfaces';
|
||||
@@ -79,7 +79,7 @@ export class NotebooksViewComponent extends JobManagementView implements OnInit,
|
||||
private rowDetail: RowDetailView<IItem>;
|
||||
private filterPlugin: any;
|
||||
private dataView: any;
|
||||
private _isCloud: boolean;
|
||||
public _isCloud: boolean;
|
||||
private filterStylingMap: { [columnName: string]: [any]; } = {};
|
||||
private filterStack = ['start'];
|
||||
private filterValueMap: { [columnName: string]: string[]; } = {};
|
||||
@@ -97,7 +97,6 @@ export class NotebooksViewComponent extends JobManagementView implements OnInit,
|
||||
constructor(
|
||||
@Inject(forwardRef(() => CommonServiceInterface)) commonService: CommonServiceInterface,
|
||||
@Inject(forwardRef(() => ChangeDetectorRef)) private _cd: ChangeDetectorRef,
|
||||
@Inject(forwardRef(() => ElementRef)) private _el: ElementRef,
|
||||
@Inject(forwardRef(() => AgentViewComponent)) _agentViewComponent: AgentViewComponent,
|
||||
@Inject(IJobManagementService) private _jobManagementService: IJobManagementService,
|
||||
@Inject(IWorkbenchThemeService) private _themeService: IWorkbenchThemeService,
|
||||
@@ -898,7 +897,6 @@ export class NotebooksViewComponent extends JobManagementView implements OnInit,
|
||||
}
|
||||
|
||||
protected getTableActions(targetObject: JobActionContext): IAction[] {
|
||||
const editAction = this._instantiationService.createInstance(EditJobAction);
|
||||
const editNotebookAction = this._instantiationService.createInstance(EditNotebookJobAction);
|
||||
const runJobAction = this._instantiationService.createInstance(RunJobAction);
|
||||
const openLatestRunAction = this._instantiationService.createInstance(OpenLatestRunMaterializedNotebook);
|
||||
|
||||
@@ -57,7 +57,7 @@ export class OperatorsViewComponent extends JobManagementView implements OnInit,
|
||||
};
|
||||
|
||||
private dataView: any;
|
||||
private _isCloud: boolean;
|
||||
public _isCloud: boolean;
|
||||
private _operatorsCacheObject: OperatorsCacheObject;
|
||||
|
||||
private _didTabChange: boolean;
|
||||
@@ -68,7 +68,6 @@ export class OperatorsViewComponent extends JobManagementView implements OnInit,
|
||||
|
||||
constructor(
|
||||
@Inject(forwardRef(() => ChangeDetectorRef)) private _cd: ChangeDetectorRef,
|
||||
@Inject(forwardRef(() => ElementRef)) private _el: ElementRef,
|
||||
@Inject(forwardRef(() => AgentViewComponent)) _agentViewComponent: AgentViewComponent,
|
||||
@Inject(IJobManagementService) private _jobManagementService: IJobManagementService,
|
||||
@Inject(ICommandService) private _commandService: ICommandService,
|
||||
|
||||
@@ -36,9 +36,6 @@ export const ROW_HEIGHT: number = 45;
|
||||
|
||||
export class ProxiesViewComponent extends JobManagementView implements OnInit, OnDestroy {
|
||||
|
||||
private NewProxyText: string = nls.localize('jobProxyToolbar-NewItem', "New Proxy");
|
||||
private RefreshText: string = nls.localize('jobProxyToolbar-Refresh', "Refresh");
|
||||
|
||||
private columns: Array<Slick.Column<any>> = [
|
||||
{
|
||||
name: nls.localize('jobProxiesView.accountName', "Account Name"),
|
||||
@@ -61,7 +58,7 @@ export class ProxiesViewComponent extends JobManagementView implements OnInit, O
|
||||
};
|
||||
|
||||
private dataView: any;
|
||||
private _isCloud: boolean;
|
||||
public _isCloud: boolean;
|
||||
private _proxiesCacheObject: ProxiesCacheObject;
|
||||
|
||||
public proxies: azdata.AgentProxyInfo[];
|
||||
@@ -72,7 +69,6 @@ export class ProxiesViewComponent extends JobManagementView implements OnInit, O
|
||||
|
||||
constructor(
|
||||
@Inject(forwardRef(() => ChangeDetectorRef)) private _cd: ChangeDetectorRef,
|
||||
@Inject(forwardRef(() => ElementRef)) private _el: ElementRef,
|
||||
@Inject(forwardRef(() => AgentViewComponent)) _agentViewComponent: AgentViewComponent,
|
||||
@Inject(IJobManagementService) private _jobManagementService: IJobManagementService,
|
||||
@Inject(ICommandService) private _commandService: ICommandService,
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
import 'vs/css!./code';
|
||||
|
||||
import { OnInit, Component, Input, Inject, forwardRef, ElementRef, ChangeDetectorRef, ViewChild, SimpleChange, OnChanges } from '@angular/core';
|
||||
import { OnInit, Component, Input, ElementRef, ViewChild, SimpleChange, OnChanges } from '@angular/core';
|
||||
import { CellView } from 'sql/workbench/parts/notebook/browser/cellViews/interfaces';
|
||||
import { ICellModel } from 'sql/workbench/parts/notebook/browser/models/modelInterfaces';
|
||||
|
||||
@@ -22,9 +22,7 @@ export class CollapseComponent extends CellView implements OnInit, OnChanges {
|
||||
@Input() cellModel: ICellModel;
|
||||
@Input() activeCellId: string;
|
||||
|
||||
constructor(
|
||||
@Inject(forwardRef(() => ChangeDetectorRef)) private _changeRef: ChangeDetectorRef,
|
||||
) {
|
||||
constructor() {
|
||||
super();
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
import 'vs/css!./placeholder';
|
||||
|
||||
import { OnInit, Component, Input, Inject, forwardRef, ElementRef, ChangeDetectorRef, OnDestroy, ViewChild, SimpleChange, OnChanges } from '@angular/core';
|
||||
import { OnInit, Component, Input, Inject, forwardRef, ChangeDetectorRef, SimpleChange, OnChanges } from '@angular/core';
|
||||
import { CellView } from 'sql/workbench/parts/notebook/browser/cellViews/interfaces';
|
||||
import { ICellModel } from 'sql/workbench/parts/notebook/browser/models/modelInterfaces';
|
||||
import { NotebookModel } from 'sql/workbench/parts/notebook/browser/models/notebookModel';
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
import 'vs/css!./stdin';
|
||||
|
||||
import {
|
||||
Component, Input, Inject, ChangeDetectorRef, forwardRef,
|
||||
Component, Input, Inject,
|
||||
ViewChild, ElementRef, AfterViewInit, HostListener
|
||||
} from '@angular/core';
|
||||
import { nb } from 'azdata';
|
||||
@@ -16,7 +16,7 @@ import { IInputOptions } from 'vs/base/browser/ui/inputbox/inputBox';
|
||||
import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService';
|
||||
import { IContextViewService } from 'vs/platform/contextview/browser/contextView';
|
||||
import { inputBackground, inputBorder } from 'vs/platform/theme/common/colorRegistry';
|
||||
import { StandardKeyboardEvent, IKeyboardEvent } from 'vs/base/browser/keyboardEvent';
|
||||
import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
|
||||
import { KeyCode } from 'vs/base/common/keyCodes';
|
||||
|
||||
import { InputBox } from 'sql/base/browser/ui/inputBox/inputBox';
|
||||
@@ -43,10 +43,8 @@ export class StdInComponent extends AngularDisposable implements AfterViewInit {
|
||||
|
||||
|
||||
constructor(
|
||||
@Inject(forwardRef(() => ChangeDetectorRef)) private changeRef: ChangeDetectorRef,
|
||||
@Inject(IWorkbenchThemeService) private themeService: IWorkbenchThemeService,
|
||||
@Inject(IContextViewService) private contextViewService: IContextViewService,
|
||||
@Inject(forwardRef(() => ElementRef)) private el: ElementRef
|
||||
@Inject(IContextViewService) private contextViewService: IContextViewService
|
||||
) {
|
||||
super();
|
||||
}
|
||||
|
||||
@@ -20,14 +20,12 @@ import * as DOM from 'vs/base/browser/dom';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { toDisposable } from 'vs/base/common/lifecycle';
|
||||
import { IMarkdownRenderResult } from 'vs/editor/contrib/markdown/markdownRenderer';
|
||||
import { IOpenerService } from 'vs/platform/opener/common/opener';
|
||||
import { NotebookMarkdownRenderer } from 'sql/workbench/parts/notebook/browser/outputs/notebookMarkdown';
|
||||
import { CellView } from 'sql/workbench/parts/notebook/browser/cellViews/interfaces';
|
||||
import { ICellModel } from 'sql/workbench/parts/notebook/browser/models/modelInterfaces';
|
||||
import { NotebookModel } from 'sql/workbench/parts/notebook/browser/models/notebookModel';
|
||||
import { ISanitizer, defaultSanitizer } from 'sql/workbench/parts/notebook/browser/outputs/sanitizer';
|
||||
import { CellToggleMoreActions } from 'sql/workbench/parts/notebook/browser/cellToggleMoreActions';
|
||||
import { CommonServiceInterface } from 'sql/workbench/services/bootstrap/browser/commonServiceInterface.service';
|
||||
import { useInProcMarkdown, convertVscodeResourceToFileInSubDirectories } from 'sql/workbench/parts/notebook/browser/models/notebookUtils';
|
||||
|
||||
export const TEXT_SELECTOR: string = 'text-cell-component';
|
||||
@@ -82,12 +80,10 @@ export class TextCellComponent extends CellView implements OnInit, OnChanges {
|
||||
private markdownResult: IMarkdownRenderResult;
|
||||
|
||||
constructor(
|
||||
@Inject(forwardRef(() => CommonServiceInterface)) private _bootstrapService: CommonServiceInterface,
|
||||
@Inject(forwardRef(() => ChangeDetectorRef)) private _changeRef: ChangeDetectorRef,
|
||||
@Inject(IInstantiationService) private _instantiationService: IInstantiationService,
|
||||
@Inject(IWorkbenchThemeService) private themeService: IWorkbenchThemeService,
|
||||
@Inject(ICommandService) private _commandService: ICommandService,
|
||||
@Inject(IOpenerService) private readonly openerService: IOpenerService,
|
||||
@Inject(IConfigurationService) private configurationService: IConfigurationService,
|
||||
|
||||
) {
|
||||
|
||||
@@ -451,7 +451,6 @@ export class CellModel implements ICellModel {
|
||||
private handleReply(msg: nb.IShellMessage): void {
|
||||
// TODO #931 we should process this. There can be a payload attached which should be added to outputs.
|
||||
// In all other cases, it is a no-op
|
||||
let output: nb.ICellOutput = msg.content as nb.ICellOutput;
|
||||
|
||||
if (!this._future.inProgress) {
|
||||
this.disposeFuture();
|
||||
@@ -460,7 +459,6 @@ export class CellModel implements ICellModel {
|
||||
|
||||
private handleIOPub(msg: nb.IIOPubMessage): void {
|
||||
let msgType = msg.header.msg_type;
|
||||
let displayId = this.getDisplayId(msg);
|
||||
let output: nb.ICellOutput;
|
||||
switch (msgType) {
|
||||
case 'execute_result':
|
||||
@@ -552,11 +550,6 @@ export class CellModel implements ICellModel {
|
||||
});
|
||||
}
|
||||
|
||||
private getDisplayId(msg: nb.IIOPubMessage): string | undefined {
|
||||
let transient = (msg.content.transient || {});
|
||||
return transient['display_id'] as string;
|
||||
}
|
||||
|
||||
public setStdInHandler(handler: nb.MessageHandler<nb.IStdinMessage>): void {
|
||||
this._stdInHandler = handler;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ import { localize } from 'vs/nls';
|
||||
import { Event, Emitter } from 'vs/base/common/event';
|
||||
import { Disposable } from 'vs/base/common/lifecycle';
|
||||
|
||||
import { IClientSession, INotebookModel, IDefaultConnection, INotebookModelOptions, ICellModel, NotebookContentChange, notebookConstants, INotebookContentsEditable } from 'sql/workbench/parts/notebook/browser/models/modelInterfaces';
|
||||
import { IClientSession, INotebookModel, IDefaultConnection, INotebookModelOptions, ICellModel, NotebookContentChange, notebookConstants } from 'sql/workbench/parts/notebook/browser/models/modelInterfaces';
|
||||
import { NotebookChangeType, CellType, CellTypes } from 'sql/workbench/parts/notebook/common/models/contracts';
|
||||
import { nbversion } from 'sql/workbench/parts/notebook/common/models/notebookConstants';
|
||||
import * as notebookUtils from 'sql/workbench/parts/notebook/browser/models/notebookUtils';
|
||||
|
||||
@@ -23,7 +23,7 @@ import * as DOM from 'vs/base/browser/dom';
|
||||
|
||||
import { AngularDisposable } from 'sql/base/browser/lifecycle';
|
||||
import { CellTypes, CellType } from 'sql/workbench/parts/notebook/common/models/contracts';
|
||||
import { ICellModel, IModelFactory, INotebookModel, NotebookContentChange } from 'sql/workbench/parts/notebook/browser/models/modelInterfaces';
|
||||
import { ICellModel, IModelFactory, INotebookModel } from 'sql/workbench/parts/notebook/browser/models/modelInterfaces';
|
||||
import { IConnectionManagementService } from 'sql/platform/connection/common/connectionManagement';
|
||||
import { INotebookService, INotebookParams, INotebookManager, INotebookEditor, DEFAULT_NOTEBOOK_PROVIDER, SQL_NOTEBOOK_PROVIDER, INotebookSection, INavigationProvider } from 'sql/workbench/services/notebook/browser/notebookService';
|
||||
import { NotebookModel } from 'sql/workbench/parts/notebook/browser/models/notebookModel';
|
||||
@@ -54,7 +54,6 @@ import { Button } from 'sql/base/browser/ui/button/button';
|
||||
import { isUndefinedOrNull } from 'vs/base/common/types';
|
||||
import { IBootstrapParams } from 'sql/workbench/services/bootstrap/common/bootstrapParams';
|
||||
import { getErrorMessage } from 'vs/base/common/errors';
|
||||
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
|
||||
import { find, firstIndex } from 'vs/base/common/arrays';
|
||||
|
||||
|
||||
@@ -71,8 +70,6 @@ export class NotebookComponent extends AngularDisposable implements OnInit, OnDe
|
||||
@ViewChild('bookNav', { read: ElementRef }) private bookNav: ElementRef;
|
||||
|
||||
private _model: NotebookModel;
|
||||
private _isInErrorState: boolean = false;
|
||||
private _errorMessage: string;
|
||||
protected _actionBar: Taskbar;
|
||||
protected isLoading: boolean;
|
||||
private notebookManagers: INotebookManager[] = [];
|
||||
@@ -105,8 +102,7 @@ export class NotebookComponent extends AngularDisposable implements OnInit, OnDe
|
||||
@Inject(ICapabilitiesService) private capabilitiesService: ICapabilitiesService,
|
||||
@Inject(ITextFileService) private textFileService: ITextFileService,
|
||||
@Inject(ILogService) private readonly logService: ILogService,
|
||||
@Inject(ITelemetryService) private telemetryService: ITelemetryService,
|
||||
@Inject(IEnvironmentService) private readonly environmentService: IEnvironmentService
|
||||
@Inject(ITelemetryService) private telemetryService: ITelemetryService
|
||||
) {
|
||||
super();
|
||||
this.updateProfile();
|
||||
@@ -398,8 +394,6 @@ export class NotebookComponent extends AngularDisposable implements OnInit, OnDe
|
||||
}
|
||||
|
||||
private setViewInErrorState(error: any): any {
|
||||
this._isInErrorState = true;
|
||||
this._errorMessage = getErrorMessage(error);
|
||||
// For now, send message as error notification #870 covers having dedicated area for this
|
||||
this.notificationService.error(error);
|
||||
}
|
||||
|
||||
@@ -4,8 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
import { OnInit, Component, Input, Inject, ElementRef, ViewChild } from '@angular/core';
|
||||
import { IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
import { OnInit, Component, Input, ElementRef, ViewChild } from '@angular/core';
|
||||
import { localize } from 'vs/nls';
|
||||
import * as types from 'vs/base/common/types';
|
||||
import { AngularDisposable } from 'sql/base/browser/lifecycle';
|
||||
@@ -54,9 +53,7 @@ export class PlotlyOutputComponent extends AngularDisposable implements IMimeCom
|
||||
private _plotDiv: PlotlyHTMLElement;
|
||||
public errorText: string;
|
||||
|
||||
constructor(
|
||||
@Inject(IThemeService) private readonly themeService: IThemeService
|
||||
) {
|
||||
constructor() {
|
||||
super();
|
||||
}
|
||||
|
||||
|
||||
@@ -456,10 +456,8 @@ suite('Cell Model', function (): void {
|
||||
future.setup(f => f.setStdInHandler(TypeMoq.It.isAny())).callback((handler) => onStdIn = handler);
|
||||
|
||||
let deferred = new Deferred<void>();
|
||||
let stdInMessage: nb.IStdinMessage = undefined;
|
||||
cell.setStdInHandler({
|
||||
handle: (msg: nb.IStdinMessage) => {
|
||||
stdInMessage = msg;
|
||||
return deferred.promise;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -23,7 +23,6 @@ suite('Client Session', function (): void {
|
||||
let mockSessionManager: TypeMoq.Mock<nb.SessionManager>;
|
||||
let notificationService: TypeMoq.Mock<INotificationService>;
|
||||
let session: ClientSession;
|
||||
let remoteSession: ClientSession;
|
||||
|
||||
setup(() => {
|
||||
serverManager = new ServerManagerStub();
|
||||
@@ -42,12 +41,6 @@ suite('Client Session', function (): void {
|
||||
|
||||
let serverlessNotebookManager = new NotebookManagerStub();
|
||||
serverlessNotebookManager.sessionManager = mockSessionManager.object;
|
||||
remoteSession = new ClientSession({
|
||||
notebookManager: serverlessNotebookManager,
|
||||
notebookUri: path,
|
||||
notificationService: notificationService.object,
|
||||
kernelSpec: undefined
|
||||
});
|
||||
});
|
||||
|
||||
test('Should set path, isReady and ready on construction', function (): void {
|
||||
|
||||
@@ -89,9 +89,7 @@ export class DisconnectConnectionAction extends Action {
|
||||
id: string,
|
||||
label: string,
|
||||
private _connectionProfile: ConnectionProfile,
|
||||
@IConnectionManagementService private _connectionManagementService: IConnectionManagementService,
|
||||
@IObjectExplorerService private _objectExplorerService: IObjectExplorerService,
|
||||
@IErrorMessageService private _errorMessageService: IErrorMessageService
|
||||
@IConnectionManagementService private _connectionManagementService: IConnectionManagementService
|
||||
) {
|
||||
super(id, label);
|
||||
}
|
||||
@@ -269,8 +267,7 @@ export class RecentConnectionsFilterAction extends Action {
|
||||
constructor(
|
||||
id: string,
|
||||
label: string,
|
||||
private view: ServerTreeView,
|
||||
@IConnectionManagementService private _connectionManagementService: IConnectionManagementService
|
||||
private view: ServerTreeView
|
||||
) {
|
||||
super(id, label);
|
||||
this.class = RecentConnectionsFilterAction.enabledClass;
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { ITree } from 'vs/base/parts/tree/browser/tree';
|
||||
import { ExecuteCommandAction } from 'vs/platform/actions/common/actions';
|
||||
import { ICommandService } from 'vs/platform/commands/common/commands';
|
||||
|
||||
|
||||
@@ -9,7 +9,6 @@ import { ICapabilitiesService } from 'sql/platform/capabilities/common/capabilit
|
||||
import { IConnectionManagementService } from 'sql/platform/connection/common/connectionManagement';
|
||||
import { ConnectionProfile } from 'sql/platform/connection/common/connectionProfile';
|
||||
import { ITreeItem } from 'sql/workbench/common/views';
|
||||
import { IConnectionDialogService } from 'sql/workbench/services/connection/common/connectionDialogService';
|
||||
import { IObjectExplorerService } from 'sql/workbench/services/objectExplorer/browser/objectExplorerService';
|
||||
import { hash } from 'vs/base/common/hash';
|
||||
import { Disposable } from 'vs/base/common/lifecycle';
|
||||
@@ -43,7 +42,6 @@ export class OEShimService extends Disposable implements IOEShimService {
|
||||
constructor(
|
||||
@IObjectExplorerService private oe: IObjectExplorerService,
|
||||
@IConnectionManagementService private cm: IConnectionManagementService,
|
||||
@IConnectionDialogService private cd: IConnectionDialogService,
|
||||
@ICapabilitiesService private capabilities: ICapabilitiesService
|
||||
) {
|
||||
super();
|
||||
|
||||
@@ -19,7 +19,7 @@ import { ConnectionProfileGroup } from 'sql/platform/connection/common/connectio
|
||||
import { ConnectionProfile } from 'sql/platform/connection/common/connectionProfile';
|
||||
import { TreeUpdateUtils } from 'sql/workbench/parts/objectExplorer/browser/treeUpdateUtils';
|
||||
import { IConnectionManagementService } from 'sql/platform/connection/common/connectionManagement';
|
||||
import { MenuId, IMenuService, MenuItemAction } from 'vs/platform/actions/common/actions';
|
||||
import { MenuId, IMenuService } from 'vs/platform/actions/common/actions';
|
||||
import { ConnectionContextKey } from 'sql/workbench/parts/connection/common/connectionContextKey';
|
||||
import { TreeNodeContextKey } from 'sql/workbench/parts/objectExplorer/common/treeNodeContextKey';
|
||||
import { IQueryManagementService } from 'sql/platform/query/common/queryManagement';
|
||||
|
||||
@@ -15,7 +15,6 @@ import { IConnectionManagementService } from 'sql/platform/connection/common/con
|
||||
import { TreeNode } from 'sql/workbench/parts/objectExplorer/common/treeNode';
|
||||
import { InputBox } from 'vs/base/browser/ui/inputbox/inputBox';
|
||||
import { badgeRenderer, iconRenderer } from 'sql/workbench/parts/objectExplorer/browser/iconRenderer';
|
||||
import { ContextKeyExpr, IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
|
||||
export interface IConnectionTemplateData {
|
||||
@@ -59,8 +58,7 @@ export class ServerTreeRenderer implements IRenderer {
|
||||
|
||||
constructor(
|
||||
isCompact: boolean,
|
||||
@IConnectionManagementService private _connectionManagementService: IConnectionManagementService,
|
||||
@IContextKeyService private _contextKeyService: IContextKeyService
|
||||
@IConnectionManagementService private _connectionManagementService: IConnectionManagementService
|
||||
) {
|
||||
// isCompact defaults to false unless explicitly set by instantiation call.
|
||||
if (isCompact) {
|
||||
|
||||
@@ -10,7 +10,7 @@ import Severity from 'vs/base/common/severity';
|
||||
import { IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
import { attachListStyler } from 'vs/platform/theme/common/styler';
|
||||
import { ITree } from 'vs/base/parts/tree/browser/tree';
|
||||
import { IDisposable, dispose, Disposable } from 'vs/base/common/lifecycle';
|
||||
import { Disposable } from 'vs/base/common/lifecycle';
|
||||
import { localize } from 'vs/nls';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { Event, Emitter } from 'vs/base/common/event';
|
||||
|
||||
@@ -189,9 +189,8 @@ suite('SQL Connection Tree Action tests', () => {
|
||||
id: 'testId'
|
||||
});
|
||||
let connectionManagementService = createConnectionManagementService(isConnectedReturnValue, connection);
|
||||
let objectExplorerService = createObjectExplorerService(connectionManagementService.object, undefined);
|
||||
|
||||
let changeConnectionAction: DisconnectConnectionAction = new DisconnectConnectionAction(DisconnectConnectionAction.ID, DisconnectConnectionAction.LABEL, connection, connectionManagementService.object, objectExplorerService.object, errorMessageService.object);
|
||||
let changeConnectionAction: DisconnectConnectionAction = new DisconnectConnectionAction(DisconnectConnectionAction.ID, DisconnectConnectionAction.LABEL, connection, connectionManagementService.object);
|
||||
|
||||
let actionContext = new ObjectExplorerActionsContext();
|
||||
actionContext.connectionProfile = connection.toIConnectionProfile();
|
||||
@@ -212,8 +211,6 @@ suite('SQL Connection Tree Action tests', () => {
|
||||
});
|
||||
|
||||
test('ActiveConnectionsFilterAction - test if view is called to display filtered results', (done) => {
|
||||
let connectionManagementService = createConnectionManagementService(true, undefined);
|
||||
|
||||
let instantiationService = TypeMoq.Mock.ofType(InstantiationService, TypeMoq.MockBehavior.Loose);
|
||||
instantiationService.setup(x => x.createInstance(TypeMoq.It.isAny())).returns((input) => {
|
||||
return new Promise((resolve) => resolve({}));
|
||||
@@ -229,8 +226,6 @@ suite('SQL Connection Tree Action tests', () => {
|
||||
});
|
||||
|
||||
test('ActiveConnectionsFilterAction - test if view is called refresh results if action is toggled', (done) => {
|
||||
let connectionManagementService = createConnectionManagementService(true, undefined);
|
||||
|
||||
let instantiationService = TypeMoq.Mock.ofType(InstantiationService, TypeMoq.MockBehavior.Loose);
|
||||
instantiationService.setup(x => x.createInstance(TypeMoq.It.isAny())).returns((input) => {
|
||||
return new Promise((resolve) => resolve({}));
|
||||
@@ -247,8 +242,6 @@ suite('SQL Connection Tree Action tests', () => {
|
||||
});
|
||||
|
||||
test('RecentConnectionsFilterAction - test if view is called to display filtered results', (done) => {
|
||||
let connectionManagementService = createConnectionManagementService(true, undefined);
|
||||
|
||||
let instantiationService = TypeMoq.Mock.ofType(InstantiationService, TypeMoq.MockBehavior.Loose);
|
||||
instantiationService.setup(x => x.createInstance(TypeMoq.It.isAny())).returns((input) => {
|
||||
return new Promise((resolve) => resolve({}));
|
||||
@@ -257,15 +250,13 @@ suite('SQL Connection Tree Action tests', () => {
|
||||
let serverTreeView = TypeMoq.Mock.ofType(ServerTreeView, TypeMoq.MockBehavior.Strict, undefined, instantiationService.object, undefined, undefined, undefined, undefined, capabilitiesService);
|
||||
serverTreeView.setup(x => x.showFilteredTree(TypeMoq.It.isAnyString()));
|
||||
serverTreeView.setup(x => x.refreshTree());
|
||||
let connectionTreeAction: RecentConnectionsFilterAction = new RecentConnectionsFilterAction(RecentConnectionsFilterAction.ID, RecentConnectionsFilterAction.LABEL, serverTreeView.object, connectionManagementService.object);
|
||||
let connectionTreeAction: RecentConnectionsFilterAction = new RecentConnectionsFilterAction(RecentConnectionsFilterAction.ID, RecentConnectionsFilterAction.LABEL, serverTreeView.object);
|
||||
connectionTreeAction.run().then((value) => {
|
||||
serverTreeView.verify(x => x.showFilteredTree('recent'), TypeMoq.Times.once());
|
||||
}).then(() => done(), (err) => done(err));
|
||||
});
|
||||
|
||||
test('RecentConnectionsFilterAction - test if view is called refresh results if action is toggled', (done) => {
|
||||
let connectionManagementService = createConnectionManagementService(true, undefined);
|
||||
|
||||
let instantiationService = TypeMoq.Mock.ofType(InstantiationService, TypeMoq.MockBehavior.Loose);
|
||||
instantiationService.setup(x => x.createInstance(TypeMoq.It.isAny())).returns((input) => {
|
||||
return new Promise((resolve) => resolve({}));
|
||||
@@ -274,7 +265,7 @@ suite('SQL Connection Tree Action tests', () => {
|
||||
let serverTreeView = TypeMoq.Mock.ofType(ServerTreeView, TypeMoq.MockBehavior.Strict, undefined, instantiationService.object, undefined, undefined, undefined, undefined, capabilitiesService);
|
||||
serverTreeView.setup(x => x.showFilteredTree(TypeMoq.It.isAnyString()));
|
||||
serverTreeView.setup(x => x.refreshTree());
|
||||
let connectionTreeAction: RecentConnectionsFilterAction = new RecentConnectionsFilterAction(RecentConnectionsFilterAction.ID, RecentConnectionsFilterAction.LABEL, serverTreeView.object, connectionManagementService.object);
|
||||
let connectionTreeAction: RecentConnectionsFilterAction = new RecentConnectionsFilterAction(RecentConnectionsFilterAction.ID, RecentConnectionsFilterAction.LABEL, serverTreeView.object);
|
||||
connectionTreeAction.isSet = true;
|
||||
connectionTreeAction.run().then((value) => {
|
||||
serverTreeView.verify(x => x.refreshTree(), TypeMoq.Times.once());
|
||||
|
||||
@@ -15,9 +15,7 @@ import { Action } from 'vs/base/common/actions';
|
||||
import * as nls from 'vs/nls';
|
||||
import { IEditorAction } from 'vs/editor/common/editorCommon';
|
||||
import { IEditorService, ACTIVE_GROUP } from 'vs/workbench/services/editor/common/editorService';
|
||||
import { ICommandService } from 'vs/platform/commands/common/commands';
|
||||
import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { INotificationService } from 'vs/platform/notification/common/notification';
|
||||
|
||||
export class ProfilerConnect extends Action {
|
||||
private static readonly ConnectText = nls.localize('profilerAction.connect', "Connect");
|
||||
@@ -88,9 +86,7 @@ export class ProfilerCreate extends Action {
|
||||
|
||||
constructor(
|
||||
id: string, label: string,
|
||||
@ICommandService private _commandService: ICommandService,
|
||||
@IProfilerService private _profilerService: IProfilerService,
|
||||
@INotificationService private _notificationService: INotificationService
|
||||
@IProfilerService private _profilerService: IProfilerService
|
||||
) {
|
||||
super(id, label, 'add');
|
||||
}
|
||||
|
||||
@@ -505,87 +505,6 @@ export class FindWidget extends Widget implements IOverlayWidget, IHorizontalSas
|
||||
}
|
||||
}
|
||||
|
||||
interface ISimpleCheckboxOpts {
|
||||
parent: HTMLElement;
|
||||
title: string;
|
||||
onChange: () => void;
|
||||
}
|
||||
|
||||
class SimpleCheckbox extends Widget {
|
||||
|
||||
private static _COUNTER = 0;
|
||||
|
||||
private _opts: ISimpleCheckboxOpts;
|
||||
private _domNode: HTMLElement;
|
||||
private _checkbox: HTMLInputElement;
|
||||
private _label: HTMLLabelElement;
|
||||
|
||||
constructor(opts: ISimpleCheckboxOpts) {
|
||||
super();
|
||||
this._opts = opts;
|
||||
|
||||
this._domNode = document.createElement('div');
|
||||
this._domNode.className = 'monaco-checkbox';
|
||||
this._domNode.title = this._opts.title;
|
||||
this._domNode.tabIndex = 0;
|
||||
|
||||
this._checkbox = document.createElement('input');
|
||||
this._checkbox.type = 'checkbox';
|
||||
this._checkbox.className = 'checkbox';
|
||||
this._checkbox.id = 'checkbox-' + SimpleCheckbox._COUNTER++;
|
||||
this._checkbox.tabIndex = -1;
|
||||
|
||||
this._label = document.createElement('label');
|
||||
this._label.className = 'label';
|
||||
// Connect the label and the checkbox. Checkbox will get checked when the label recieves a click.
|
||||
this._label.htmlFor = this._checkbox.id;
|
||||
this._label.tabIndex = -1;
|
||||
|
||||
this._domNode.appendChild(this._checkbox);
|
||||
this._domNode.appendChild(this._label);
|
||||
|
||||
this._opts.parent.appendChild(this._domNode);
|
||||
|
||||
this.onchange(this._checkbox, (e) => {
|
||||
this._opts.onChange();
|
||||
});
|
||||
}
|
||||
|
||||
public get domNode(): HTMLElement {
|
||||
return this._domNode;
|
||||
}
|
||||
|
||||
public get checked(): boolean {
|
||||
return this._checkbox.checked;
|
||||
}
|
||||
|
||||
public set checked(newValue: boolean) {
|
||||
this._checkbox.checked = newValue;
|
||||
}
|
||||
|
||||
public focus(): void {
|
||||
this._checkbox.focus();
|
||||
}
|
||||
|
||||
private enable(): void {
|
||||
this._checkbox.removeAttribute('disabled');
|
||||
}
|
||||
|
||||
private disable(): void {
|
||||
this._checkbox.disabled = true;
|
||||
}
|
||||
|
||||
public setEnabled(enabled: boolean): void {
|
||||
if (enabled) {
|
||||
this.enable();
|
||||
this.domNode.tabIndex = 0;
|
||||
} else {
|
||||
this.disable();
|
||||
this.domNode.tabIndex = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
interface ISimpleButtonOpts {
|
||||
label: string;
|
||||
className: string;
|
||||
|
||||
@@ -13,7 +13,6 @@ import * as nls from 'vs/nls';
|
||||
|
||||
import { EditorInput, ConfirmResult } from 'vs/workbench/common/editor';
|
||||
import { IEditorModel } from 'vs/platform/editor/common/editor';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { INotificationService } from 'vs/platform/notification/common/notification';
|
||||
import { Event, Emitter } from 'vs/base/common/event';
|
||||
import { generateUuid } from 'vs/base/common/uuid';
|
||||
@@ -46,7 +45,6 @@ export class ProfilerInput extends EditorInput implements IProfilerSession {
|
||||
|
||||
constructor(
|
||||
public connection: IConnectionProfile,
|
||||
@IInstantiationService private _instantiationService: IInstantiationService,
|
||||
@IProfilerService private _profilerService: IProfilerService,
|
||||
@INotificationService private _notificationService: INotificationService,
|
||||
@IDialogService private _dialogService: IDialogService
|
||||
|
||||
@@ -22,7 +22,6 @@ import { GridTableState } from 'sql/workbench/parts/query/common/gridPanelState'
|
||||
import * as Constants from 'sql/workbench/contrib/extensions/common/constants';
|
||||
import { IAdsTelemetryService } from 'sql/platform/telemetry/common/telemetry';
|
||||
import * as TelemetryKeys from 'sql/platform/telemetry/common/telemetryKeys';
|
||||
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
|
||||
import { getErrorMessage } from 'vs/base/common/errors';
|
||||
|
||||
export interface IGridActionContext {
|
||||
@@ -212,8 +211,7 @@ export class ChartDataAction extends Action {
|
||||
|
||||
constructor(
|
||||
@IEditorService private editorService: IEditorService,
|
||||
@IExtensionTipsService private readonly extensionTipsService: IExtensionTipsService,
|
||||
@IEnvironmentService private readonly environmentService: IEnvironmentService
|
||||
@IExtensionTipsService private readonly extensionTipsService: IExtensionTipsService
|
||||
) {
|
||||
super(ChartDataAction.ID, ChartDataAction.LABEL, ChartDataAction.ICON);
|
||||
}
|
||||
|
||||
@@ -40,8 +40,6 @@ import { CommandsRegistry, ICommandService } from 'vs/platform/commands/common/c
|
||||
import { ManageActionContext } from 'sql/workbench/browser/actions';
|
||||
import { ItemContextKey } from 'sql/workbench/parts/dashboard/browser/widgets/explorer/explorerTreeContext';
|
||||
|
||||
const gridCommandsWeightBonus = 100; // give our commands a little bit more weight over other default list/tree commands
|
||||
|
||||
export const QueryEditorVisibleCondition = ContextKeyExpr.has(queryContext.queryEditorVisibleId);
|
||||
export const ResultsGridFocusCondition = ContextKeyExpr.and(ContextKeyExpr.has(queryContext.resultsVisibleId), ContextKeyExpr.has(queryContext.resultsGridFocussedId));
|
||||
export const ResultsMessagesFocusCondition = ContextKeyExpr.and(ContextKeyExpr.has(queryContext.resultsVisibleId), ContextKeyExpr.has(queryContext.resultsMessagesFocussedId));
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
import 'vs/css!./media/queryActions';
|
||||
import * as nls from 'vs/nls';
|
||||
import { Action, IActionViewItem, IActionRunner } from 'vs/base/common/actions';
|
||||
import { IDisposable, dispose, Disposable } from 'vs/base/common/lifecycle';
|
||||
import { IDisposable, Disposable } from 'vs/base/common/lifecycle';
|
||||
import { IContextViewService } from 'vs/platform/contextview/browser/contextView';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
@@ -546,10 +546,6 @@ export class ToggleSqlCmdModeAction extends QueryTaskbarAction {
|
||||
this.isSqlCmdMode ? this.updateCssClass(ToggleSqlCmdModeAction.DisableSqlcmdClass) : this.updateCssClass(ToggleSqlCmdModeAction.EnableSqlcmdClass);
|
||||
}
|
||||
|
||||
private setSqlCmdModeFalse() {
|
||||
|
||||
}
|
||||
|
||||
public async run(): Promise<void> {
|
||||
const toSqlCmdState = !this.isSqlCmdMode; // input.state change triggers event that changes this.isSqlCmdMode, so store it before using
|
||||
this.editor.input.state.isSqlCmdMode = toSqlCmdState;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
import 'vs/css!./media/queryEditor';
|
||||
|
||||
import * as DOM from 'vs/base/browser/dom';
|
||||
import { EditorOptions, IEditorControl, IEditorMemento, IEditorCloseEvent } from 'vs/workbench/common/editor';
|
||||
import { EditorOptions, IEditorControl, IEditorMemento } from 'vs/workbench/common/editor';
|
||||
import { BaseEditor, EditorMemento } from 'vs/workbench/browser/parts/editor/baseEditor';
|
||||
import { Orientation } from 'vs/base/browser/ui/sash/sash';
|
||||
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
|
||||
@@ -23,7 +23,6 @@ import { dispose, Disposable, DisposableStore } from 'vs/base/common/lifecycle';
|
||||
import { attachTabbedPanelStyler } from 'sql/platform/theme/common/styler';
|
||||
import { IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
import { Event } from 'vs/base/common/event';
|
||||
import { find } from 'vs/base/common/arrays';
|
||||
import { startsWith } from 'vs/base/common/strings';
|
||||
|
||||
class MessagesView extends Disposable implements IPanelView {
|
||||
|
||||
@@ -112,7 +112,6 @@ suite('SQL QueryAction Tests', () => {
|
||||
// ... Create assert variables
|
||||
let isConnected: boolean = undefined;
|
||||
let connectionParams: INewConnectionParams = undefined;
|
||||
let calledRunQuery: boolean = false;
|
||||
let countCalledShowDialog: number = 0;
|
||||
|
||||
// ... Mock "showDialog" ConnectionDialogService
|
||||
@@ -131,9 +130,7 @@ suite('SQL QueryAction Tests', () => {
|
||||
|
||||
// ... Mock QueryModelService
|
||||
let queryModelService = TypeMoq.Mock.ofType(QueryModelService, TypeMoq.MockBehavior.Loose);
|
||||
queryModelService.setup(x => x.runQuery(TypeMoq.It.isAny(), undefined, TypeMoq.It.isAny(), TypeMoq.It.isAny())).callback(() => {
|
||||
calledRunQuery = true;
|
||||
});
|
||||
queryModelService.setup(x => x.runQuery(TypeMoq.It.isAny(), undefined, TypeMoq.It.isAny(), TypeMoq.It.isAny()));
|
||||
|
||||
// If I call run on RunQueryAction when I am not connected
|
||||
let queryAction: RunQueryAction = new RunQueryAction(editor.object, queryModelService.object, connectionManagementService.object);
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
import 'vs/css!./media/qp';
|
||||
|
||||
import { ElementRef, Component, Inject, forwardRef, OnDestroy, OnInit, ViewChild } from '@angular/core';
|
||||
import { ElementRef, Component, Inject, OnDestroy, OnInit, ViewChild } from '@angular/core';
|
||||
import * as QP from 'html-query-plan';
|
||||
|
||||
import { IQueryPlanParams, IBootstrapParams } from 'sql/workbench/services/bootstrap/common/bootstrapParams';
|
||||
@@ -30,7 +30,6 @@ export class QueryPlanComponent implements OnDestroy, OnInit {
|
||||
@ViewChild('container', { read: ElementRef }) _container: ElementRef;
|
||||
|
||||
constructor(
|
||||
@Inject(forwardRef(() => ElementRef)) private _el: ElementRef,
|
||||
@Inject(IBootstrapParams) private _params: IQueryPlanParams
|
||||
) { }
|
||||
|
||||
|
||||
@@ -29,7 +29,6 @@ export interface ITaskHistoryTemplateData {
|
||||
export class TaskHistoryRenderer implements IRenderer {
|
||||
|
||||
public static readonly TASKOBJECT_HEIGHT = 22;
|
||||
private static readonly TASKOBJECT_TEMPLATE_ID = 'carbonTask';
|
||||
private static readonly FAIL_CLASS = 'error';
|
||||
private static readonly SUCCESS_CLASS = 'success';
|
||||
private static readonly INPROGRESS_CLASS = 'in-progress';
|
||||
|
||||
@@ -10,7 +10,7 @@ import { Tree } from 'vs/base/parts/tree/browser/treeImpl';
|
||||
import { IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
import { attachListStyler } from 'vs/platform/theme/common/styler';
|
||||
import { ITree } from 'vs/base/parts/tree/browser/tree';
|
||||
import { dispose, Disposable } from 'vs/base/common/lifecycle';
|
||||
import { Disposable } from 'vs/base/common/lifecycle';
|
||||
import { DefaultFilter, DefaultDragAndDrop, DefaultAccessibilityProvider } from 'vs/base/parts/tree/browser/treeDefaults';
|
||||
import { localize } from 'vs/nls';
|
||||
import { hide, $, append } from 'vs/base/browser/dom';
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
import { localize } from 'vs/nls';
|
||||
import { Action } from 'vs/base/common/actions';
|
||||
import { ITaskService } from 'sql/platform/tasks/common/tasksService';
|
||||
import { TaskNode, TaskExecutionMode, TaskStatus } from 'sql/platform/tasks/common/tasksNode';
|
||||
import { TaskNode } from 'sql/platform/tasks/common/tasksNode';
|
||||
import { IQueryEditorService } from 'sql/workbench/services/queryEditor/common/queryEditorService';
|
||||
import Severity from 'vs/base/common/severity';
|
||||
import { IErrorMessageService } from 'sql/platform/errorMessage/common/errorMessageService';
|
||||
|
||||
@@ -27,7 +27,6 @@ import * as types from 'vs/base/common/types';
|
||||
import { trim } from 'vs/base/common/strings';
|
||||
import { localize } from 'vs/nls';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
|
||||
import { CmsConnectionController } from 'sql/workbench/services/connection/browser/cmsConnectionController';
|
||||
import { entries } from 'sql/base/common/collections';
|
||||
import { find } from 'vs/base/common/arrays';
|
||||
@@ -81,7 +80,6 @@ export class ConnectionDialogService implements IConnectionDialogService {
|
||||
private _connectionManagementService: IConnectionManagementService;
|
||||
|
||||
constructor(
|
||||
@IWorkbenchLayoutService private layoutService: IWorkbenchLayoutService,
|
||||
@IInstantiationService private _instantiationService: IInstantiationService,
|
||||
@ICapabilitiesService private _capabilitiesService: ICapabilitiesService,
|
||||
@IErrorMessageService private _errorMessageService: IErrorMessageService,
|
||||
|
||||
@@ -21,7 +21,7 @@ suite('ConnectionDialogService tests', () => {
|
||||
|
||||
setup(() => {
|
||||
let errorMessageService = getMockErrorMessageService();
|
||||
connectionDialogService = new ConnectionDialogService(undefined, undefined, undefined, errorMessageService.object,
|
||||
connectionDialogService = new ConnectionDialogService(undefined, undefined, errorMessageService.object,
|
||||
undefined, undefined, undefined);
|
||||
mockConnectionManagementService = TypeMoq.Mock.ofType(ConnectionManagementService, TypeMoq.MockBehavior.Strict, {}, {}, new TestStorageService());
|
||||
(connectionDialogService as any)._connectionManagementService = mockConnectionManagementService.object;
|
||||
|
||||
@@ -44,7 +44,7 @@ export interface DialogComponentParams extends IBootstrapParams {
|
||||
export class DialogContainer implements AfterViewInit {
|
||||
private _onResize = new Emitter<void>();
|
||||
public readonly onResize: Event<void> = this._onResize.event;
|
||||
private _dialogPane: DialogPane;
|
||||
public _dialogPane: DialogPane;
|
||||
|
||||
public modelViewId: string;
|
||||
@ViewChild(ModelViewContent) private _modelViewContent: ModelViewContent;
|
||||
|
||||
@@ -31,7 +31,6 @@ export class DialogModal extends Modal {
|
||||
private _onCancel = new Emitter<void>();
|
||||
|
||||
// Buttons
|
||||
private _cancelButton: Button;
|
||||
private _doneButton: Button;
|
||||
|
||||
constructor(
|
||||
@@ -75,7 +74,7 @@ export class DialogModal extends Modal {
|
||||
this._dialog.onValidityChanged(valid => {
|
||||
this._doneButton.enabled = valid && this._dialog.okButton.enabled;
|
||||
});
|
||||
this._cancelButton = this.addDialogButton(this._dialog.cancelButton, () => this.cancel(), false);
|
||||
this.addDialogButton(this._dialog.cancelButton, () => this.cancel(), false);
|
||||
this._dialog.cancelButton.registerClickEvent(this._onCancel.event);
|
||||
|
||||
let messageChangeHandler = (message: DialogMessage) => {
|
||||
|
||||
@@ -34,15 +34,12 @@ export class WizardModal extends Modal {
|
||||
// Wizard HTML elements
|
||||
private _body: HTMLElement;
|
||||
|
||||
private _messageAndPageContainer: HTMLElement;
|
||||
private _pageContainer: HTMLElement;
|
||||
|
||||
// Buttons
|
||||
private _previousButton: Button;
|
||||
private _nextButton: Button;
|
||||
private _generateScriptButton: Button;
|
||||
private _doneButton: Button;
|
||||
private _cancelButton: Button;
|
||||
|
||||
constructor(
|
||||
private _wizard: Wizard,
|
||||
@@ -83,10 +80,10 @@ export class WizardModal extends Modal {
|
||||
|
||||
this._previousButton = this.addDialogButton(this._wizard.backButton, () => this.showPage(this._wizard.currentPage - 1));
|
||||
this._nextButton = this.addDialogButton(this._wizard.nextButton, () => this.showPage(this._wizard.currentPage + 1, true, true), true, true);
|
||||
this._generateScriptButton = this.addDialogButton(this._wizard.generateScriptButton, () => undefined);
|
||||
this.addDialogButton(this._wizard.generateScriptButton, () => undefined);
|
||||
this._doneButton = this.addDialogButton(this._wizard.doneButton, () => this.done(), false, true);
|
||||
this._wizard.doneButton.registerClickEvent(this._onDone.event);
|
||||
this._cancelButton = this.addDialogButton(this._wizard.cancelButton, () => this.cancel(), false);
|
||||
this.addDialogButton(this._wizard.cancelButton, () => this.cancel(), false);
|
||||
this._wizard.cancelButton.registerClickEvent(this._onCancel.event);
|
||||
|
||||
let messageChangeHandler = (message: DialogMessage) => {
|
||||
@@ -133,7 +130,6 @@ export class WizardModal extends Modal {
|
||||
this.initializeNavigation(this._body);
|
||||
|
||||
const mpContainer = append(this._body, $('div.dialog-message-and-page-container'));
|
||||
this._messageAndPageContainer = mpContainer;
|
||||
mpContainer.append(this._messageElement);
|
||||
this._pageContainer = append(mpContainer, $('div.dialogModal-page-container'));
|
||||
|
||||
|
||||
@@ -41,7 +41,6 @@ export class WizardNavigation implements AfterViewInit {
|
||||
|
||||
@ViewChild('container', { read: ElementRef }) private _container: ElementRef;
|
||||
constructor(
|
||||
@Inject(forwardRef(() => ElementRef)) private _el: ElementRef,
|
||||
@Inject(forwardRef(() => ChangeDetectorRef)) private _changeRef: ChangeDetectorRef,
|
||||
@Inject(IBootstrapParams) private _params: WizardNavigationParams,
|
||||
@Inject(IWorkbenchThemeService) private _themeService: IWorkbenchThemeService) {
|
||||
|
||||
@@ -9,7 +9,7 @@ import { FileBrowserRenderer } from 'sql/workbench/services/fileBrowser/browser/
|
||||
import { IFileBrowserService } from 'sql/platform/fileBrowser/common/interfaces';
|
||||
import { FileNode } from 'sql/workbench/services/fileBrowser/common/fileNode';
|
||||
import errors = require('vs/base/common/errors');
|
||||
import { IDisposable, dispose, Disposable } from 'vs/base/common/lifecycle';
|
||||
import { IDisposable, Disposable } from 'vs/base/common/lifecycle';
|
||||
import * as DOM from 'vs/base/browser/dom';
|
||||
import nls = require('vs/nls');
|
||||
import { DefaultFilter, DefaultAccessibilityProvider, DefaultDragAndDrop } from 'vs/base/parts/tree/browser/treeDefaults';
|
||||
|
||||
@@ -73,7 +73,7 @@ const notebookRegistry = Registry.as<INotebookProviderRegistry>(Extensions.Noteb
|
||||
|
||||
class ProviderDescriptor {
|
||||
private _instanceReady = new Deferred<INotebookProvider>();
|
||||
constructor(private providerId: string, private _instance?: INotebookProvider) {
|
||||
constructor(private _instance?: INotebookProvider) {
|
||||
if (_instance) {
|
||||
this._instanceReady.resolve(_instance);
|
||||
}
|
||||
@@ -243,7 +243,7 @@ export class NotebookService extends Disposable implements INotebookService {
|
||||
let registration = p.registration;
|
||||
|
||||
if (!this._providers.has(p.id)) {
|
||||
this._providers.set(p.id, new ProviderDescriptor(p.id));
|
||||
this._providers.set(p.id, new ProviderDescriptor());
|
||||
}
|
||||
if (registration.fileExtensions) {
|
||||
if (Array.isArray<string>(registration.fileExtensions)) {
|
||||
@@ -266,7 +266,7 @@ export class NotebookService extends Disposable implements INotebookService {
|
||||
// Update, which will resolve the promise for anyone waiting on the instance to be registered
|
||||
providerDescriptor.instance = instance;
|
||||
} else {
|
||||
this._providers.set(providerId, new ProviderDescriptor(providerId, instance));
|
||||
this._providers.set(providerId, new ProviderDescriptor(instance));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -98,7 +98,6 @@ export class SqlSessionManager implements nb.SessionManager {
|
||||
export class SqlSession implements nb.ISession {
|
||||
private _kernel: SqlKernel;
|
||||
private _defaultKernelLoaded = false;
|
||||
private _currentConnection: IConnectionProfile;
|
||||
|
||||
public set defaultKernelLoaded(value) {
|
||||
this._defaultKernelLoaded = value;
|
||||
|
||||
@@ -14,7 +14,7 @@ import * as TypeMoq from 'typemoq';
|
||||
import * as assert from 'assert';
|
||||
import { ServerTreeView } from 'sql/workbench/parts/objectExplorer/browser/serverTreeView';
|
||||
import { ConnectionOptionSpecialType, ServiceOptionType } from 'sql/workbench/api/common/sqlExtHostTypes';
|
||||
import { Event, Emitter } from 'vs/base/common/event';
|
||||
import { Event } from 'vs/base/common/event';
|
||||
import { mssqlProviderName } from 'sql/platform/connection/common/constants';
|
||||
import { NullLogService } from 'vs/platform/log/common/log';
|
||||
import { TestObjectExplorerProvider } from 'sql/workbench/services/objectExplorer/test/common/testObjectExplorerProvider';
|
||||
@@ -127,7 +127,6 @@ suite('SQL Object Explorer Service tests', () => {
|
||||
sqlOEProvider = TypeMoq.Mock.ofType(TestObjectExplorerProvider, TypeMoq.MockBehavior.Loose);
|
||||
sqlOEProvider.callBase = true;
|
||||
|
||||
let onCapabilitiesRegistered = new Emitter<string>();
|
||||
let sqlProvider = {
|
||||
providerId: mssqlProviderName,
|
||||
displayName: 'MSSQL',
|
||||
@@ -265,12 +264,6 @@ suite('SQL Object Explorer Service tests', () => {
|
||||
|
||||
connectionManagementService.setup(x => x.getCapabilities(mssqlProviderName)).returns(() => undefined);
|
||||
|
||||
let extensionManagementServiceMock = {
|
||||
getInstalled: () => {
|
||||
return Promise.resolve([]);
|
||||
}
|
||||
};
|
||||
|
||||
const logService = new NullLogService();
|
||||
objectExplorerService = new ObjectExplorerService(connectionManagementService.object, undefined, capabilitiesService, logService);
|
||||
objectExplorerService.registerProvider(mssqlProviderName, sqlOEProvider.object);
|
||||
|
||||
@@ -8,7 +8,6 @@ import { QueryInput } from 'sql/workbench/parts/query/common/queryInput';
|
||||
import { EditDataInput } from 'sql/workbench/parts/editData/browser/editDataInput';
|
||||
import { IConnectableInput, IConnectionManagementService } from 'sql/platform/connection/common/connectionManagement';
|
||||
import { IQueryEditorService, IQueryEditorOptions } from 'sql/workbench/services/queryEditor/common/queryEditorService';
|
||||
import { QueryPlanInput } from 'sql/workbench/parts/queryPlan/common/queryPlanInput';
|
||||
import { sqlModeId, untitledFilePrefix, getSupportedInputResource } from 'sql/workbench/browser/customInputConverter';
|
||||
import * as TaskUtilities from 'sql/workbench/browser/taskUtilities';
|
||||
|
||||
|
||||
@@ -10,9 +10,6 @@ import { IObjectExplorerService } from 'sql/workbench/services/objectExplorer/br
|
||||
import { TestConnectionManagementService } from 'sql/platform/connection/test/common/testConnectionManagementService';
|
||||
import { IConnectionProfile } from 'sql/platform/connection/common/interfaces';
|
||||
import { ConnectionProfile } from 'sql/platform/connection/common/connectionProfile';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { UntitledEditorInput } from 'vs/workbench/common/editor/untitledEditorInput';
|
||||
import { QueryInput } from 'sql/workbench/parts/query/common/queryInput';
|
||||
import { TestEditorService } from 'vs/workbench/test/workbenchTestServices';
|
||||
import { assign } from 'vs/base/common/objects';
|
||||
|
||||
@@ -76,8 +73,6 @@ suite('TaskUtilities', function () {
|
||||
|
||||
// Mock the workbench service to return the active tab connection
|
||||
let tabConnectionUri = 'file://test_uri';
|
||||
let editorInput = new UntitledEditorInput(URI.parse(tabConnectionUri), false, undefined, undefined, undefined, undefined, undefined, undefined);
|
||||
let queryInput = new QueryInput(undefined, editorInput, undefined, undefined, undefined, undefined, undefined, undefined);
|
||||
mockConnectionManagementService.setup(x => x.getConnectionProfile(tabConnectionUri)).returns(() => tabProfile);
|
||||
|
||||
// If I call getCurrentGlobalConnection, it should return the expected profile from the active tab
|
||||
|
||||
@@ -29,7 +29,6 @@ suite('ExtHostModelView Validation Tests', () => {
|
||||
let widgetId = 'widget_id';
|
||||
let handle = 1;
|
||||
// let viewInitialized: Deferred<void>;
|
||||
let initializedModels: IComponentShape[];
|
||||
|
||||
setup(done => {
|
||||
// Set up the MainThreadModelViewShape proxy
|
||||
@@ -222,8 +221,7 @@ suite('ExtHostModelView Validation Tests', () => {
|
||||
|
||||
test('Inserting and removing components from a container should work correctly', () => {
|
||||
// Set up the mock proxy to save the component that gets initialized so that it can be verified
|
||||
let rootComponent: IComponentShape;
|
||||
mockProxy.setup(x => x.$initializeModel(It.isAny(), It.isAny())).callback((handle, componentShape) => rootComponent = componentShape);
|
||||
mockProxy.setup(x => x.$initializeModel(It.isAny(), It.isAny()));
|
||||
mockProxy.setup(x => x.$addToContainer(It.isAny(), It.isAny(), It.isAny(), undefined)).returns(() => Promise.resolve());
|
||||
mockProxy.setup(x => x.$addToContainer(It.isAny(), It.isAny(), It.isAny(), It.isAny())).returns(() => Promise.resolve());
|
||||
mockProxy.setup(x => x.$removeFromContainer(It.isAny(), It.isAny(), It.isAny())).returns(() => Promise.resolve());
|
||||
@@ -306,8 +304,7 @@ suite('ExtHostModelView Validation Tests', () => {
|
||||
|
||||
test('Removing a component that does not exist does not fail', () => {
|
||||
// Set up the mock proxy to save the component that gets initialized so that it can be verified
|
||||
let rootComponent: IComponentShape;
|
||||
mockProxy.setup(x => x.$initializeModel(It.isAny(), It.isAny())).callback((handle, componentShape) => rootComponent = componentShape);
|
||||
mockProxy.setup(x => x.$initializeModel(It.isAny(), It.isAny()));
|
||||
mockProxy.setup(x => x.$addToContainer(It.isAny(), It.isAny(), It.isAny(), undefined)).returns(() => Promise.resolve());
|
||||
mockProxy.setup(x => x.$addToContainer(It.isAny(), It.isAny(), It.isAny(), It.isAny())).returns(() => Promise.resolve());
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user