mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
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:
@@ -98,7 +98,7 @@ export const defaultProjectNameStarter = localize('defaultProjectNameStarter', "
|
|||||||
export const location = localize('location', "Location");
|
export const location = localize('location', "Location");
|
||||||
export const reloadProject = localize('reloadProject', "Would you like to reload your database project?");
|
export const reloadProject = localize('reloadProject', "Would you like to reload your database project?");
|
||||||
export const learnMore = localize('learnMore', "Learn More");
|
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 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 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); }
|
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 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 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 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); }
|
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
|
// Publish dialog strings
|
||||||
|
|||||||
@@ -887,7 +887,12 @@ export class ProjectsController {
|
|||||||
*/
|
*/
|
||||||
public async convertToSdkStyleProject(context: dataworkspace.WorkspaceTreeItem): Promise<void> {
|
public async convertToSdkStyleProject(context: dataworkspace.WorkspaceTreeItem): Promise<void> {
|
||||||
const project = this.getProjectFromContext(context);
|
const project = this.getProjectFromContext(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();
|
const updateResult = await project.convertProjectToSdkStyle();
|
||||||
|
void this.reloadProject(context);
|
||||||
|
|
||||||
if (!updateResult) {
|
if (!updateResult) {
|
||||||
void vscode.window.showErrorMessage(constants.updatedToSdkStyleError(project.projectFileName));
|
void vscode.window.showErrorMessage(constants.updatedToSdkStyleError(project.projectFileName));
|
||||||
@@ -902,6 +907,8 @@ export class ProjectsController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds a database reference to the project
|
* Adds a database reference to the project
|
||||||
|
|||||||
Reference in New Issue
Block a user