Strict nulls check contrib/queryplan (#11917)

* remove angular query pla neditor and replace with non-angular version; strict null check contrib/queryPlan

* fix compile
This commit is contained in:
Anthony Dresser
2020-08-21 23:04:36 -07:00
committed by GitHub
parent 91065ebc38
commit 3e515f2f59
9 changed files with 101 additions and 268 deletions

View File

@@ -50,7 +50,7 @@ export class TopOperationsTab extends Disposable implements IPanelTab {
}
export class TopOperationsView extends Disposable implements IPanelView {
private _state: TopOperationsState;
private _state?: TopOperationsState;
private table: Table<any>;
private container = document.createElement('div');
private dataView = new TableDataView();
@@ -86,19 +86,19 @@ export class TopOperationsView extends Disposable implements IPanelView {
}
public showPlan(xml: string) {
this.state.xml = xml;
this.state!.xml = xml;
this.dataView.clear();
let parser = new PlanXmlParser(xml);
let operations = parser.topOperations;
let data = operations.map(i => {
return {
operation: i.title,
object: i.indexObject.title,
object: i.indexObject?.title,
estCost: i.estimatedOperatorCost,
estSubtreeCost: i.subtreeCost,
actualRows: i.runtimeInfo.actualRows,
actualRows: i.runtimeInfo?.actualRows,
estRows: i.estimateRows,
actualExecutions: i.runtimeInfo.actualExecutions,
actualExecutions: i.runtimeInfo?.actualExecutions,
estCPUCost: i.estimateCpu,
estIOCost: i.estimateIo,
parallel: i.parallel,
@@ -112,14 +112,14 @@ export class TopOperationsView extends Disposable implements IPanelView {
this.dataView.push(data);
}
public set state(val: TopOperationsState) {
public setState(val: TopOperationsState) {
this._state = val;
if (this.state.xml) {
this.showPlan(this.state.xml);
if (this._state.xml) {
this.showPlan(this._state.xml);
}
}
public get state(): TopOperationsState {
public get state(): TopOperationsState | undefined {
return this._state;
}
}