Add grid streaming support for notebooks (#12175)

* add onResultUpdate handler in gridoutput

* convert rows to mimetype and html

* wait for data conversion to finish before saving

* detach changeRef after output is created

* fix save grid action

* move data conversion check to each cell

* move conversion logic to dataprovider

* notify data converting when user saves

* add comments and remove unused methods

* fix method return type

* fix tests

* fix convertData method header

* move azdata changes to azdata proposed

* address PR comments

* display top rows message

* fix messages/table ordering and query 100 rows

* add missing escape import

* set default max rows to 5000

* add undefined check to updateResultSet

* change gridDataConversionComplete return type
This commit is contained in:
Lucy Zhang
2020-09-10 13:31:40 -07:00
committed by GitHub
parent 1528c642d1
commit e3ec6bf9c5
20 changed files with 400 additions and 132 deletions

View File

@@ -41,6 +41,9 @@ export class OutputComponent extends CellView implements OnInit, AfterViewInit {
private _initialized: boolean = false;
private _activeCellId: string;
private _componentInstance: IMimeComponent;
private _batchId?: number;
private _id?: number;
private _queryRunnerUri?: string;
public errorText: string;
constructor(
@@ -102,6 +105,18 @@ export class OutputComponent extends CellView implements OnInit, AfterViewInit {
return this._componentInstance;
}
@Input() set batchId(value: number) {
this._batchId = value;
}
@Input() set id(value: number) {
this._id = value;
}
@Input() set queryRunnerUri(value: string) {
this._queryRunnerUri = value;
}
get trustedMode(): boolean {
return this._trusted;
}
@@ -174,6 +189,11 @@ export class OutputComponent extends CellView implements OnInit, AfterViewInit {
this._componentInstance.cellModel = this.cellModel;
this._componentInstance.cellOutput = this.cellOutput;
this._componentInstance.bundleOptions = options;
if (this._queryRunnerUri) {
this._componentInstance.batchId = this._batchId;
this._componentInstance.id = this._id;
this._componentInstance.queryRunnerUri = this._queryRunnerUri;
}
this._changeref.detectChanges();
let el = <HTMLElement>componentRef.location.nativeElement;

View File

@@ -6,7 +6,7 @@
-->
<div style="overflow: hidden; width: 100%; height: 100%; display: flex; flex-flow: column">
<div #outputarea link-handler [isTrusted]="isTrusted" [notebookUri]="notebookUri" class="notebook-output" style="flex: 0 0 auto;">
<output-component *ngFor="let output of cellModel.outputs" [cellOutput]="output" [trustedMode] = "cellModel.trustedMode" [cellModel]="cellModel" [activeCellId]="activeCellId">
<output-component *ngFor="let output of cellModel.outputs" [cellOutput]="output" [trustedMode] = "cellModel.trustedMode" [cellModel]="cellModel" [activeCellId]="activeCellId" [batchId]="output.batchId" [id]="output.id" [queryRunnerUri]="output.queryRunnerUri">
</output-component>
</div>
</div>
</div>

View File

@@ -38,6 +38,7 @@ export class OutputAreaComponent extends AngularDisposable implements OnInit {
this._register(this.cellModel.onOutputsChanged(e => {
if (!(this._changeRef['destroyed'])) {
this._changeRef.detectChanges();
this._changeRef.detach();
if (e && e.shouldScroll) {
this.setFocusAndScroll(this.outputArea.nativeElement);
}