mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
add confirmation message to update project from db dialog (#18199)
This commit is contained in:
@@ -270,6 +270,7 @@ export const updateAction = localize('updateAction', "Update action");
|
|||||||
export const compareActionRadioButtonLabel = localize('compareActionRadiButtonLabel', "View changes in Schema Compare");
|
export const compareActionRadioButtonLabel = localize('compareActionRadiButtonLabel', "View changes in Schema Compare");
|
||||||
export const updateActionRadioButtonLabel = localize('updateActionRadiButtonLabel', "Apply all changes");
|
export const updateActionRadioButtonLabel = localize('updateActionRadiButtonLabel', "Apply all changes");
|
||||||
export const actionLabel = localize('actionLabel', "Action");
|
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
|
// Update project from database
|
||||||
|
|
||||||
|
|||||||
@@ -497,6 +497,8 @@ export class UpdateProjectFromDatabaseDialog {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public async handleUpdateButtonClick(): Promise<void> {
|
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 serverDropdownValue = this.serverDropdown!.value! as azdata.CategoryValue as ConnectionDropdownValue;
|
||||||
const ownerUri = await getAzdataApi()!.connection.getUriForConnection(serverDropdownValue.connection.connectionId);
|
const ownerUri = await getAzdataApi()!.connection.getUriForConnection(serverDropdownValue.connection.connectionId);
|
||||||
|
|
||||||
@@ -558,11 +560,11 @@ export class UpdateProjectFromDatabaseDialog {
|
|||||||
targetEndpointInfo: targetEndpointInfo,
|
targetEndpointInfo: targetEndpointInfo,
|
||||||
action: this.action!
|
action: this.action!
|
||||||
};
|
};
|
||||||
|
void this.updateProjectFromDatabaseCallback!(model);
|
||||||
getAzdataApi()!.window.closeDialog(this.dialog);
|
}
|
||||||
await this.updateProjectFromDatabaseCallback!(model);
|
|
||||||
|
|
||||||
this.dispose();
|
this.dispose();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async validate(): Promise<boolean> {
|
async validate(): Promise<boolean> {
|
||||||
|
|||||||
Reference in New Issue
Block a user