mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-02 09:35:40 -05:00
@@ -195,6 +195,7 @@ export function createViewContext(): ViewTestContext {
|
||||
data: [] as any[][],
|
||||
columns: [] as string[],
|
||||
onRowSelected: onClick.event,
|
||||
appendData: (data: any[][]) => undefined,
|
||||
});
|
||||
|
||||
let loadingComponent: () => azdata.LoadingComponent = () => Object.assign({}, componentBase, {
|
||||
|
||||
@@ -121,10 +121,7 @@ export class AssessmentResultGrid implements vscode.Disposable {
|
||||
if (this.dataItems) {
|
||||
this.dataItems.push(...asmtResult.items);
|
||||
}
|
||||
|
||||
await this.table.updateProperties({
|
||||
'data': this.dataItems.map(item => this.convertToDataView(item))
|
||||
});
|
||||
this.table.appendData(asmtResult.items.map(item => this.convertToDataView(item)));
|
||||
}
|
||||
|
||||
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,
|
||||
}
|
||||
|
||||
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
|
||||
*/
|
||||
export enum ModelViewAction {
|
||||
SelectTab = 'selectTab'
|
||||
SelectTab = 'selectTab',
|
||||
AppendData = 'appendData'
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1427,7 +1427,9 @@ class TableComponentWrapper extends ComponentWrapper implements azdata.TableComp
|
||||
return emitter && emitter.event;
|
||||
}
|
||||
|
||||
|
||||
public appendData(v: any[][]): void {
|
||||
this.doAction(ModelViewAction.AppendData, v);
|
||||
}
|
||||
}
|
||||
|
||||
class DropDownWrapper extends ComponentWrapper implements azdata.DropDownComponent {
|
||||
|
||||
@@ -181,7 +181,8 @@ export enum ModelComponentTypes {
|
||||
}
|
||||
|
||||
export enum ModelViewAction {
|
||||
SelectTab = 'selectTab'
|
||||
SelectTab = 'selectTab',
|
||||
AppendData = 'appendData'
|
||||
}
|
||||
|
||||
export enum ColumnSizingMode {
|
||||
|
||||
@@ -25,7 +25,7 @@ import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
|
||||
import { KeyMod, KeyCode } from 'vs/base/common/keyCodes';
|
||||
import { slickGridDataItemColumnValueWithNoData, textFormatter } from 'sql/base/browser/ui/table/formatters';
|
||||
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 { ButtonColumn, ButtonClickEventArgs } from 'sql/base/browser/ui/table/plugins/buttonColumn.plugin';
|
||||
import { createIconCssClass } from 'sql/workbench/browser/modelComponents/iconUtils';
|
||||
@@ -489,4 +489,16 @@ export default class TableComponent extends ComponentBase<azdata.TableComponentP
|
||||
public get headerFilter(): boolean {
|
||||
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