Add onClosed event to ModelView dialogs (#17531)

* Add onClosed event to ModelView dialogs

* Use defined type

* Fix compile

* fix tests

* fix tests2

* Remove unused
This commit is contained in:
Charles Gagnon
2021-10-28 20:53:20 -07:00
committed by GitHub
parent 62b6e781ce
commit 82805638ad
12 changed files with 82 additions and 15 deletions

View File

@@ -18,7 +18,7 @@ export class CustomDialogService {
constructor(@IInstantiationService private _instantiationService: IInstantiationService) { }
public showDialog(dialog: Dialog, dialogName?: string, options?: IModalOptions): void {
public showDialog(dialog: Dialog, dialogName?: string, options?: IModalOptions): DialogModal {
let name = dialogName ? dialogName : 'CustomDialog';
if (options && (options.dialogStyle === 'callout')) {
@@ -30,6 +30,7 @@ export class CustomDialogService {
this._dialogModals.set(dialog, dialogModal);
dialogModal.render();
dialogModal.open();
return dialogModal;
}
public showWizard(wizard: Wizard, options?: IModalOptions, source?: string): void {

View File

@@ -0,0 +1,31 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService';
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService';
import { ILogService } from 'vs/platform/log/common/log';
import { ITextResourcePropertiesService } from 'vs/editor/common/services/textResourceConfigurationService';
import { IAdsTelemetryService } from 'sql/platform/telemetry/common/telemetry';
import { ILayoutService } from 'vs/platform/layout/browser/layoutService';
import { DialogModal } from 'sql/workbench/services/dialog/browser/dialogModal';
import { Dialog } from 'sql/workbench/services/dialog/common/dialogTypes';
export class TestDialogModal extends DialogModal {
constructor(
@ILayoutService layoutService: ILayoutService,
@IWorkbenchThemeService themeService: IWorkbenchThemeService,
@IAdsTelemetryService telemetryService: IAdsTelemetryService,
@IContextKeyService contextKeyService: IContextKeyService,
@IClipboardService clipboardService: IClipboardService,
@ILogService logService: ILogService,
@ITextResourcePropertiesService textResourcePropertiesService: ITextResourcePropertiesService,
@IInstantiationService instantiationService: IInstantiationService) {
// For now just hardcode the dialog since current uses just care about the title property
super(<Dialog>{ title: 'TestDialogModal' }, '', {}, layoutService, themeService, telemetryService, contextKeyService, clipboardService, logService, textResourcePropertiesService, instantiationService);
}
}