From bfd44d5dfd579eaf954f934d52337bd0d5addfa5 Mon Sep 17 00:00:00 2001 From: mchouliara Date: Fri, 6 Sep 2024 13:59:21 +0300 Subject: [PATCH] remove service as component input > include in parent providers instead --- .../description-template-editor-field-set.component.html | 9 ++++++++- .../description-template-editor-field-set.component.ts | 4 ++-- .../form-field-set/form-field-set.component.ts | 4 ++-- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/frontend/src/app/ui/admin/description-template/editor/components/field-set/description-template-editor-field-set.component.html b/frontend/src/app/ui/admin/description-template/editor/components/field-set/description-template-editor-field-set.component.html index b5e11e74a..cea872480 100644 --- a/frontend/src/app/ui/admin/description-template/editor/components/field-set/description-template-editor-field-set.component.html +++ b/frontend/src/app/ui/admin/description-template/editor/components/field-set/description-template-editor-field-set.component.html @@ -132,7 +132,14 @@
- +
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 2487eb560..6f4c361fa 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 @@ -28,7 +28,8 @@ import { ReferenceType } from '@app/core/model/reference-type/reference-type'; selector: 'app-description-template-editor-field-set-component', templateUrl: './description-template-editor-field-set.component.html', styleUrls: ['./description-template-editor-field-set.component.scss'], - animations: [GENERAL_ANIMATIONS] + animations: [GENERAL_ANIMATIONS], + providers: [VisibilityRulesService] }) export class DescriptionTemplateEditorFieldSetComponent extends BaseComponent implements OnInit { @@ -196,7 +197,6 @@ export class DescriptionTemplateEditorFieldSetComponent extends BaseComponent im 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, previewProperties); } diff --git a/frontend/src/app/ui/description/editor/description-form/components/form-field-set/form-field-set.component.ts b/frontend/src/app/ui/description/editor/description-form/components/form-field-set/form-field-set.component.ts index 039ec6b51..1510a2686 100644 --- a/frontend/src/app/ui/description/editor/description-form/components/form-field-set/form-field-set.component.ts +++ b/frontend/src/app/ui/description/editor/description-form/components/form-field-set/form-field-set.component.ts @@ -1,4 +1,4 @@ -import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Input } from '@angular/core'; +import { ChangeDetectionStrategy, ChangeDetectorRef, Component, input, Input, SimpleChanges } from '@angular/core'; import { UntypedFormArray, UntypedFormGroup } from '@angular/forms'; import { MatDialog } from "@angular/material/dialog"; import { DescriptionTemplateFieldSet } from '@app/core/model/description-template/description-template'; @@ -42,7 +42,6 @@ export class DescriptionFormFieldSetComponent extends BaseComponent { } isVisibleByVisibilityService: boolean = true; - @Input() visibilityRulesService: VisibilityRulesService; @Input() path: String; @Input() descriptionTemplateId: String; @Input() isChild: Boolean = false; @@ -65,6 +64,7 @@ export class DescriptionFormFieldSetComponent extends BaseComponent { private descriptionFormService: DescriptionFormService, private uiNotificationService: UiNotificationService, private language: TranslateService, + public visibilityRulesService: VisibilityRulesService ) { super(); }