added markdown renderer for publish dialog (#18645)

This commit is contained in:
Aditya Bist
2022-03-07 10:57:37 -08:00
committed by GitHub
parent 72632bc376
commit 1be5c926d3

View File

@@ -18,6 +18,8 @@ import { ITextResourcePropertiesService } from 'vs/editor/common/services/textRe
import { IAdsTelemetryService } from 'sql/platform/telemetry/common/telemetry';
import { attachModalDialogStyler } from 'sql/workbench/common/styler';
import { ILayoutService } from 'vs/platform/layout/browser/layoutService';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { MarkdownRenderer } from 'vs/editor/browser/core/markdownRenderer';
const OkText: string = localize('tableDesigner.UpdateDatabase', "Update Database");
const CancelText: string = localize('tableDesigner.cancel', "Cancel");
@@ -36,6 +38,7 @@ export class TableDesignerPublishDialog extends Modal {
private _generateScriptButton?: Button;
private _cancelButton?: Button;
private _promiseResolver: (value: TableDesignerPublishDialogResult) => void;
private readonly _markdownRenderer: MarkdownRenderer;
constructor(
@IThemeService themeService: IThemeService,
@@ -44,9 +47,11 @@ export class TableDesignerPublishDialog extends Modal {
@IAdsTelemetryService telemetryService: IAdsTelemetryService,
@IContextKeyService contextKeyService: IContextKeyService,
@ILogService logService: ILogService,
@ITextResourcePropertiesService textResourcePropertiesService: ITextResourcePropertiesService
@ITextResourcePropertiesService textResourcePropertiesService: ITextResourcePropertiesService,
@IInstantiationService instantiationService: IInstantiationService
) {
super('', TelemetryKeys.ModalDialogName.TableDesignerPublishDialog, telemetryService, layoutService, clipboardService, themeService, logService, textResourcePropertiesService, contextKeyService, { dialogStyle: 'normal', hasTitleIcon: false });
this._markdownRenderer = instantiationService.createInstance(MarkdownRenderer, {});
}
public open(report: string): Promise<TableDesignerPublishDialogResult> {
@@ -73,7 +78,8 @@ export class TableDesignerPublishDialog extends Modal {
protected renderBody(container: HTMLElement) {
const body = DOM.append(container, DOM.$('.table-designer-publish-dialog'));
body.innerText = this._report;
const markdownElement = this._markdownRenderer.render({ value: this._report }).element;
DOM.append(body, markdownElement);
}
protected layout(height?: number): void {