diff --git a/src/sql/parts/query/views/queryOutput.component.html b/src/sql/parts/query/views/queryOutput.component.html index 2c55992adf..46c0e855a7 100644 --- a/src/sql/parts/query/views/queryOutput.component.html +++ b/src/sql/parts/query/views/queryOutput.component.html @@ -22,7 +22,7 @@ - +
diff --git a/src/sql/parts/query/views/queryOutput.component.ts b/src/sql/parts/query/views/queryOutput.component.ts index b7d7c1d4bb..c436f97016 100644 --- a/src/sql/parts/query/views/queryOutput.component.ts +++ b/src/sql/parts/query/views/queryOutput.component.ts @@ -51,6 +51,7 @@ export class QueryOutputComponent implements OnDestroy { private readonly resultsTabIdentifier = 'results'; private readonly queryPlanTabIdentifier = 'queryPlan'; private readonly chartViewerTabIdentifier = 'chartViewer'; + private readonly topOperationsTabIdentifier = 'topOperations'; // tslint:enable:no-unused-variable private hasQueryPlan = false; @@ -77,9 +78,10 @@ export class QueryOutputComponent implements OnDestroy { this._disposables.push(toDisposableSubscription(this.queryComponent.queryPlanAvailable.subscribe((xml) => { this.hasQueryPlan = true; this._cd.detectChanges(); + this._panel.selectTab(this.topOperationsTabIdentifier); + this.topOperationsComponent.planXml = xml; this._panel.selectTab(this.queryPlanTabIdentifier); this.queryPlanComponent.planXml = xml; - this.topOperationsComponent.planXml = xml; }))); this._disposables.push(toDisposableSubscription(this.queryComponent.showChartRequested.subscribe((dataSet) => { diff --git a/src/sql/parts/queryPlan/queryPlan.component.ts b/src/sql/parts/queryPlan/queryPlan.component.ts index 346ee80188..fb6838c75b 100644 --- a/src/sql/parts/queryPlan/queryPlan.component.ts +++ b/src/sql/parts/queryPlan/queryPlan.component.ts @@ -48,9 +48,11 @@ export class QueryPlanComponent implements OnDestroy, OnInit { public set planXml(val: string) { this._planXml = val; - QP.showPlan(this._container.nativeElement, this._planXml, { - jsTooltips: false - }); + if (this._planXml) { + QP.showPlan(this._container.nativeElement, this._planXml, { + jsTooltips: false + }); + } } private _updateTheme(theme: ITheme, collector: ICssStyleCollector) {