mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-19 09:35:36 -05:00
Clean up dialog event hide reasons (#14566)
* Clean up dialog event hide reasons * Remove done
This commit is contained in:
@@ -44,7 +44,7 @@ export class CustomDialogService {
|
||||
}
|
||||
|
||||
public closeWizard(wizard: Wizard): void {
|
||||
this._wizardModals.get(wizard)?.cancel();
|
||||
this._wizardModals.get(wizard)?.close();
|
||||
}
|
||||
|
||||
public getWizardModal(wizard: Wizard): WizardModal | undefined {
|
||||
|
||||
@@ -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 { Dialog, DialogButton } from 'sql/workbench/services/dialog/common/dialogTypes';
|
||||
import { DialogPane } from 'sql/workbench/services/dialog/browser/dialogPane';
|
||||
|
||||
@@ -138,7 +138,7 @@ export class DialogModal extends Modal {
|
||||
if (await this._dialog.validateClose()) {
|
||||
this._onDone.fire();
|
||||
this.dispose();
|
||||
this.hide('close');
|
||||
this.hide('ok');
|
||||
}
|
||||
clearTimeout(buttonSpinnerHandler);
|
||||
this._doneButton.element.classList.remove('validating');
|
||||
@@ -146,10 +146,14 @@ export class DialogModal extends Modal {
|
||||
}
|
||||
}
|
||||
|
||||
public cancel(): void {
|
||||
public close(): void {
|
||||
this.cancel('close');
|
||||
}
|
||||
|
||||
public cancel(hideReason: HideReason = 'cancel'): void {
|
||||
this._onCancel.fire();
|
||||
this.dispose();
|
||||
this.hide('cancel');
|
||||
this.hide(hideReason);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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> {
|
||||
|
||||
Reference in New Issue
Block a user