mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-21 09:35:38 -05:00
added markdown renderer for publish dialog (#18645)
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user