Merge pull request #12120 from vvlladd28/bug/notification/mail-template

Fixed incorrect show mail notification preview
This commit is contained in:
Igor Kulikov 2024-11-29 17:51:42 +02:00 committed by GitHub
commit 02bb81db15
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 25 additions and 18 deletions

View File

@ -213,7 +213,7 @@
<div class="notification-content"> <div class="notification-content">
<div class="subject">{{ preview.processedTemplates.EMAIL.subject }}</div> <div class="subject">{{ preview.processedTemplates.EMAIL.subject }}</div>
<mat-divider></mat-divider> <mat-divider></mat-divider>
<div class="html-content" [innerHTML]="(preview.processedTemplates.EMAIL.body | safe: 'html')"></div> <editor [init]="tinyMceOptions" [initialValue]="preview.processedTemplates.EMAIL.body"></editor>
</div> </div>
</section> </section>
<section class="preview-group notification tb-form-panel stroked no-gap" *ngIf="preview.processedTemplates.SLACK?.enabled"> <section class="preview-group notification tb-form-panel stroked no-gap" *ngIf="preview.processedTemplates.SLACK?.enabled">

View File

@ -179,14 +179,6 @@
letter-spacing: 0.25px; letter-spacing: 0.25px;
} }
.html-content {
margin-top: 12px;
font-weight: 400;
font-size: 14px;
line-height: 20px;
overflow-x: auto;
}
&.mini { &.mini {
font-size: 12px; font-size: 12px;
line-height: 1.25; line-height: 1.25;
@ -233,15 +225,6 @@
} }
} }
.preview-group {
.notification-content {
.html-content,
.html-content * {
all: revert;
}
}
}
.delivery-methods-container { .delivery-methods-container {
.delivery-method-container { .delivery-method-container {
&.interact * { &.interact * {

View File

@ -77,6 +77,30 @@ export class SentNotificationDialogComponent extends
showRefresh = false; showRefresh = false;
tinyMceOptions: Record<string, any> = {
base_url: '/assets/tinymce',
suffix: '.min',
plugins: ['autoresize'],
menubar: false,
toolbar: false,
statusbar: false,
resize: false,
readonly: true,
height: 400,
autofocus: false,
branding: false,
promotion: false,
setup: (ed) => {
ed.on('PreInit', () => {
const document = $(ed.iframeElement.contentDocument);
const body = $('#tinymce', document);
body.attr({contenteditable: false});
body.css('pointerEvents', 'none');
body.css('userSelect', 'none');
})
}
};
private authUser: AuthUser = getCurrentAuthUser(this.store); private authUser: AuthUser = getCurrentAuthUser(this.store);
private allowNotificationDeliveryMethods: Array<NotificationDeliveryMethod>; private allowNotificationDeliveryMethods: Array<NotificationDeliveryMethod>;