mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 11:01:37 -05:00
@@ -195,6 +195,7 @@ export function createViewContext(): ViewTestContext {
|
|||||||
data: [] as any[][],
|
data: [] as any[][],
|
||||||
columns: [] as string[],
|
columns: [] as string[],
|
||||||
onRowSelected: onClick.event,
|
onRowSelected: onClick.event,
|
||||||
|
appendData: (data: any[][]) => undefined,
|
||||||
});
|
});
|
||||||
|
|
||||||
let loadingComponent: () => azdata.LoadingComponent = () => Object.assign({}, componentBase, {
|
let loadingComponent: () => azdata.LoadingComponent = () => Object.assign({}, componentBase, {
|
||||||
|
|||||||
@@ -121,10 +121,7 @@ export class AssessmentResultGrid implements vscode.Disposable {
|
|||||||
if (this.dataItems) {
|
if (this.dataItems) {
|
||||||
this.dataItems.push(...asmtResult.items);
|
this.dataItems.push(...asmtResult.items);
|
||||||
}
|
}
|
||||||
|
this.table.appendData(asmtResult.items.map(item => this.convertToDataView(item)));
|
||||||
await this.table.updateProperties({
|
|
||||||
'data': this.dataItems.map(item => this.convertToDataView(item))
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private async showDetails(rowNumber: number) {
|
private async showDetails(rowNumber: number) {
|
||||||
|
|||||||
8
src/sql/azdata.proposed.d.ts
vendored
8
src/sql/azdata.proposed.d.ts
vendored
@@ -803,4 +803,12 @@ declare module 'azdata' {
|
|||||||
*/
|
*/
|
||||||
headerFilter?: boolean,
|
headerFilter?: boolean,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface TableComponent {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Append data to an exsiting table data.
|
||||||
|
*/
|
||||||
|
appendData(data: any[][]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,7 +27,8 @@ export enum ComponentEventType {
|
|||||||
* Actions that can be handled by ModelView components
|
* Actions that can be handled by ModelView components
|
||||||
*/
|
*/
|
||||||
export enum ModelViewAction {
|
export enum ModelViewAction {
|
||||||
SelectTab = 'selectTab'
|
SelectTab = 'selectTab',
|
||||||
|
AppendData = 'appendData'
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1427,7 +1427,9 @@ class TableComponentWrapper extends ComponentWrapper implements azdata.TableComp
|
|||||||
return emitter && emitter.event;
|
return emitter && emitter.event;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public appendData(v: any[][]): void {
|
||||||
|
this.doAction(ModelViewAction.AppendData, v);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class DropDownWrapper extends ComponentWrapper implements azdata.DropDownComponent {
|
class DropDownWrapper extends ComponentWrapper implements azdata.DropDownComponent {
|
||||||
|
|||||||
@@ -181,7 +181,8 @@ export enum ModelComponentTypes {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export enum ModelViewAction {
|
export enum ModelViewAction {
|
||||||
SelectTab = 'selectTab'
|
SelectTab = 'selectTab',
|
||||||
|
AppendData = 'appendData'
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum ColumnSizingMode {
|
export enum ColumnSizingMode {
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
|
|||||||
import { KeyMod, KeyCode } from 'vs/base/common/keyCodes';
|
import { KeyMod, KeyCode } from 'vs/base/common/keyCodes';
|
||||||
import { slickGridDataItemColumnValueWithNoData, textFormatter } from 'sql/base/browser/ui/table/formatters';
|
import { slickGridDataItemColumnValueWithNoData, textFormatter } from 'sql/base/browser/ui/table/formatters';
|
||||||
import { isUndefinedOrNull } from 'vs/base/common/types';
|
import { isUndefinedOrNull } from 'vs/base/common/types';
|
||||||
import { IComponent, IComponentDescriptor, IModelStore, ComponentEventType } from 'sql/platform/dashboard/browser/interfaces';
|
import { IComponent, IComponentDescriptor, IModelStore, ComponentEventType, ModelViewAction } from 'sql/platform/dashboard/browser/interfaces';
|
||||||
import { convertSizeToNumber } from 'sql/base/browser/dom';
|
import { convertSizeToNumber } from 'sql/base/browser/dom';
|
||||||
import { ButtonColumn, ButtonClickEventArgs } from 'sql/base/browser/ui/table/plugins/buttonColumn.plugin';
|
import { ButtonColumn, ButtonClickEventArgs } from 'sql/base/browser/ui/table/plugins/buttonColumn.plugin';
|
||||||
import { createIconCssClass } from 'sql/workbench/browser/modelComponents/iconUtils';
|
import { createIconCssClass } from 'sql/workbench/browser/modelComponents/iconUtils';
|
||||||
@@ -489,4 +489,16 @@ export default class TableComponent extends ComponentBase<azdata.TableComponentP
|
|||||||
public get headerFilter(): boolean {
|
public get headerFilter(): boolean {
|
||||||
return this.getPropertyOrDefault<boolean>((props) => props.headerFilter, false);
|
return this.getPropertyOrDefault<boolean>((props) => props.headerFilter, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public doAction(action: string, ...args: any[]): void {
|
||||||
|
switch (action) {
|
||||||
|
case ModelViewAction.AppendData:
|
||||||
|
this.appendData(args[0]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private appendData(data: any[][]) {
|
||||||
|
this._tableData.push(TableComponent.transformData(data, this.columns));
|
||||||
|
this.data = this._tableData.getItems().map(dataObject => Object.values(dataObject));
|
||||||
|
this.layoutTable();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user