progress bar, comment field

This commit is contained in:
annampak 2018-01-11 18:14:23 +02:00
parent 91eecde080
commit d621ef687d
6 changed files with 14 additions and 15 deletions

View File

@ -18,7 +18,7 @@ export class RestBase {
/*
*/
protocol: string = "http";
hostname: string = "192.168.32.171";
hostname: string = "192.168.32.96";
port: number = 8080;
webappname: string = "";
restpath: string = "";

View File

@ -35,5 +35,5 @@ mat-row:hover {
// }
mat-row:nth-child(odd){
background-color: #f1f1f1;
background-color:#eef0fb;
}

View File

@ -23,16 +23,6 @@ export class DynamicFormCompositeFieldComponent implements OnInit {
ngOnInit() {
console.log(this.form);
if (this.compositeField.hasCommentField == true) {
let newfield: Field = new Field();
newfield.id = 'comment_' + this.compositeField.id;
newfield.data = {label: "Comments"};
newfield.viewStyle = {renderStyle: 'freetext', cssClass: ''};
newfield.validations = ["None"]
this.compositeField.fields.push(newfield);
(<FormArray>this.form.get("fields")).push(newfield.buildForm());
}
}
addMultipleField(fieldIndex: number) {

View File

@ -38,7 +38,7 @@
<mat-expansion-panel expanded=true>
<mat-expansion-panel-header>
<mat-panel-title>
{{path}} {{section.title}}
{{path}} {{section.title}}
</mat-panel-title>
<mat-panel-description>
<h3 *ngIf="section.description">{{section.description}}</h3>
@ -65,6 +65,12 @@
[pathName]="pathName+'.compositeFields.'+i+'.multiplicityItems.'+j"></df-composite-field>
</div>
</div>
<div *ngIf="compositeField.hasCommentField">
<mat-form-field>
<input matInput formControlName="commentFieldValue" placeholder="comment">
</mat-form-field>
</div>
</div>
<div *ngIf="section.sections">

View File

@ -44,7 +44,7 @@ export class ProgressBarComponent implements OnInit {
value += this.countFormControlsWithValue(<FormGroup>formArray.get("" + i))
}
}
else if (key === "value" && control.value != null) value++;
else if (key === "value" && control.value != null && control.value != "") value++;
});
return value;
}

View File

@ -14,6 +14,7 @@ export class CompositeField extends BaseModel implements Serializable<CompositeF
public description: string
public extendedDescription: string
public hasCommentField: boolean;
public commentFieldValue: string;
fromJSONObject(item: any): CompositeField {
@ -24,6 +25,7 @@ export class CompositeField extends BaseModel implements Serializable<CompositeF
this.description = item.description;
this.extendedDescription = item.extendedDescription;
this.hasCommentField = item.hasCommentField;
this.commentFieldValue = item.commentFieldValue;
this.multiplicity = JsonSerializer.fromJSONObject(item.multiplicity, Multiplicity);
//this.multiplicity = new Multiplicity();
//this.multiplicity.max = 2;
@ -38,7 +40,8 @@ export class CompositeField extends BaseModel implements Serializable<CompositeF
title: this.title,
description: this.description,
extendedDescription: this.extendedDescription,
hasCommentField: this.hasCommentField
hasCommentField: this.hasCommentField,
commentFieldValue: this.commentFieldValue
});
let fieldsFormArray = new Array<FormGroup>();