diff --git a/extensions/sql-database-projects/src/common/constants.ts b/extensions/sql-database-projects/src/common/constants.ts index 0f29f51a53..d7fb363715 100644 --- a/extensions/sql-database-projects/src/common/constants.ts +++ b/extensions/sql-database-projects/src/common/constants.ts @@ -98,7 +98,7 @@ export const defaultProjectNameStarter = localize('defaultProjectNameStarter', " export const location = localize('location', "Location"); export const reloadProject = localize('reloadProject', "Would you like to reload your database project?"); export const learnMore = localize('learnMore', "Learn More"); -export const sdkLearnMoreUrl = 'https://github.com/microsoft/DacFx/tree/main/src/Microsoft.Build.Sql'; +export const sdkLearnMoreUrl = 'https://aka.ms/sqlprojsdk'; export function newObjectNamePrompt(objectType: string) { return localize('newObjectNamePrompt', 'New {0} name:', objectType); } export function deleteConfirmation(toDelete: string) { return localize('deleteConfirmation', "Are you sure you want to delete {0}?", toDelete); } export function deleteConfirmationContents(toDelete: string) { return localize('deleteConfirmationContents', "Are you sure you want to delete {0} and all of its contents?", toDelete); } @@ -106,6 +106,7 @@ export function deleteReferenceConfirmation(toDelete: string) { return localize( export function selectTargetPlatform(currentTargetPlatform: string) { return localize('selectTargetPlatform', "Current target platform: {0}. Select new target platform", currentTargetPlatform); } export function currentTargetPlatform(projectName: string, currentTargetPlatform: string) { return localize('currentTargetPlatform', "Target platform of the project {0} is now {1}", projectName, currentTargetPlatform); } export function projectUpdatedToSdkStyle(projectName: string) { return localize('projectUpdatedToSdkStyle', "The project {0} has been updated to be an SDK-style project. Click 'Learn More' for details on the Microsoft.Build.Sql SDK and ways to simplify the project file.", projectName); } +export function convertToSdkStyleConfirmation(projectName: string) { return localize('convertToSdkStyleConfirmation', "The project '{0}' will not be fully compatible with SSDT after conversion. A backup copy of the project file will be created in the project folder prior to conversion. More information is available at https://aka.ms/sqlprojsdk. Continue with converting to SDK-style project?", projectName); } export function updatedToSdkStyleError(projectName: string) { return localize('updatedToSdkStyleError', "Converting the project {0} to SDK-style was unsuccessful. Changes to the .sqlproj have been rolled back.", projectName); } // Publish dialog strings diff --git a/extensions/sql-database-projects/src/controllers/projectController.ts b/extensions/sql-database-projects/src/controllers/projectController.ts index ff54b95317..7e0658890d 100644 --- a/extensions/sql-database-projects/src/controllers/projectController.ts +++ b/extensions/sql-database-projects/src/controllers/projectController.ts @@ -887,20 +887,27 @@ export class ProjectsController { */ public async convertToSdkStyleProject(context: dataworkspace.WorkspaceTreeItem): Promise { 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!)); + } + } } - } + }); } /**