minor fixes

This commit is contained in:
annampak 2017-12-07 15:44:17 +02:00
parent 95c5dd4a60
commit e04c90dd2b
7 changed files with 19 additions and 11 deletions

View File

@ -15,7 +15,7 @@
<label>View style</label>
<select class="form-control" formControlName="renderStyle">
<option value="textarea">textarea</option>
<option value="booleanDesicion">booleanDesicion</option>
<option value="booleanDecision">booleanDecision</option>
<option value='combobox'>combobox</option>
<option value="checkBox">checkBox</option>
<option value="freetext">freetext</option>

View File

@ -16,10 +16,9 @@ export class FieldFormComponent {
@Input() form: FormGroup;
@Input() dataModel: Field;
constructon(){}
constructor(){}
ngOnInit(){
console.log("init field")
ngOnInit(){
// this.addNewRule();
}

View File

@ -59,14 +59,17 @@ export class FormComponent {
(<FormArray>this.form.get("sections")).removeAt(index)
}
updateForm(data) {
createForm(data) {
return this.restBase.post("/admin/addDmp", data);
}
updateForm(id,data) {
return this.restBase.post("/admin/addDmp/"+id, data);
}
onSubmit() {
debugger;
let data = this.form.value;
this.updateForm(data).subscribe();
if(this.profileID) this.updateForm(this.profileID, data).subscribe();
else this.createForm(data).subscribe();
}
}

View File

@ -34,7 +34,7 @@ export class Field extends BaseModel implements Serializable<Field>,FormGenerato
this.defaultValue = new JsonSerializer<DefaultValue>().fromJSONObject(item.defaultValue, DefaultValue);
this.description = item.description;
this.extendedDescription = item.extendedDescription;
this.defaultVisibility = item.defaultVisibility;
this.defaultVisibility = item.defaultVisibility ? item.defaultVisibility : true;
this.page = item.page;
this.multiplicity = new JsonSerializer<Multiplicity>().fromJSONObject(item.multiplicity, Multiplicity);
this.ordinal = item.ordinal;
@ -70,6 +70,8 @@ export class Field extends BaseModel implements Serializable<Field>,FormGenerato
//formGroup.addControl("data",this.data? this.data.buildForm():this.formBuilder.group({}));
if(this.data)formGroup.addControl("data",this.data.buildForm());
if( !formGroup.controls["defaultVisibility"].value) formGroup.controls["defaultVisibility"].setValue(true);
return formGroup;
}
}

View File

@ -52,6 +52,8 @@ export class FieldGroup extends BaseModel implements Serializable<FieldGroup>, F
})
}
formGroup.addControl('compositeFields', this.formBuilder.array(compositeFieldsFormArray));
if( !formGroup.controls["defaultVisibility"].value) formGroup.controls["defaultVisibility"].setValue(true);
return formGroup;
}

View File

@ -49,7 +49,10 @@ export class Section extends BaseModel implements Serializable<Section>, FormGen
formGroup.addControl('id', new FormControl(this.id));
formGroup.addControl('title', new FormControl(this.title));
formGroup.addControl('description', new FormControl(this.description));
formGroup.addControl('ordinal', new FormControl(this.ordinal));
formGroup.addControl('ordinal', new FormControl(this.ordinal));
if( !formGroup.controls["defaultVisibility"].value) formGroup.controls["defaultVisibility"].setValue(true);
return formGroup;
}
}

View File

@ -13,7 +13,6 @@ export class RuleFormComponent {
@Input() dataModel: FormGroup;
TargetValidation(){
debugger;
}
}