Skip to content

Commit 17fb8fd

Browse files
NikitaKr1vonosovFrancescoMolinaro
authored andcommitted
Merged in task/dspace-cris-2023_02_x/DSC-1876 (pull request DSpace#2140)
[DSC-1876] port of [CST-14979] block type binding in modal Approved-by: Francesco Molinaro
2 parents e66cbf2 + 6d87abe commit 17fb8fd

2 files changed

Lines changed: 14 additions & 7 deletions

File tree

src/app/shared/form/builder/form-builder.service.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ export class FormBuilderService extends DynamicFormService {
361361

362362
modelFromConfiguration(submissionId: string, json: string | SubmissionFormsModel, scopeUUID: string, sectionData: any = {},
363363
submissionScope?: string, readOnly = false, typeBindModel = null,
364-
isInnerForm = false, securityConfig: any = null): DynamicFormControlModel[] | never {
364+
isInnerForm = false, securityConfig: any = null, setTypeBind: boolean = true): DynamicFormControlModel[] | never {
365365
let rows: DynamicFormControlModel[] = [];
366366
const rawData = typeof json === 'string' ? JSON.parse(json, parseReviver) : json;
367367
if (rawData.rows && !isEmpty(rawData.rows)) {
@@ -378,12 +378,14 @@ export class FormBuilderService extends DynamicFormService {
378378
});
379379
}
380380

381-
if (hasNoValue(typeBindModel)) {
382-
typeBindModel = this.findById(this.typeField, rows);
383-
}
381+
if (setTypeBind) {
382+
if (hasNoValue(typeBindModel)) {
383+
typeBindModel = this.findById(this.typeField, rows);
384+
}
384385

385-
if (hasValue(typeBindModel)) {
386-
this.setTypeBindModel(typeBindModel);
386+
if (hasValue(typeBindModel)) {
387+
this.setTypeBindModel(typeBindModel);
388+
}
387389
}
388390
return rows;
389391
}

src/app/submission/sections/upload/file/edit/section-upload-file-edit.component.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,12 @@ export class SubmissionSectionUploadFileEditComponent
314314
configForm,
315315
this.collectionId,
316316
this.fileData.metadata,
317-
this.submissionService.getSubmissionScope()
317+
this.submissionService.getSubmissionScope(),
318+
false,
319+
null,
320+
false,
321+
null,
322+
false
318323
);
319324
formModel.push(new DynamicFormGroupModel(metadataGroupModelConfig, BITSTREAM_METADATA_FORM_GROUP_LAYOUT));
320325
const accessConditionTypeModelConfig = Object.assign({}, BITSTREAM_FORM_ACCESS_CONDITION_TYPE_CONFIG);

0 commit comments

Comments
 (0)