Skip to content

Commit 1112b40

Browse files
committed
[DSC-1379] fix: skip securityLevel for placeholder
1 parent 62f3e90 commit 1112b40

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

src/app/shared/form/builder/ds-dynamic-form-ui/models/relation-group/modal/dynamic-relation-group-modal.components.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export class DsDynamicRelationGroupModalComponent extends DynamicFormControlComp
6565
@Output() edit: EventEmitter<any> = new EventEmitter<any>();
6666
@Output() add: EventEmitter<any> = new EventEmitter<any>();
6767

68-
@ViewChild('formRef', {static: false}) private formRef: FormComponent;
68+
@ViewChild('formRef', { static: false }) private formRef: FormComponent;
6969

7070
public formModel: DynamicFormControlModel[];
7171
public vocabulary$: Observable<Vocabulary>;
@@ -75,20 +75,20 @@ export class DsDynamicRelationGroupModalComponent extends DynamicFormControlComp
7575

7676

7777
constructor(private vocabularyService: VocabularyService,
78-
private formBuilderService: FormBuilderService,
79-
private formService: FormService,
80-
private cdr: ChangeDetectorRef,
81-
protected layoutService: DynamicFormLayoutService,
82-
protected validationService: DynamicFormValidationService,
83-
protected modalService: NgbModal,
84-
protected submissionService: SubmissionService,
85-
private activeModal: NgbActiveModal
78+
private formBuilderService: FormBuilderService,
79+
private formService: FormService,
80+
private cdr: ChangeDetectorRef,
81+
protected layoutService: DynamicFormLayoutService,
82+
protected validationService: DynamicFormValidationService,
83+
protected modalService: NgbModal,
84+
protected submissionService: SubmissionService,
85+
private activeModal: NgbActiveModal
8686
) {
8787
super(layoutService, validationService);
8888
}
8989

9090
ngOnInit() {
91-
const config = {rows: this.model.formConfiguration} as SubmissionFormsModel;
91+
const config = { rows: this.model.formConfiguration } as SubmissionFormsModel;
9292
this.formId = this.formService.getUniqueId(this.model.id);
9393
this.formModel = this.formBuilderService.modelFromConfiguration(
9494
this.model.submissionId,
@@ -293,15 +293,15 @@ export class DsDynamicRelationGroupModalComponent extends DynamicFormControlComp
293293
const item = Object.create({});
294294
this.formModel.forEach((row) => {
295295
const modelRow = row as DynamicFormGroupModel;
296-
const mainRow = modelRow.group.find(model => model.name === this.model.name);
296+
const mainRow: any = modelRow.group.find(model => model.name === this.model.name);
297297
modelRow.group.forEach((control: DynamicInputModel) => {
298298
const controlValue: any = (control?.value as any)?.value || control?.value || PLACEHOLDER_PARENT_METADATA;
299299
const controlAuthority: any = (control?.value as any)?.authority || null;
300300

301301
item[control.name] =
302302
new FormFieldMetadataValueObject(
303303
controlValue, (control as any)?.language,
304-
(mainRow as any).securityLevel,
304+
controlValue === PLACEHOLDER_PARENT_METADATA ? null : mainRow.securityLevel,
305305
controlAuthority,
306306
null, 0, null,
307307
(control?.value as any)?.otherInformation || null

0 commit comments

Comments
 (0)