Add confirmation before converting to SDK-style project (#18893)

* Add confirmation before updating to SDK-style project

* update string

* update string

* update other learn more url
This commit is contained in:
Kim Santiago
2022-04-07 15:48:05 -07:00
committed by GitHub
parent d8b3db2ee3
commit 379b24d78c
2 changed files with 19 additions and 11 deletions

View File

@@ -887,20 +887,27 @@ export class ProjectsController {
*/
public async convertToSdkStyleProject(context: dataworkspace.WorkspaceTreeItem): Promise<void> {
const project = this.getProjectFromContext(context);
const updateResult = await project.convertProjectToSdkStyle();
if (!updateResult) {
void vscode.window.showErrorMessage(constants.updatedToSdkStyleError(project.projectFileName));
} else {
void this.reloadProject(context);
// confirm that user wants to update the project and knows the SSDT doesn't have support for displaying glob files yet
await vscode.window.showWarningMessage(constants.convertToSdkStyleConfirmation(project.projectFileName), { modal: true }, constants.yesString).then(async (result) => {
if (result === constants.yesString) {
const updateResult = await project.convertProjectToSdkStyle();
void this.reloadProject(context);
// show message that project file can be simplified
const result = await vscode.window.showInformationMessage(constants.projectUpdatedToSdkStyle(project.projectFileName), constants.learnMore);
if (!updateResult) {
void vscode.window.showErrorMessage(constants.updatedToSdkStyleError(project.projectFileName));
} else {
void this.reloadProject(context);
if (result === constants.learnMore) {
void vscode.env.openExternal(vscode.Uri.parse(constants.sdkLearnMoreUrl!));
// show message that project file can be simplified
const result = await vscode.window.showInformationMessage(constants.projectUpdatedToSdkStyle(project.projectFileName), constants.learnMore);
if (result === constants.learnMore) {
void vscode.env.openExternal(vscode.Uri.parse(constants.sdkLearnMoreUrl!));
}
}
}
}
});
}
/**