no message
This commit is contained in:
parent
b72ed6eae9
commit
556b1706d6
|
@ -1,44 +1,60 @@
|
||||||
package eu.eudat.models.properties;
|
package eu.eudat.models.properties;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.*;
|
||||||
import java.util.LinkedList;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
public class FieldSet implements PropertiesGenerator{
|
public class FieldSet implements PropertiesGenerator {
|
||||||
private List<Field> fields;
|
private String id;
|
||||||
private List<FieldSet> multiplicityItems;
|
private List<Field> fields;
|
||||||
|
private List<FieldSet> multiplicityItems;
|
||||||
|
private String commentFieldValue;
|
||||||
|
|
||||||
public List<FieldSet> getMultiplicityItems() {
|
public String getId() {
|
||||||
return multiplicityItems;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setMultiplicityItems(List<FieldSet> multiplicityItems) {
|
public void setId(String id) {
|
||||||
this.multiplicityItems = multiplicityItems;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Field> getFields() {
|
public String getCommentFieldValue() {
|
||||||
return fields;
|
return commentFieldValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setFields(List<Field> fields) {
|
public void setCommentFieldValue(String commentFieldValue) {
|
||||||
this.fields = fields;
|
this.commentFieldValue = commentFieldValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
public List<FieldSet> getMultiplicityItems() {
|
||||||
public void toMap(Map<String, Object> fieldValues) {
|
return multiplicityItems;
|
||||||
this.fields.forEach(item->item.toMap(fieldValues));
|
}
|
||||||
Map<String,Object> multiplicity = new HashMap<String,Object>();
|
|
||||||
if(this.multiplicityItems!=null){
|
|
||||||
this.multiplicityItems.forEach(item->item.toMap(fieldValues,this.multiplicityItems.indexOf(item)));
|
|
||||||
}
|
|
||||||
//fieldValues.put(this.id,multiplicity);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
public void setMultiplicityItems(List<FieldSet> multiplicityItems) {
|
||||||
public void toMap(Map<String, Object> fieldValues, int index) {
|
this.multiplicityItems = multiplicityItems;
|
||||||
this.fields.forEach(item->item.toMap(fieldValues,index));
|
}
|
||||||
//this.multiplicityItems.forEach(item->item.toMap(fieldValues,index));
|
|
||||||
}
|
public List<Field> getFields() {
|
||||||
|
return fields;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFields(List<Field> fields) {
|
||||||
|
this.fields = fields;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void toMap(Map<String, Object> fieldValues) {
|
||||||
|
fieldValues.put("commentFieldValue" + this.id, this.commentFieldValue);
|
||||||
|
this.fields.forEach(item -> item.toMap(fieldValues));
|
||||||
|
Map<String, Object> multiplicity = new HashMap<String, Object>();
|
||||||
|
if (this.multiplicityItems != null) {
|
||||||
|
this.multiplicityItems.forEach(item -> item.toMap(fieldValues, this.multiplicityItems.indexOf(item)));
|
||||||
|
}
|
||||||
|
//fieldValues.put(this.id,multiplicity);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void toMap(Map<String, Object> fieldValues, int index) {
|
||||||
|
this.fields.forEach(item -> item.toMap(fieldValues, index));
|
||||||
|
//this.multiplicityItems.forEach(item->item.toMap(fieldValues,index));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -135,6 +135,7 @@ public class FieldSet implements Comparable,PropertiesModelBuilder, ViewStyleDef
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void fromJsonObject(Map<String, Object> properties) {
|
public void fromJsonObject(Map<String, Object> properties) {
|
||||||
|
this.commentFieldValue = (String) properties.get("commentFieldValue"+this.id);
|
||||||
this.multiplicityItems = new LinkedList<FieldSet>();
|
this.multiplicityItems = new LinkedList<FieldSet>();
|
||||||
this.fields.forEach(item->{
|
this.fields.forEach(item->{
|
||||||
item.fromJsonObject(properties);
|
item.fromJsonObject(properties);
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
<mat-select formControlName="value">
|
<mat-select formControlName="value">
|
||||||
<mat-option *ngFor="let opt of field.data.options" [value]="opt.value">{{opt.label}}</mat-option>
|
<mat-option *ngFor="let opt of field.data.options" [value]="opt.value">{{opt.label}}</mat-option>
|
||||||
</mat-select>
|
</mat-select>
|
||||||
|
<mat-error *ngIf="form.get('value').errors?.required">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|
||||||
</div>
|
</div>
|
|
@ -12,6 +12,7 @@
|
||||||
<div *ngSwitchCase="'freetext'">
|
<div *ngSwitchCase="'freetext'">
|
||||||
<mat-form-field>
|
<mat-form-field>
|
||||||
<input matInput formControlName="value" placeholder="{{field.data.label}}">
|
<input matInput formControlName="value" placeholder="{{field.data.label}}">
|
||||||
|
<mat-error *ngIf="form.get('value').errors?.required">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -36,6 +37,7 @@
|
||||||
<button mat-button *ngIf="form.get('value').value" matSuffix mat-icon-button aria-label="Clear" (click)="this.form.patchValue({'value': ''})">
|
<button mat-button *ngIf="form.get('value').value" matSuffix mat-icon-button aria-label="Clear" (click)="this.form.patchValue({'value': ''})">
|
||||||
<mat-icon>close</mat-icon>
|
<mat-icon>close</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
|
<mat-error *ngIf="form.get('value').errors?.required">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -51,12 +53,12 @@
|
||||||
<div *ngSwitchCase="'label'"> </div>
|
<div *ngSwitchCase="'label'"> </div>
|
||||||
|
|
||||||
|
|
||||||
<div [hidden]="isValid">
|
<!--<div [hidden]="isValid">
|
||||||
<mat-error *ngIf="isValidRequired">The field "{{field.data.label}}" <strong>required</strong></mat-error>
|
<mat-error *ngIf="isValidRequired">The field "{{field.data.label}}" <strong>required</strong></mat-error>
|
||||||
<!-- <div class="invalid-feedbackCustom" *ngIf="isValidRequired">The field "{{field.label}}" is required</div> -->
|
<div class="invalid-feedbackCustom" *ngIf="isValidRequired">The field "{{field.label}}" is required</div>
|
||||||
<div class="invalid-feedbackCustom" *ngIf="isValidPattern">The field {{field.label}} must match a regular expression {{field.regex}}</div>
|
<div class="invalid-feedbackCustom" *ngIf="isValidPattern">The field {{field.label}} must match a regular expression {{field.regex}}</div>
|
||||||
<div class="invalid-feedbackCustom" *ngIf="isValidCustom">The field {{field.label}} custom Validation</div>
|
<div class="invalid-feedbackCustom" *ngIf="isValidCustom">The field {{field.label}} custom Validation</div>
|
||||||
</div>
|
</div>-->
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -13,9 +13,8 @@ import { Router, ActivatedRoute, ParamMap, Params } from '@angular/router';
|
||||||
import 'rxjs/add/operator/switchMap';
|
import 'rxjs/add/operator/switchMap';
|
||||||
import { Location } from '@angular/common';
|
import { Location } from '@angular/common';
|
||||||
import {MatSidenavModule} from '@angular/material/sidenav';
|
import {MatSidenavModule} from '@angular/material/sidenav';
|
||||||
import { BaseHttpService } from '@app/utilities/cite-http-service-module/base-http.service';
|
import { BaseHttpService } from '../utilities/cite-http-service-module/base-http.service';
|
||||||
import { HostConfiguration } from '@app/app.constants';
|
import { DatasetWizardService } from '../services/dataset-wizard/dataset-wizard.service';
|
||||||
import { DatasetWizardService } from '@app/services/dataset-wizard/dataset-wizard.service';
|
|
||||||
|
|
||||||
declare function simple_notifier(type: string, title: string, message: string): any;
|
declare function simple_notifier(type: string, title: string, message: string): any;
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ import { FormBuilder, FormControl, FormGroup } from '@angular/forms';
|
||||||
import { JsonSerializer } from '../utilities/JsonSerializer';
|
import { JsonSerializer } from '../utilities/JsonSerializer';
|
||||||
import { Serializable } from './interfaces/Serializable';
|
import { Serializable } from './interfaces/Serializable';
|
||||||
import { FieldGroup } from './FieldGroup';
|
import { FieldGroup } from './FieldGroup';
|
||||||
import { CompositeField } from '@app/models/CompositeField';
|
import { CompositeField } from './CompositeField';
|
||||||
|
|
||||||
export class Section extends BaseModel implements Serializable<Section>, FormGenerator<FormGroup>{
|
export class Section extends BaseModel implements Serializable<Section>, FormGenerator<FormGroup>{
|
||||||
public sections: Array<Section> = new Array<Section>();
|
public sections: Array<Section> = new Array<Section>();
|
||||||
|
|
Loading…
Reference in New Issue