mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-14 01:25:37 -05:00
sql-database-projects dialog completion cleanup (#17525)
This commit is contained in:
@@ -16,6 +16,7 @@ import { IconPathHelper } from '../common/iconHelper';
|
||||
import { cssStyles } from '../common/uiConstants';
|
||||
import { getConnectionName } from './utils';
|
||||
import { TelemetryActions, TelemetryReporter, TelemetryViews } from '../common/telemetry';
|
||||
import { Deferred } from '../common/promise';
|
||||
|
||||
interface DataSourceDropdownValue extends azdataType.CategoryValue {
|
||||
dataSource: SqlConnectionDataSource;
|
||||
@@ -44,6 +45,8 @@ export class PublishDatabaseDialog {
|
||||
private profileUsed: boolean = false;
|
||||
private serverName: string | undefined;
|
||||
|
||||
private completionPromise: Deferred = new Deferred();
|
||||
|
||||
private toDispose: vscode.Disposable[] = [];
|
||||
|
||||
public publish: ((proj: Project, profile: IDeploySettings) => any) | undefined;
|
||||
@@ -71,6 +74,13 @@ 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> {
|
||||
return this.completionPromise.promise;
|
||||
}
|
||||
|
||||
private dispose(): void {
|
||||
|
||||
Reference in New Issue
Block a user