Redoing Execution Plan Comparison Editor (#19375)

* Adding code for execution plan comparison editor

* Handling floating promises and fixing a loc string

* Fixing some polygon stuff

* Fixing azdatagraph null check bug

* Adding progress notification for similar areas

* Removing some floating promises

* Fixing button enabled state
This commit is contained in:
Aasim Khan
2022-05-23 14:33:18 -07:00
committed by GitHub
parent 000923207e
commit 8bb6b5fc1a
34 changed files with 1601 additions and 101 deletions

View File

@@ -27,13 +27,15 @@ export class ExecutionPlanViewHeader {
public constructor(
private _parentContainer: HTMLElement,
headerData: PlanHeaderData,
headerData: PlanHeaderData | undefined,
@IInstantiationService public readonly _instantiationService: IInstantiationService) {
this._graphIndex = headerData.planIndex;
this._relativeCost = headerData.relativeCost;
this._query = headerData.query;
this._recommendations = headerData.recommendations ?? [];
if (headerData) {
this._graphIndex = headerData.planIndex;
this._relativeCost = headerData.relativeCost;
this._query = headerData.query;
this._recommendations = headerData.recommendations ?? [];
}
this._graphIndexAndCostContainer = DOM.$('.index-row');
this._queryContainer = DOM.$('.query-row');
@@ -84,28 +86,31 @@ export class ExecutionPlanViewHeader {
}
private renderQueryText(): void {
this._queryContainer.innerText = this._query;
if (this._query) {
this._queryContainer.innerText = this._query;
}
}
private renderRecommendations(): void {
while (this._recommendationsContainer.firstChild) {
this._recommendationsContainer.removeChild(this._recommendationsContainer.firstChild);
if (this._recommendations) {
while (this._recommendationsContainer.firstChild) {
this._recommendationsContainer.removeChild(this._recommendationsContainer.firstChild);
}
this._recommendations.forEach(r => {
const link = new Button(this._recommendationsContainer, {
title: r.displayString,
secondary: true,
});
link.label = r.displayString;
//Enabling on click action for recommendations. It will open the recommendation File
link.onDidClick(e => {
this._instantiationService.invokeFunction(openNewQuery, undefined, r.queryWithDescription, RunQueryOnConnectionMode.none);
});
});
}
this._recommendations.forEach(r => {
const link = new Button(this._recommendationsContainer, {
title: r.displayString,
secondary: true,
});
link.label = r.displayString;
//Enabling on click action for recommendations. It will open the recommendation File
link.onDidClick(e => {
this._instantiationService.invokeFunction(openNewQuery, undefined, r.queryWithDescription, RunQueryOnConnectionMode.none);
});
});
}
}