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> <label>View style</label>
<select class="form-control" formControlName="renderStyle"> <select class="form-control" formControlName="renderStyle">
<option value="textarea">textarea</option> <option value="textarea">textarea</option>
<option value="booleanDesicion">booleanDesicion</option> <option value="booleanDecision">booleanDecision</option>
<option value='combobox'>combobox</option> <option value='combobox'>combobox</option>
<option value="checkBox">checkBox</option> <option value="checkBox">checkBox</option>
<option value="freetext">freetext</option> <option value="freetext">freetext</option>

View File

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

View File

@ -59,14 +59,17 @@ export class FormComponent {
(<FormArray>this.form.get("sections")).removeAt(index) (<FormArray>this.form.get("sections")).removeAt(index)
} }
updateForm(data) { createForm(data) {
return this.restBase.post("/admin/addDmp", data); return this.restBase.post("/admin/addDmp", data);
} }
updateForm(id,data) {
return this.restBase.post("/admin/addDmp/"+id, data);
}
onSubmit() { onSubmit() {
debugger;
let data = this.form.value; 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.defaultValue = new JsonSerializer<DefaultValue>().fromJSONObject(item.defaultValue, DefaultValue);
this.description = item.description; this.description = item.description;
this.extendedDescription = item.extendedDescription; this.extendedDescription = item.extendedDescription;
this.defaultVisibility = item.defaultVisibility; this.defaultVisibility = item.defaultVisibility ? item.defaultVisibility : true;
this.page = item.page; this.page = item.page;
this.multiplicity = new JsonSerializer<Multiplicity>().fromJSONObject(item.multiplicity, Multiplicity); this.multiplicity = new JsonSerializer<Multiplicity>().fromJSONObject(item.multiplicity, Multiplicity);
this.ordinal = item.ordinal; 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({})); //formGroup.addControl("data",this.data? this.data.buildForm():this.formBuilder.group({}));
if(this.data)formGroup.addControl("data",this.data.buildForm()); if(this.data)formGroup.addControl("data",this.data.buildForm());
if( !formGroup.controls["defaultVisibility"].value) formGroup.controls["defaultVisibility"].setValue(true);
return formGroup; return formGroup;
} }
} }

View File

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

View File

@ -50,6 +50,9 @@ export class Section extends BaseModel implements Serializable<Section>, FormGen
formGroup.addControl('title', new FormControl(this.title)); formGroup.addControl('title', new FormControl(this.title));
formGroup.addControl('description', new FormControl(this.description)); 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; return formGroup;
} }
} }

View File

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