Skip to content

Commit 3a8d385

Browse files
committed
[DSC-1379] Fix issue with security initialization
1 parent 340cca1 commit 3a8d385

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,17 +291,24 @@ export class DsDynamicRelationGroupModalComponent extends DynamicFormControlComp
291291

292292
private buildChipItem() {
293293
const item = Object.create({});
294+
let mainModel;
295+
this.formModel.some((modelRow: DynamicFormGroupModel) => {
296+
const findIndex = modelRow.group.findIndex(model => model.name === this.model.name);
297+
if (findIndex !== -1) {
298+
mainModel = modelRow.group[findIndex];
299+
return true;
300+
}
301+
});
294302
this.formModel.forEach((row) => {
295303
const modelRow = row as DynamicFormGroupModel;
296-
const mainRow: any = modelRow.group.find(model => model.name === this.model.name);
297304
modelRow.group.forEach((control: DynamicInputModel) => {
298305
const controlValue: any = (control?.value as any)?.value || control?.value || PLACEHOLDER_PARENT_METADATA;
299306
const controlAuthority: any = (control?.value as any)?.authority || null;
300307

301308
item[control.name] =
302309
new FormFieldMetadataValueObject(
303310
controlValue, (control as any)?.language,
304-
controlValue === PLACEHOLDER_PARENT_METADATA ? null : mainRow.securityLevel,
311+
controlValue === PLACEHOLDER_PARENT_METADATA ? null : mainModel.securityLevel,
305312
controlAuthority,
306313
null, 0, null,
307314
(control?.value as any)?.otherInformation || null

src/app/shared/form/builder/parsers/relation-group-field-parser.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ export class RelationGroupFieldParser extends FieldParser {
5858
}
5959
};
6060

61+
this.initSecurityValue(modelConfiguration);
6162
const model = new DynamicRelationGroupModel(modelConfiguration, cls);
6263
model.name = this.getFieldId();
6364
model.isInlineGroup = (this.configData.input.type === ParserType.InlineGroup);

0 commit comments

Comments
 (0)