Fix nullref exception showing query plan panel (#1516)

This commit is contained in:
Karl Burtram
2018-05-30 14:30:14 -07:00
committed by GitHub
parent 1a97e3de06
commit edc60e0ad1
3 changed files with 9 additions and 5 deletions

View File

@@ -22,7 +22,7 @@
</ng-template> </ng-template>
</tab> </tab>
<tab *ngIf="hasQueryPlan" [visibilityType]="'visibility'" class="fullsize" [title]="topOperationsTitle"> <tab *ngIf="hasQueryPlan" [visibilityType]="'visibility'" class="fullsize" [title]="topOperationsTitle" [identifier]="topOperationsTabIdentifier">
<ng-template> <ng-template>
<div id="topOperationsDiv" class="fullsize"> <div id="topOperationsDiv" class="fullsize">
<top-operations-component class="fullsize" style="display: block" [queryParameters]="queryParameters"></top-operations-component> <top-operations-component class="fullsize" style="display: block" [queryParameters]="queryParameters"></top-operations-component>

View File

@@ -51,6 +51,7 @@ export class QueryOutputComponent implements OnDestroy {
private readonly resultsTabIdentifier = 'results'; private readonly resultsTabIdentifier = 'results';
private readonly queryPlanTabIdentifier = 'queryPlan'; private readonly queryPlanTabIdentifier = 'queryPlan';
private readonly chartViewerTabIdentifier = 'chartViewer'; private readonly chartViewerTabIdentifier = 'chartViewer';
private readonly topOperationsTabIdentifier = 'topOperations';
// tslint:enable:no-unused-variable // tslint:enable:no-unused-variable
private hasQueryPlan = false; private hasQueryPlan = false;
@@ -77,9 +78,10 @@ export class QueryOutputComponent implements OnDestroy {
this._disposables.push(toDisposableSubscription(this.queryComponent.queryPlanAvailable.subscribe((xml) => { this._disposables.push(toDisposableSubscription(this.queryComponent.queryPlanAvailable.subscribe((xml) => {
this.hasQueryPlan = true; this.hasQueryPlan = true;
this._cd.detectChanges(); this._cd.detectChanges();
this._panel.selectTab(this.topOperationsTabIdentifier);
this.topOperationsComponent.planXml = xml;
this._panel.selectTab(this.queryPlanTabIdentifier); this._panel.selectTab(this.queryPlanTabIdentifier);
this.queryPlanComponent.planXml = xml; this.queryPlanComponent.planXml = xml;
this.topOperationsComponent.planXml = xml;
}))); })));
this._disposables.push(toDisposableSubscription(this.queryComponent.showChartRequested.subscribe((dataSet) => { this._disposables.push(toDisposableSubscription(this.queryComponent.showChartRequested.subscribe((dataSet) => {

View File

@@ -48,10 +48,12 @@ export class QueryPlanComponent implements OnDestroy, OnInit {
public set planXml(val: string) { public set planXml(val: string) {
this._planXml = val; this._planXml = val;
if (this._planXml) {
QP.showPlan(this._container.nativeElement, this._planXml, { QP.showPlan(this._container.nativeElement, this._planXml, {
jsTooltips: false jsTooltips: false
}); });
} }
}
private _updateTheme(theme: ITheme, collector: ICssStyleCollector) { private _updateTheme(theme: ITheme, collector: ICssStyleCollector) {
let backgroundColor = theme.getColor(colors.editorBackground); let backgroundColor = theme.getColor(colors.editorBackground);