diff --git a/dmp-admin/src/app/field-form/field-form.component.html b/dmp-admin/src/app/field-form/field-form.component.html index 4fdaa0fb1..dc0150af0 100644 --- a/dmp-admin/src/app/field-form/field-form.component.html +++ b/dmp-admin/src/app/field-form/field-form.component.html @@ -3,7 +3,7 @@
- +
diff --git a/dmp-admin/src/app/field-form/field-form.component.ts b/dmp-admin/src/app/field-form/field-form.component.ts index 0f092c871..d2ace461a 100644 --- a/dmp-admin/src/app/field-form/field-form.component.ts +++ b/dmp-admin/src/app/field-form/field-form.component.ts @@ -23,7 +23,6 @@ export class FieldFormComponent { constructon() { } ngOnInit() { - console.log("init field") // this.addNewRule(); } diff --git a/dmp-admin/src/app/groupfield-form/groupfield-form.component.ts b/dmp-admin/src/app/groupfield-form/groupfield-form.component.ts index bdf8f522b..08682295a 100644 --- a/dmp-admin/src/app/groupfield-form/groupfield-form.component.ts +++ b/dmp-admin/src/app/groupfield-form/groupfield-form.component.ts @@ -18,8 +18,7 @@ export class GroupFieldFormComponent { constructor(){} - ngOnInit(){ - console.log("init group"); + ngOnInit(){ //this.addNewField(); } diff --git a/dmp-frontend/src/app/form/dynamic-form-group/dynamic-form-group.component.html b/dmp-frontend/src/app/form/dynamic-form-group/dynamic-form-group.component.html index 32816727e..cd2a5fcb0 100644 --- a/dmp-frontend/src/app/form/dynamic-form-group/dynamic-form-group.component.html +++ b/dmp-frontend/src/app/form/dynamic-form-group/dynamic-form-group.component.html @@ -6,15 +6,17 @@ {{group.extendedDescription}} -->
-
- - Add one more field + - +
+
+ [pathName]="pathName+'.compositeFields.'+i+'.multiplicityItems.'+j">
diff --git a/dmp-frontend/src/app/models/CompositeField.ts b/dmp-frontend/src/app/models/CompositeField.ts index 90c08aff3..a42c7d005 100644 --- a/dmp-frontend/src/app/models/CompositeField.ts +++ b/dmp-frontend/src/app/models/CompositeField.ts @@ -16,10 +16,10 @@ export class CompositeField extends BaseModel implements Serializable().fromJSONArray(item.fields, Field); this.ordinal = item.ordinal; this.id = item.id; - //this.multiplicity = new JsonSerializer().fromJSONObject(item.multiplicity, Multiplicity); - this.multiplicity = new Multiplicity(); + this.multiplicity = new JsonSerializer().fromJSONObject(item.multiplicity, Multiplicity); + //this.multiplicity = new Multiplicity(); //this.multiplicity.max = 2; - this.multiplicityItems = new JsonSerializer().fromJSONArray(item.multiplicityItems, CompositeField); + if(item.multiplicityItems)this.multiplicityItems = new JsonSerializer().fromJSONArray(item.multiplicityItems, CompositeField); return this; } diff --git a/dmp-frontend/src/app/models/Field.ts b/dmp-frontend/src/app/models/Field.ts index 635e58f89..260c6e278 100644 --- a/dmp-frontend/src/app/models/Field.ts +++ b/dmp-frontend/src/app/models/Field.ts @@ -29,12 +29,12 @@ export class Field extends BaseModel implements Serializable, FormGenerat this.viewStyle = item.viewStyle; this.defaultVisibility = item.defaultVisibility; this.page = item.page; - //this.multiplicity = new JsonSerializer().fromJSONObject(item.multiplicity, Multiplicity); + this.multiplicity = new JsonSerializer().fromJSONObject(item.multiplicity, Multiplicity); this.defaultValue = new JsonSerializer().fromJSONObject(item.defaultValue, DefaultValue); this.value = this.defaultValue.value && !item.value ? this.defaultValue.value : item.value; - this.multiplicity = new Multiplicity(); + //this.multiplicity = new Multiplicity(); //this.multiplicity.max = 2; - this.multiplicityItems = new JsonSerializer().fromJSONArray(item.multiplicityItems, Field); + if(item.multiplicityItems)this.multiplicityItems = new JsonSerializer().fromJSONArray(item.multiplicityItems, Field); this.data = item.data; return this; }