Clean up dialog event hide reasons (#14566)

* Clean up dialog event hide reasons

* Remove done
This commit is contained in:
Charles Gagnon
2021-03-05 08:54:35 -08:00
committed by GitHub
parent 21019f7452
commit d2faf9075d
21 changed files with 67 additions and 58 deletions

View File

@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import 'vs/css!./media/dialogModal';
import { Modal, IModalOptions } from 'sql/workbench/browser/modal/modal';
import { Modal, IModalOptions, HideReason } from 'sql/workbench/browser/modal/modal';
import { Wizard, DialogButton, WizardPage } from 'sql/workbench/services/dialog/common/dialogTypes';
import { DialogPane } from 'sql/workbench/services/dialog/browser/dialogPane';
import { bootstrapAngular } from 'sql/workbench/services/bootstrap/browser/bootstrapService';
@@ -274,15 +274,18 @@ export class WizardModal extends Modal {
}
this._onDone.fire();
this.dispose();
this.hide('done');
this.hide('ok');
}
}
public cancel(): void {
public close(): void {
this.cancel('close');
}
public cancel(hideReason: HideReason = 'cancel'): void {
const currentPage = this._wizard.pages[this._wizard.currentPage];
this._onCancel.fire();
this.dispose();
this.hide('cancel', currentPage.pageName ?? this._wizard.currentPage.toString());
this.hide(hideReason, currentPage.pageName ?? this._wizard.currentPage.toString());
}
private async validateNavigation(newPage: number): Promise<boolean> {