From d2aafa4f17d2c5f977b48d34d578f7f60687f290 Mon Sep 17 00:00:00 2001
From: HejdaJakub <kuba.hejda97@gmail.com>
Date: Mon, 14 Nov 2022 11:01:49 +0100
Subject: [PATCH] fix(admin): show styles correctly on preview for HTML form
 items

* In the preview column in the application form list and also on the preview page there are now the
HTML items displayed correctly with CSS styles.
---
 .../application-form-list.component.html                 | 7 ++++---
 .../application-form-preview.component.html              | 9 ++++++---
 2 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/apps/admin-gui/src/app/vos/components/application-form-list/application-form-list.component.html b/apps/admin-gui/src/app/vos/components/application-form-list/application-form-list.component.html
index 52fe232d0..7fd444e56 100644
--- a/apps/admin-gui/src/app/vos/components/application-form-list/application-form-list.component.html
+++ b/apps/admin-gui/src/app/vos/components/application-form-list/application-form-list.component.html
@@ -96,11 +96,12 @@
                   value="{{'VO_DETAIL.SETTINGS.APPLICATION_FORM.CLEAR_SELECTION' | translate}}" />
               </form>
             </div>
-            <div
-              *ngIf="applicationFormItem.type ==='HEADING' ||
-                      applicationFormItem.type === 'HTML_COMMENT'">
+            <div *ngIf="applicationFormItem.type ==='HEADING'">
               <span [innerHTML]="getLocalizedLabel(applicationFormItem)"></span>
             </div>
+            <div *ngIf="applicationFormItem.type === 'HTML_COMMENT'">
+              <span [innerHTML]="getLocalizedLabel(applicationFormItem) | sanitizeHtml"></span>
+            </div>
             <div *ngIf="applicationFormItem.type === 'SELECTIONBOX'">
               <select>
                 <option *ngFor="let item of getLocalizedOptions(applicationFormItem)">
diff --git a/apps/admin-gui/src/app/vos/components/application-form-preview/application-form-preview.component.html b/apps/admin-gui/src/app/vos/components/application-form-preview/application-form-preview.component.html
index 2af36ec43..a27e72a5f 100644
--- a/apps/admin-gui/src/app/vos/components/application-form-preview/application-form-preview.component.html
+++ b/apps/admin-gui/src/app/vos/components/application-form-preview/application-form-preview.component.html
@@ -129,12 +129,15 @@
         </div>
 
         <div
-          *ngIf="(applicationFormItem.type ==='HEADING' ||
-                    applicationFormItem.type === 'HTML_COMMENT') &&
-                    applicationFormItem.hidden !== 'ALWAYS'">
+          *ngIf="applicationFormItem.type ==='HEADING' && applicationFormItem.hidden !== 'ALWAYS'">
           <span [innerHTML]="getLocalizedLabel(applicationFormItem)"></span>
         </div>
 
+        <div
+          *ngIf="applicationFormItem.type === 'HTML_COMMENT' && applicationFormItem.hidden !== 'ALWAYS'">
+          <span [innerHTML]="getLocalizedLabel(applicationFormItem) | sanitizeHtml"></span>
+        </div>
+
         <div
           *ngIf="applicationFormItem.type === 'SELECTIONBOX' &&
                                    applicationFormItem.hidden !== 'ALWAYS'"
-- 
GitLab