multiplicity
This commit is contained in:
parent
30d136e634
commit
b9fa3d1dac
|
@ -3,7 +3,7 @@
|
|||
<div class="row">
|
||||
<div class="form-group col-md-6">
|
||||
<label>Title</label>
|
||||
<input type="text" class="form-control" formControlName="title">
|
||||
<input data-toggle="tooltip" title="tooltip on second input!" type="text" class="form-control" formControlName="title">
|
||||
</div>
|
||||
<div class="form-group col-md-3">
|
||||
<label>Id</label>
|
||||
|
|
|
@ -23,7 +23,6 @@ export class FieldFormComponent {
|
|||
constructon() { }
|
||||
|
||||
ngOnInit() {
|
||||
console.log("init field")
|
||||
// this.addNewRule();
|
||||
}
|
||||
|
||||
|
|
|
@ -18,8 +18,7 @@ export class GroupFieldFormComponent {
|
|||
|
||||
constructor(){}
|
||||
|
||||
ngOnInit(){
|
||||
console.log("init group");
|
||||
ngOnInit(){
|
||||
//this.addNewField();
|
||||
}
|
||||
|
||||
|
|
|
@ -6,15 +6,17 @@
|
|||
<i>{{group.extendedDescription}}</i>
|
||||
</h5> -->
|
||||
<div *ngFor="let compositeField of group.compositeFields; let i = index;">
|
||||
<div *ngIf="(compositeField?.multiplicity?.max - 1) > (compositeField?.multiplicityItems?.length)">
|
||||
<a (click)="addMultipleField(i)" style="cursor: pointer">
|
||||
Add one more field +
|
||||
</a>
|
||||
<div *ngIf="visibilityRulesService.isElementVisible(null,compositeField.id)">
|
||||
<div *ngIf="(compositeField?.multiplicity?.max - 1) > (compositeField?.multiplicityItems?.length)">
|
||||
<a (click)="addMultipleField(i)" style="cursor: pointer">
|
||||
Add one more field +
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<df-composite-field [compositeField]="compositeField" [form]="form.get('compositeFields').get(''+i)" [path]="path" [pathName]="pathName+'.compositeFields.'+i"></df-composite-field>
|
||||
<div *ngFor="let multipleCompositeField of compositeField.multiplicityItems; let j = index;">
|
||||
<df-composite-field [compositeField]="multipleCompositeField" [form]="form.get('compositeFields').get(''+i).get('multiplicityItems').get(''+j)"
|
||||
[pathName]="pathName+'.compositeFields.'+i+'.multiplicityItems.'+j"></df-composite-field>
|
||||
[pathName]="pathName+'.compositeFields.'+i+'.multiplicityItems.'+j"></df-composite-field>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -16,10 +16,10 @@ export class CompositeField extends BaseModel implements Serializable<CompositeF
|
|||
this.fields = new JsonSerializer<Field>().fromJSONArray(item.fields, Field);
|
||||
this.ordinal = item.ordinal;
|
||||
this.id = item.id;
|
||||
//this.multiplicity = new JsonSerializer<Multiplicity>().fromJSONObject(item.multiplicity, Multiplicity);
|
||||
this.multiplicity = new Multiplicity();
|
||||
this.multiplicity = new JsonSerializer<Multiplicity>().fromJSONObject(item.multiplicity, Multiplicity);
|
||||
//this.multiplicity = new Multiplicity();
|
||||
//this.multiplicity.max = 2;
|
||||
this.multiplicityItems = new JsonSerializer<CompositeField>().fromJSONArray(item.multiplicityItems, CompositeField);
|
||||
if(item.multiplicityItems)this.multiplicityItems = new JsonSerializer<CompositeField>().fromJSONArray(item.multiplicityItems, CompositeField);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
|
|
@ -29,12 +29,12 @@ export class Field extends BaseModel implements Serializable<Field>, FormGenerat
|
|||
this.viewStyle = item.viewStyle;
|
||||
this.defaultVisibility = item.defaultVisibility;
|
||||
this.page = item.page;
|
||||
//this.multiplicity = new JsonSerializer<Multiplicity>().fromJSONObject(item.multiplicity, Multiplicity);
|
||||
this.multiplicity = new JsonSerializer<Multiplicity>().fromJSONObject(item.multiplicity, Multiplicity);
|
||||
this.defaultValue = new JsonSerializer<DefaultValue>().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<Field>().fromJSONArray(item.multiplicityItems, Field);
|
||||
if(item.multiplicityItems)this.multiplicityItems = new JsonSerializer<Field>().fromJSONArray(item.multiplicityItems, Field);
|
||||
this.data = item.data;
|
||||
return this;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue