require confirmation when risks present (#1668)

This commit is contained in:
Alan Ren
2022-09-02 12:50:30 -07:00
committed by GitHub
parent 41556aea54
commit 7f675b884f
7 changed files with 41 additions and 8 deletions

View File

@@ -196,9 +196,11 @@ namespace Microsoft.SqlTools.ServiceLayer.TableDesigner
{
var table = this.GetTableDesigner(tableInfo);
var report = table.GenerateReport();
generatePreviewReportResult.Report = report;
generatePreviewReportResult.Report = report.Report;
generatePreviewReportResult.MimeType = "text/markdown";
generatePreviewReportResult.Metadata = this.GetMetadata(tableInfo);
generatePreviewReportResult.RequireConfirmation = report.RequireTableRecreation || report.PossibleDataLoss || report.HasWarnings;
generatePreviewReportResult.ConfirmationText = generatePreviewReportResult.RequireConfirmation ? SR.TableDesignerConfirmationText : null;
await requestContext.SendResult(generatePreviewReportResult);
}
catch (DesignerValidationException e)