mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Clean up dialog event hide reasons (#14566)
* Clean up dialog event hide reasons * Remove done
This commit is contained in:
@@ -51,7 +51,7 @@ export abstract class CalloutDialog<T> extends Modal {
|
|||||||
public abstract open(): Promise<T>;
|
public abstract open(): Promise<T>;
|
||||||
|
|
||||||
public cancel(): void {
|
public cancel(): void {
|
||||||
this.hide();
|
this.hide('cancel');
|
||||||
this.dispose();
|
this.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -104,6 +104,8 @@ const defaultOptions: IModalOptions = {
|
|||||||
|
|
||||||
const tabbableElementsQuerySelector = 'a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), [tabindex="0"]';
|
const tabbableElementsQuerySelector = 'a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), [tabindex="0"]';
|
||||||
|
|
||||||
|
export type HideReason = 'close' | 'cancel' | 'ok';
|
||||||
|
|
||||||
export abstract class Modal extends Disposable implements IThemable {
|
export abstract class Modal extends Disposable implements IThemable {
|
||||||
protected _useDefaultMessageBoxLocation: boolean = true;
|
protected _useDefaultMessageBoxLocation: boolean = true;
|
||||||
protected _messageElement?: HTMLElement;
|
protected _messageElement?: HTMLElement;
|
||||||
@@ -317,7 +319,7 @@ export abstract class Modal extends Disposable implements IThemable {
|
|||||||
* Overridable to change behavior of escape key
|
* Overridable to change behavior of escape key
|
||||||
*/
|
*/
|
||||||
protected onClose(e?: StandardKeyboardEvent) {
|
protected onClose(e?: StandardKeyboardEvent) {
|
||||||
this.hide();
|
this.hide('close');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -330,7 +332,7 @@ export abstract class Modal extends Disposable implements IThemable {
|
|||||||
if (target.closest('.modal-content')) {
|
if (target.closest('.modal-content')) {
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
this.hide();
|
this.hide('close');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -338,7 +340,7 @@ export abstract class Modal extends Disposable implements IThemable {
|
|||||||
* Overridable to change behavior of enter key
|
* Overridable to change behavior of enter key
|
||||||
*/
|
*/
|
||||||
protected onAccept(e?: StandardKeyboardEvent) {
|
protected onAccept(e?: StandardKeyboardEvent) {
|
||||||
this.hide();
|
this.hide('ok');
|
||||||
}
|
}
|
||||||
|
|
||||||
private handleBackwardTab(e: KeyboardEvent) {
|
private handleBackwardTab(e: KeyboardEvent) {
|
||||||
@@ -499,7 +501,7 @@ export abstract class Modal extends Disposable implements IThemable {
|
|||||||
/**
|
/**
|
||||||
* Hides the modal and removes key listeners
|
* Hides the modal and removes key listeners
|
||||||
*/
|
*/
|
||||||
protected hide(reason?: string, currentPageName?: string): void {
|
protected hide(reason?: HideReason, currentPageName?: string): void {
|
||||||
this._modalShowingContext.get()!.pop();
|
this._modalShowingContext.get()!.pop();
|
||||||
this._bodyContainer!.remove();
|
this._bodyContainer!.remove();
|
||||||
this.disposableStore.clear();
|
this.disposableStore.clear();
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
import 'vs/css!./media/optionsDialog';
|
import 'vs/css!./media/optionsDialog';
|
||||||
import * as DialogHelper from './dialogHelper';
|
import * as DialogHelper from './dialogHelper';
|
||||||
import { SelectBox } from 'sql/base/browser/ui/selectBox/selectBox';
|
import { SelectBox } from 'sql/base/browser/ui/selectBox/selectBox';
|
||||||
import { IModalOptions, Modal } from './modal';
|
import { HideReason, IModalOptions, Modal } from './modal';
|
||||||
import * as OptionsDialogHelper from './optionsDialogHelper';
|
import * as OptionsDialogHelper from './optionsDialogHelper';
|
||||||
|
|
||||||
import * as azdata from 'azdata';
|
import * as azdata from 'azdata';
|
||||||
@@ -176,16 +176,16 @@ export class OptionsDialog extends Modal {
|
|||||||
if (OptionsDialogHelper.validateInputs(this._optionElements)) {
|
if (OptionsDialogHelper.validateInputs(this._optionElements)) {
|
||||||
OptionsDialogHelper.updateOptions(this._optionValues, this._optionElements);
|
OptionsDialogHelper.updateOptions(this._optionValues, this._optionElements);
|
||||||
this._onOk.fire();
|
this._onOk.fire();
|
||||||
this.close();
|
this.close('ok');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public cancel() {
|
public cancel() {
|
||||||
this.close();
|
this.close('cancel');
|
||||||
}
|
}
|
||||||
|
|
||||||
public close() {
|
public close(hideReason: HideReason = 'close') {
|
||||||
this.hide();
|
this.hide(hideReason);
|
||||||
this._optionElements = {};
|
this._optionElements = {};
|
||||||
this._onCloseEvent.fire();
|
this._onCloseEvent.fire();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ export class BackupDialog extends Modal {
|
|||||||
* Clean up the module and DOM element and close the dialog
|
* Clean up the module and DOM element and close the dialog
|
||||||
*/
|
*/
|
||||||
public close() {
|
public close() {
|
||||||
this.hide();
|
this.hide('close');
|
||||||
}
|
}
|
||||||
|
|
||||||
public dispose(): void {
|
public dispose(): void {
|
||||||
|
|||||||
@@ -52,6 +52,6 @@ export class ConfigureChartDialog extends Modal {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public close() {
|
public close() {
|
||||||
this.hide();
|
this.hide('close');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -184,7 +184,7 @@ export class ImageCalloutDialog extends CalloutDialog<IImageCalloutDialogOptions
|
|||||||
}
|
}
|
||||||
|
|
||||||
public insert(): void {
|
public insert(): void {
|
||||||
this.hide();
|
this.hide('ok');
|
||||||
this._selectionComplete.resolve({
|
this._selectionComplete.resolve({
|
||||||
insertEscapedMarkdown: `})`,
|
insertEscapedMarkdown: `})`,
|
||||||
imagePath: this._imageUrlInputBox.value,
|
imagePath: this._imageUrlInputBox.value,
|
||||||
|
|||||||
@@ -144,7 +144,7 @@ export class LinkCalloutDialog extends CalloutDialog<ILinkCalloutDialogOptions>
|
|||||||
}
|
}
|
||||||
|
|
||||||
public insert(): void {
|
public insert(): void {
|
||||||
this.hide();
|
this.hide('ok');
|
||||||
let escapedLabel = escapeLabel(this._linkTextInputBox.value);
|
let escapedLabel = escapeLabel(this._linkTextInputBox.value);
|
||||||
let escapedUrl = escapeUrl(this._linkUrlInputBox.value);
|
let escapedUrl = escapeUrl(this._linkUrlInputBox.value);
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
*--------------------------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
import { Button } from 'sql/base/browser/ui/button/button';
|
import { Button } from 'sql/base/browser/ui/button/button';
|
||||||
import { Modal } from 'sql/workbench/browser/modal/modal';
|
import { HideReason, Modal } from 'sql/workbench/browser/modal/modal';
|
||||||
import * as TelemetryKeys from 'sql/platform/telemetry/common/telemetryKeys';
|
import * as TelemetryKeys from 'sql/platform/telemetry/common/telemetryKeys';
|
||||||
import { IThemeService } from 'vs/platform/theme/common/themeService';
|
import { IThemeService } from 'vs/platform/theme/common/themeService';
|
||||||
import { Event, Emitter } from 'vs/base/common/event';
|
import { Event, Emitter } from 'vs/base/common/event';
|
||||||
@@ -136,11 +136,11 @@ export class WebViewDialog extends Modal {
|
|||||||
|
|
||||||
public ok(): void {
|
public ok(): void {
|
||||||
this._onOk.fire();
|
this._onOk.fire();
|
||||||
this.close();
|
this.close('ok');
|
||||||
}
|
}
|
||||||
|
|
||||||
public close() {
|
public close(hideReason: HideReason = 'close') {
|
||||||
this.hide();
|
this.hide(hideReason);
|
||||||
this._onClosed.fire();
|
this._onClosed.fire();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ import { IConfigurationService } from 'vs/platform/configuration/common/configur
|
|||||||
import * as azdata from 'azdata';
|
import * as azdata from 'azdata';
|
||||||
|
|
||||||
import { Button } from 'sql/base/browser/ui/button/button';
|
import { Button } from 'sql/base/browser/ui/button/button';
|
||||||
import { Modal } from 'sql/workbench/browser/modal/modal';
|
import { HideReason, Modal } from 'sql/workbench/browser/modal/modal';
|
||||||
import { AccountViewModel } from 'sql/platform/accounts/common/accountViewModel';
|
import { AccountViewModel } from 'sql/platform/accounts/common/accountViewModel';
|
||||||
import { AddAccountAction } from 'sql/platform/accounts/common/accountActions';
|
import { AddAccountAction } from 'sql/platform/accounts/common/accountActions';
|
||||||
import { AccountListRenderer, AccountListDelegate } from 'sql/workbench/services/accountManagement/browser/accountListRenderer';
|
import { AccountListRenderer, AccountListDelegate } from 'sql/workbench/services/accountManagement/browser/accountListRenderer';
|
||||||
@@ -272,12 +272,12 @@ export class AccountDialog extends Modal {
|
|||||||
|
|
||||||
/* Overwrite enter key behavior */
|
/* Overwrite enter key behavior */
|
||||||
protected onAccept() {
|
protected onAccept() {
|
||||||
this.close();
|
this.close('ok');
|
||||||
}
|
}
|
||||||
|
|
||||||
public close() {
|
public close(hideReason: HideReason = 'close') {
|
||||||
this._onCloseEmitter.fire();
|
this._onCloseEmitter.fire();
|
||||||
this.hide();
|
this.hide(hideReason);
|
||||||
}
|
}
|
||||||
|
|
||||||
public open() {
|
public open() {
|
||||||
|
|||||||
@@ -142,7 +142,7 @@ export class AutoOAuthDialog extends Modal {
|
|||||||
this._copyAndOpenButton!.enabled = true;
|
this._copyAndOpenButton!.enabled = true;
|
||||||
this._onCloseEvent.fire();
|
this._onCloseEvent.fire();
|
||||||
this.spinner = false;
|
this.spinner = false;
|
||||||
this.hide();
|
this.hide('close');
|
||||||
}
|
}
|
||||||
|
|
||||||
public open(title: string, message: string, userCode: string, uri: string) {
|
public open(title: string, message: string, userCode: string, uri: string) {
|
||||||
|
|||||||
@@ -201,7 +201,7 @@ export class ConnectionDialogService implements IConnectionDialogService {
|
|||||||
private handleOnCancel(params: INewConnectionParams): void {
|
private handleOnCancel(params: INewConnectionParams): void {
|
||||||
if (this.ignoreNextConnect) {
|
if (this.ignoreNextConnect) {
|
||||||
this._connectionDialog.resetConnection();
|
this._connectionDialog.resetConnection();
|
||||||
this._connectionDialog.close();
|
this._connectionDialog.close('cancel');
|
||||||
this.ignoreNextConnect = false;
|
this.ignoreNextConnect = false;
|
||||||
this._dialogDeferredPromise.resolve(undefined);
|
this._dialogDeferredPromise.resolve(undefined);
|
||||||
return;
|
return;
|
||||||
@@ -229,7 +229,7 @@ export class ConnectionDialogService implements IConnectionDialogService {
|
|||||||
private async handleDefaultOnConnect(params: INewConnectionParams, connection: IConnectionProfile): Promise<void> {
|
private async handleDefaultOnConnect(params: INewConnectionParams, connection: IConnectionProfile): Promise<void> {
|
||||||
if (this.ignoreNextConnect) {
|
if (this.ignoreNextConnect) {
|
||||||
this._connectionDialog.resetConnection();
|
this._connectionDialog.resetConnection();
|
||||||
this._connectionDialog.close();
|
this._connectionDialog.close('ok');
|
||||||
this.ignoreNextConnect = false;
|
this.ignoreNextConnect = false;
|
||||||
this._connecting = false;
|
this._connecting = false;
|
||||||
this._dialogDeferredPromise.resolve(connection);
|
this._dialogDeferredPromise.resolve(connection);
|
||||||
@@ -253,7 +253,7 @@ export class ConnectionDialogService implements IConnectionDialogService {
|
|||||||
const connectionResult = await this._connectionManagementService.connectAndSaveProfile(connection, uri, options, params && params.input);
|
const connectionResult = await this._connectionManagementService.connectAndSaveProfile(connection, uri, options, params && params.input);
|
||||||
this._connecting = false;
|
this._connecting = false;
|
||||||
if (connectionResult && connectionResult.connected) {
|
if (connectionResult && connectionResult.connected) {
|
||||||
this._connectionDialog.close();
|
this._connectionDialog.close('ok');
|
||||||
if (this._dialogDeferredPromise) {
|
if (this._dialogDeferredPromise) {
|
||||||
this._dialogDeferredPromise.resolve(connectionResult.connectionProfile);
|
this._dialogDeferredPromise.resolve(connectionResult.connectionProfile);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
import 'vs/css!./media/connectionDialog';
|
import 'vs/css!./media/connectionDialog';
|
||||||
import { Button } from 'sql/base/browser/ui/button/button';
|
import { Button } from 'sql/base/browser/ui/button/button';
|
||||||
import { SelectBox } from 'sql/base/browser/ui/selectBox/selectBox';
|
import { SelectBox } from 'sql/base/browser/ui/selectBox/selectBox';
|
||||||
import { Modal } from 'sql/workbench/browser/modal/modal';
|
import { HideReason, Modal } from 'sql/workbench/browser/modal/modal';
|
||||||
import { IConnectionManagementService, INewConnectionParams } from 'sql/platform/connection/common/connectionManagement';
|
import { IConnectionManagementService, INewConnectionParams } from 'sql/platform/connection/common/connectionManagement';
|
||||||
import * as DialogHelper from 'sql/workbench/browser/modal/dialogHelper';
|
import * as DialogHelper from 'sql/workbench/browser/modal/dialogHelper';
|
||||||
import { TreeCreationUtils } from 'sql/workbench/services/objectExplorer/browser/treeCreationUtils';
|
import { TreeCreationUtils } from 'sql/workbench/services/objectExplorer/browser/treeCreationUtils';
|
||||||
@@ -360,13 +360,13 @@ export class ConnectionDialogWidget extends Modal {
|
|||||||
const wasConnecting = this._connecting;
|
const wasConnecting = this._connecting;
|
||||||
this._onCancel.fire();
|
this._onCancel.fire();
|
||||||
if (!this._databaseDropdownExpanded && !wasConnecting) {
|
if (!this._databaseDropdownExpanded && !wasConnecting) {
|
||||||
this.close();
|
this.close('cancel');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public close() {
|
public close(hideReason: HideReason = 'close') {
|
||||||
this.resetConnection();
|
this.resetConnection();
|
||||||
this.hide();
|
this.hide(hideReason);
|
||||||
}
|
}
|
||||||
|
|
||||||
private createRecentConnectionList(): void {
|
private createRecentConnectionList(): void {
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ export class CustomDialogService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public closeWizard(wizard: Wizard): void {
|
public closeWizard(wizard: Wizard): void {
|
||||||
this._wizardModals.get(wizard)?.cancel();
|
this._wizardModals.get(wizard)?.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
public getWizardModal(wizard: Wizard): WizardModal | undefined {
|
public getWizardModal(wizard: Wizard): WizardModal | undefined {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
*--------------------------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
import 'vs/css!./media/dialogModal';
|
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 { Dialog, DialogButton } from 'sql/workbench/services/dialog/common/dialogTypes';
|
||||||
import { DialogPane } from 'sql/workbench/services/dialog/browser/dialogPane';
|
import { DialogPane } from 'sql/workbench/services/dialog/browser/dialogPane';
|
||||||
|
|
||||||
@@ -138,7 +138,7 @@ export class DialogModal extends Modal {
|
|||||||
if (await this._dialog.validateClose()) {
|
if (await this._dialog.validateClose()) {
|
||||||
this._onDone.fire();
|
this._onDone.fire();
|
||||||
this.dispose();
|
this.dispose();
|
||||||
this.hide('close');
|
this.hide('ok');
|
||||||
}
|
}
|
||||||
clearTimeout(buttonSpinnerHandler);
|
clearTimeout(buttonSpinnerHandler);
|
||||||
this._doneButton.element.classList.remove('validating');
|
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._onCancel.fire();
|
||||||
this.dispose();
|
this.dispose();
|
||||||
this.hide('cancel');
|
this.hide(hideReason);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
*--------------------------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
import 'vs/css!./media/dialogModal';
|
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 { Wizard, DialogButton, WizardPage } from 'sql/workbench/services/dialog/common/dialogTypes';
|
||||||
import { DialogPane } from 'sql/workbench/services/dialog/browser/dialogPane';
|
import { DialogPane } from 'sql/workbench/services/dialog/browser/dialogPane';
|
||||||
import { bootstrapAngular } from 'sql/workbench/services/bootstrap/browser/bootstrapService';
|
import { bootstrapAngular } from 'sql/workbench/services/bootstrap/browser/bootstrapService';
|
||||||
@@ -274,15 +274,18 @@ export class WizardModal extends Modal {
|
|||||||
}
|
}
|
||||||
this._onDone.fire();
|
this._onDone.fire();
|
||||||
this.dispose();
|
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];
|
const currentPage = this._wizard.pages[this._wizard.currentPage];
|
||||||
this._onCancel.fire();
|
this._onCancel.fire();
|
||||||
this.dispose();
|
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> {
|
private async validateNavigation(newPage: number): Promise<boolean> {
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
import 'vs/css!./media/errorMessageDialog';
|
import 'vs/css!./media/errorMessageDialog';
|
||||||
import { Button } from 'sql/base/browser/ui/button/button';
|
import { Button } from 'sql/base/browser/ui/button/button';
|
||||||
import { Modal } from 'sql/workbench/browser/modal/modal';
|
import { HideReason, Modal } from 'sql/workbench/browser/modal/modal';
|
||||||
import * as TelemetryKeys from 'sql/platform/telemetry/common/telemetryKeys';
|
import * as TelemetryKeys from 'sql/platform/telemetry/common/telemetryKeys';
|
||||||
|
|
||||||
import Severity from 'vs/base/common/severity';
|
import Severity from 'vs/base/common/severity';
|
||||||
@@ -137,11 +137,11 @@ export class ErrorMessageDialog extends Modal {
|
|||||||
|
|
||||||
public ok(): void {
|
public ok(): void {
|
||||||
this._onOk.fire();
|
this._onOk.fire();
|
||||||
this.close();
|
this.close('ok');
|
||||||
}
|
}
|
||||||
|
|
||||||
public close() {
|
public close(hideReason: HideReason = 'close') {
|
||||||
this.hide();
|
this.hide(hideReason);
|
||||||
}
|
}
|
||||||
|
|
||||||
public open(severity: Severity, headerTitle: string, message: string, messageDetails?: string, actions?: IAction[]) {
|
public open(severity: Severity, headerTitle: string, message: string, messageDetails?: string, actions?: IAction[]) {
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import { Button } from 'sql/base/browser/ui/button/button';
|
|||||||
import { InputBox, OnLoseFocusParams } from 'sql/base/browser/ui/inputBox/inputBox';
|
import { InputBox, OnLoseFocusParams } from 'sql/base/browser/ui/inputBox/inputBox';
|
||||||
import { SelectBox } from 'sql/base/browser/ui/selectBox/selectBox';
|
import { SelectBox } from 'sql/base/browser/ui/selectBox/selectBox';
|
||||||
import * as DialogHelper from 'sql/workbench/browser/modal/dialogHelper';
|
import * as DialogHelper from 'sql/workbench/browser/modal/dialogHelper';
|
||||||
import { Modal } from 'sql/workbench/browser/modal/modal';
|
import { HideReason, Modal } from 'sql/workbench/browser/modal/modal';
|
||||||
import * as TelemetryKeys from 'sql/platform/telemetry/common/telemetryKeys';
|
import * as TelemetryKeys from 'sql/platform/telemetry/common/telemetryKeys';
|
||||||
import { FileNode } from 'sql/workbench/services/fileBrowser/common/fileNode';
|
import { FileNode } from 'sql/workbench/services/fileBrowser/common/fileNode';
|
||||||
import { FileBrowserTreeView } from 'sql/workbench/services/fileBrowser/browser/fileBrowserTreeView';
|
import { FileBrowserTreeView } from 'sql/workbench/services/fileBrowser/browser/fileBrowserTreeView';
|
||||||
@@ -185,7 +185,7 @@ export class FileBrowserDialog extends Modal {
|
|||||||
|
|
||||||
private ok() {
|
private ok() {
|
||||||
this._onOk.fire(this._selectedFilePath);
|
this._onOk.fire(this._selectedFilePath);
|
||||||
this.close();
|
this.close('ok');
|
||||||
}
|
}
|
||||||
|
|
||||||
private handleOnValidate(succeeded: boolean, errorMessage: string) {
|
private handleOnValidate(succeeded: boolean, errorMessage: string) {
|
||||||
@@ -197,12 +197,12 @@ export class FileBrowserDialog extends Modal {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private close(): void {
|
private close(hideReason: HideReason = 'close'): void {
|
||||||
if (this._fileBrowserTreeView) {
|
if (this._fileBrowserTreeView) {
|
||||||
this._fileBrowserTreeView.dispose();
|
this._fileBrowserTreeView.dispose();
|
||||||
}
|
}
|
||||||
this._onOk.dispose();
|
this._onOk.dispose();
|
||||||
this.hide();
|
this.hide(hideReason);
|
||||||
this._viewModel.closeFileBrowser().catch(err => onUnexpectedError(err));
|
this._viewModel.closeFileBrowser().catch(err => onUnexpectedError(err));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -414,7 +414,7 @@ export class InsightsDialogView extends Modal {
|
|||||||
|
|
||||||
|
|
||||||
public close() {
|
public close() {
|
||||||
this.hide();
|
this.hide('close');
|
||||||
dispose(this._taskButtonDisposables);
|
dispose(this._taskButtonDisposables);
|
||||||
this._taskButtonDisposables = [];
|
this._taskButtonDisposables = [];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -265,11 +265,11 @@ export class FirewallRuleDialog extends Modal {
|
|||||||
|
|
||||||
public cancel() {
|
public cancel() {
|
||||||
this._onCancel.fire();
|
this._onCancel.fire();
|
||||||
this.close();
|
this.hide('cancel');
|
||||||
}
|
}
|
||||||
|
|
||||||
public close() {
|
public close() {
|
||||||
this.hide();
|
this.hide('close');
|
||||||
}
|
}
|
||||||
|
|
||||||
public createFirewallRule() {
|
public createFirewallRule() {
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ import { CheckboxSelectColumn } from 'sql/base/browser/ui/table/plugins/checkbox
|
|||||||
import { Table } from 'sql/base/browser/ui/table/table';
|
import { Table } from 'sql/base/browser/ui/table/table';
|
||||||
import { TableDataView } from 'sql/base/browser/ui/table/tableDataView';
|
import { TableDataView } from 'sql/base/browser/ui/table/tableDataView';
|
||||||
import * as DialogHelper from 'sql/workbench/browser/modal/dialogHelper';
|
import * as DialogHelper from 'sql/workbench/browser/modal/dialogHelper';
|
||||||
import { Modal } from 'sql/workbench/browser/modal/modal';
|
import { HideReason, Modal } from 'sql/workbench/browser/modal/modal';
|
||||||
import { attachTableStyler, attachInputBoxStyler, attachSelectBoxStyler, attachEditableDropdownStyler, attachCheckboxStyler } from 'sql/platform/theme/common/styler';
|
import { attachTableStyler, attachInputBoxStyler, attachSelectBoxStyler, attachEditableDropdownStyler, attachCheckboxStyler } from 'sql/platform/theme/common/styler';
|
||||||
import * as TelemetryKeys from 'sql/platform/telemetry/common/telemetryKeys';
|
import * as TelemetryKeys from 'sql/platform/telemetry/common/telemetryKeys';
|
||||||
import { RestoreViewModel, RestoreOptionParam, SouceDatabaseNamesParam } from 'sql/workbench/services/restore/browser/restoreViewModel';
|
import { RestoreViewModel, RestoreOptionParam, SouceDatabaseNamesParam } from 'sql/workbench/services/restore/browser/restoreViewModel';
|
||||||
@@ -688,12 +688,12 @@ export class RestoreDialog extends Modal {
|
|||||||
|
|
||||||
public cancel() {
|
public cancel() {
|
||||||
this._onCancel.fire();
|
this._onCancel.fire();
|
||||||
this.close();
|
this.close('cancel');
|
||||||
}
|
}
|
||||||
|
|
||||||
public close() {
|
public close(hideReason: HideReason = 'close') {
|
||||||
this.resetDialog();
|
this.resetDialog();
|
||||||
this.hide();
|
this.hide(hideReason);
|
||||||
this._onCloseEvent.fire();
|
this._onCloseEvent.fire();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ import { localize } from 'vs/nls';
|
|||||||
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
|
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
|
||||||
|
|
||||||
import { Button } from 'sql/base/browser/ui/button/button';
|
import { Button } from 'sql/base/browser/ui/button/button';
|
||||||
import { Modal } from 'sql/workbench/browser/modal/modal';
|
import { HideReason, Modal } from 'sql/workbench/browser/modal/modal';
|
||||||
import { InputBox } from 'sql/base/browser/ui/inputBox/inputBox';
|
import { InputBox } from 'sql/base/browser/ui/inputBox/inputBox';
|
||||||
import { ServerGroupViewModel } from 'sql/workbench/services/serverGroup/common/serverGroupViewModel';
|
import { ServerGroupViewModel } from 'sql/workbench/services/serverGroup/common/serverGroupViewModel';
|
||||||
import * as TelemetryKeys from 'sql/platform/telemetry/common/telemetryKeys';
|
import * as TelemetryKeys from 'sql/platform/telemetry/common/telemetryKeys';
|
||||||
@@ -360,11 +360,11 @@ export class ServerGroupDialog extends Modal {
|
|||||||
|
|
||||||
public cancel() {
|
public cancel() {
|
||||||
this._onCancel.fire();
|
this._onCancel.fire();
|
||||||
this.close();
|
this.close('cancel');
|
||||||
}
|
}
|
||||||
|
|
||||||
public close() {
|
public close(hideReason: HideReason = 'close') {
|
||||||
this.hide();
|
this.hide(hideReason);
|
||||||
this.withRenderedDialog.groupNameInputBox.hideMessage();
|
this.withRenderedDialog.groupNameInputBox.hideMessage();
|
||||||
this._onCloseEvent.fire();
|
this._onCloseEvent.fire();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user