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

@@ -55,6 +55,7 @@ export class PublishDatabaseDialog {
constructor(private project: Project) {
this.dialog = utils.getAzdataApi()!.window.createModelViewDialog(constants.publishDialogName, 'sqlProjectPublishDialog');
this.toDispose.push(this.dialog.onClosed(_ => this.completionPromise.resolve()));
this.publishTab = utils.getAzdataApi()!.window.createTab(constants.publishDialogName);
}
@@ -74,9 +75,6 @@ export class PublishDatabaseDialog {
this.dialog.customButtons.push(generateScriptButton);
utils.getAzdataApi()!.window.openDialog(this.dialog);
// Complete the promise when we're done - we use a disposable here instead of a CloseValidator because we have custom buttons (generate script)
// which don't go through that logic.
this.toDispose.push({ dispose: () => { this.completionPromise.resolve(); } });
}
public waitForClose(): Promise<void> {