From 4850b9e83883b4be865b660cfe57bfe35687aa30 Mon Sep 17 00:00:00 2001 From: "CITE\\spapacharalampous" Date: Tue, 27 Aug 2024 13:34:58 +0300 Subject: [PATCH] bug fix on question preview of description template editor --- .../description-template-editor-field-set.component.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/frontend/src/app/ui/admin/description-template/editor/components/field-set/description-template-editor-field-set.component.ts b/frontend/src/app/ui/admin/description-template/editor/components/field-set/description-template-editor-field-set.component.ts index 09ac2ab37..93894f918 100644 --- a/frontend/src/app/ui/admin/description-template/editor/components/field-set/description-template-editor-field-set.component.ts +++ b/frontend/src/app/ui/admin/description-template/editor/components/field-set/description-template-editor-field-set.component.ts @@ -196,10 +196,11 @@ export class DescriptionTemplateEditorFieldSetComponent extends BaseComponent im } const descriptionEditorModel = new DescriptionEditorModel().fromModel(mockDescription, mockDescription.descriptionTemplate); - this.previewPropertiesFormGroup = descriptionEditorModel.properties.fieldSets.get(fieldSet.id).buildForm({visibilityRulesService: this.visibilityRulesService}) as UntypedFormGroup; + const previewProperties = descriptionEditorModel.properties.buildForm({visibilityRulesService: this.visibilityRulesService}) as UntypedFormGroup; + this.previewPropertiesFormGroup = previewProperties.get("fieldSets").get(fieldSet.id) as UntypedFormGroup; this.previewFieldSet = fieldSet; - this.visibilityRulesService.setContext(mockDescription.descriptionTemplate.definition, this.previewPropertiesFormGroup); + this.visibilityRulesService.setContext(mockDescription.descriptionTemplate.definition, previewProperties); } onIsMultiplicityEnabledChange(isMultiplicityEnabled: MatCheckboxChange) {