More promise cleanup (#8100)

* Some promise cleanup

* Handle more promise issues

* Remove changes that aren't needed anymore

* Use log service

* another one

* Be more explicit

* Some more promises cleaned up

* Handle promises here too

* Strings for errors

* Some more cleanup

* Remove unused imports
This commit is contained in:
Amir Omidi
2019-10-31 14:30:08 -07:00
committed by GitHub
parent 572a83dac7
commit b62c0cf2ab
11 changed files with 165 additions and 189 deletions

View File

@@ -77,7 +77,7 @@ export class DashboardEditor extends BaseEditor {
this._dashboardService.layout(dimension);
}
public setInput(input: DashboardInput, options: EditorOptions): Promise<void> {
public async setInput(input: DashboardInput, options: EditorOptions): Promise<void> {
if (this.input && this.input.matches(input)) {
return Promise.resolve(undefined);
}
@@ -93,10 +93,10 @@ export class DashboardEditor extends BaseEditor {
container.style.height = '100%';
this._dashboardContainer = DOM.append(parentElement, container);
this.input.container = this._dashboardContainer;
return Promise.resolve(input.initializedPromise.then(() => this.bootstrapAngular(input)));
await input.initializedPromise;
this.bootstrapAngular(input);
} else {
this._dashboardContainer = DOM.append(parentElement, this.input.container);
return Promise.resolve(null);
}
}

View File

@@ -578,29 +578,29 @@ export class QueryEditor extends BaseEditor {
/**
* Calls the runCurrent method of this editor's RunQueryAction
*/
public runCurrentQuery(): void {
this._runQueryAction.runCurrent();
public async runCurrentQuery(): Promise<void> {
return this._runQueryAction.runCurrent();
}
/**
* Calls the runCurrentQueryWithActualPlan method of this editor's ActualQueryPlanAction
*/
public runCurrentQueryWithActualPlan(): void {
this._actualQueryPlanAction.run();
public async runCurrentQueryWithActualPlan(): Promise<void> {
return this._actualQueryPlanAction.run();
}
/**
* Calls the run method of this editor's RunQueryAction
*/
public runQuery(): void {
this._runQueryAction.run();
public async runQuery(): Promise<void> {
return this._runQueryAction.run();
}
/**
* Calls the run method of this editor's CancelQueryAction
*/
public cancelQuery(): void {
this._cancelQueryAction.run();
public async cancelQuery(): Promise<void> {
return this._cancelQueryAction.run();
}
public registerQueryModelViewTab(title: string, componentId: string): void {