mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Fix disappearing notebook table (#4466)
This commit is contained in:
@@ -7,6 +7,7 @@ import 'vs/css!./code';
|
|||||||
import { OnInit, Component, Input, Inject, ElementRef, ViewChild } from '@angular/core';
|
import { OnInit, Component, Input, Inject, ElementRef, ViewChild } from '@angular/core';
|
||||||
import { AngularDisposable } from 'sql/base/node/lifecycle';
|
import { AngularDisposable } from 'sql/base/node/lifecycle';
|
||||||
import { nb } from 'azdata';
|
import { nb } from 'azdata';
|
||||||
|
import { ICellModel } from 'sql/parts/notebook/models/modelInterfaces';
|
||||||
import { INotebookService } from 'sql/workbench/services/notebook/common/notebookService';
|
import { INotebookService } from 'sql/workbench/services/notebook/common/notebookService';
|
||||||
import { MimeModel } from 'sql/parts/notebook/outputs/common/mimemodel';
|
import { MimeModel } from 'sql/parts/notebook/outputs/common/mimemodel';
|
||||||
import * as outputProcessor from 'sql/parts/notebook/outputs/common/outputProcessor';
|
import * as outputProcessor from 'sql/parts/notebook/outputs/common/outputProcessor';
|
||||||
@@ -22,6 +23,7 @@ export const OUTPUT_SELECTOR: string = 'output-component';
|
|||||||
export class OutputComponent extends AngularDisposable implements OnInit {
|
export class OutputComponent extends AngularDisposable implements OnInit {
|
||||||
@ViewChild('output', { read: ElementRef }) private outputElement: ElementRef;
|
@ViewChild('output', { read: ElementRef }) private outputElement: ElementRef;
|
||||||
@Input() cellOutput: nb.ICellOutput;
|
@Input() cellOutput: nb.ICellOutput;
|
||||||
|
@Input() cellModel: ICellModel;
|
||||||
private _trusted: boolean;
|
private _trusted: boolean;
|
||||||
private _initialized: boolean = false;
|
private _initialized: boolean = false;
|
||||||
private readonly _minimumHeight = 30;
|
private readonly _minimumHeight = 30;
|
||||||
@@ -38,6 +40,9 @@ export class OutputComponent extends AngularDisposable implements OnInit {
|
|||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.renderOutput();
|
this.renderOutput();
|
||||||
this._initialized = true;
|
this._initialized = true;
|
||||||
|
this.cellModel.notebookModel.layoutChanged(() => {
|
||||||
|
this.renderOutput();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private renderOutput() {
|
private renderOutput() {
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
-->
|
-->
|
||||||
<div style="overflow: hidden; width: 100%; height: 100%; display: flex; flex-flow: column">
|
<div style="overflow: hidden; width: 100%; height: 100%; display: flex; flex-flow: column">
|
||||||
<div #outputarea class="notebook-output" style="flex: 0 0 auto;">
|
<div #outputarea class="notebook-output" style="flex: 0 0 auto;">
|
||||||
<output-component *ngFor="let output of cellModel.outputs" [cellOutput]="output" [trustedMode] = "cellModel.trustedMode" >
|
<output-component *ngFor="let output of cellModel.outputs" [cellOutput]="output" [trustedMode] = "cellModel.trustedMode" [cellModel]="cellModel">
|
||||||
</output-component>
|
</output-component>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -129,6 +129,10 @@ export class CellModel implements ICellModel {
|
|||||||
return this._cellUri;
|
return this._cellUri;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public get notebookModel(): NotebookModel {
|
||||||
|
return <NotebookModel>this.options.notebook;
|
||||||
|
}
|
||||||
|
|
||||||
public set cellUri(value: URI) {
|
public set cellUri(value: URI) {
|
||||||
this._cellUri = value;
|
this._cellUri = value;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ import { IStandardKernelWithProvider } from 'sql/parts/notebook/notebookUtils';
|
|||||||
import { ConnectionProfile } from 'sql/platform/connection/common/connectionProfile';
|
import { ConnectionProfile } from 'sql/platform/connection/common/connectionProfile';
|
||||||
import { ICapabilitiesService } from 'sql/platform/capabilities/common/capabilitiesService';
|
import { ICapabilitiesService } from 'sql/platform/capabilities/common/capabilitiesService';
|
||||||
import { localize } from 'vs/nls';
|
import { localize } from 'vs/nls';
|
||||||
|
import { NotebookModel } from 'sql/parts/notebook/models/notebookModel';
|
||||||
|
|
||||||
export interface IClientSessionOptions {
|
export interface IClientSessionOptions {
|
||||||
notebookUri: URI;
|
notebookUri: URI;
|
||||||
@@ -449,8 +450,9 @@ export interface ICellModel {
|
|||||||
readonly outputs: ReadonlyArray<nb.ICellOutput>;
|
readonly outputs: ReadonlyArray<nb.ICellOutput>;
|
||||||
readonly onOutputsChanged: Event<ReadonlyArray<nb.ICellOutput>>;
|
readonly onOutputsChanged: Event<ReadonlyArray<nb.ICellOutput>>;
|
||||||
readonly onExecutionStateChange: Event<CellExecutionState>;
|
readonly onExecutionStateChange: Event<CellExecutionState>;
|
||||||
setFuture(future: FutureInternal): void;
|
|
||||||
readonly executionState: CellExecutionState;
|
readonly executionState: CellExecutionState;
|
||||||
|
readonly notebookModel: NotebookModel;
|
||||||
|
setFuture(future: FutureInternal): void;
|
||||||
runCell(notificationService?: INotificationService, connectionManagementService?: IConnectionManagementService): Promise<boolean>;
|
runCell(notificationService?: INotificationService, connectionManagementService?: IConnectionManagementService): Promise<boolean>;
|
||||||
setOverrideLanguage(language: string);
|
setOverrideLanguage(language: string);
|
||||||
equals(cellModel: ICellModel): boolean;
|
equals(cellModel: ICellModel): boolean;
|
||||||
|
|||||||
Reference in New Issue
Block a user