add confirmation message to update project from db dialog (#18199)

This commit is contained in:
Kim Santiago
2022-02-02 17:04:12 -08:00
committed by GitHub
parent 8685137c27
commit 243afc9f54
2 changed files with 62 additions and 59 deletions

View File

@@ -270,6 +270,7 @@ export const updateAction = localize('updateAction', "Update action");
export const compareActionRadioButtonLabel = localize('compareActionRadiButtonLabel', "View changes in Schema Compare");
export const updateActionRadioButtonLabel = localize('updateActionRadiButtonLabel', "Apply all changes");
export const actionLabel = localize('actionLabel', "Action");
export const applyConfirmation: string = localize('applyConfirmation', "Are you sure you want to update the target project?");
// Update project from database

View File

@@ -497,6 +497,8 @@ export class UpdateProjectFromDatabaseDialog {
}
public async handleUpdateButtonClick(): Promise<void> {
await vscode.window.showWarningMessage(constants.applyConfirmation, { modal: true }, constants.yesString).then(async (result) => {
if (result === constants.yesString) {
const serverDropdownValue = this.serverDropdown!.value! as azdata.CategoryValue as ConnectionDropdownValue;
const ownerUri = await getAzdataApi()!.connection.getUriForConnection(serverDropdownValue.connection.connectionId);
@@ -558,11 +560,11 @@ export class UpdateProjectFromDatabaseDialog {
targetEndpointInfo: targetEndpointInfo,
action: this.action!
};
getAzdataApi()!.window.closeDialog(this.dialog);
await this.updateProjectFromDatabaseCallback!(model);
void this.updateProjectFromDatabaseCallback!(model);
}
this.dispose();
});
}
async validate(): Promise<boolean> {