no message
This commit is contained in:
parent
abc114b8ab
commit
997d4b61da
|
@ -52,9 +52,7 @@
|
|||
|
||||
|
||||
<div [hidden]="isValid">
|
||||
<mat-error *ngIf="isValidRequired">
|
||||
The field "{{field.title}}" <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="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>
|
||||
|
|
|
@ -1,12 +1,17 @@
|
|||
<div [id]="compositeField.id" [formGroup]="form">
|
||||
|
||||
<div *ngIf="compositeField.fields.length == 1" class="fieldset-component">
|
||||
<h5 *ngIf="compositeField.title">{{compositeField.title}}</h5>
|
||||
<div class="content-left-margin">
|
||||
<h5 *ngIf="compositeField.description">{{compositeField.description}}</h5>
|
||||
<h5 *ngIf="compositeField.extendedDescription" class="fieldset-extended-desc">
|
||||
<i>{{compositeField.extendedDescription}}</i>
|
||||
</h5>
|
||||
<df-field *ngIf="compositeField.fields.length == 1" [field]="compositeField.fields[0]" [form]="form.get('fields').get(''+0)"
|
||||
[pathName]="pathName+'.fields.'+0"></df-field>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div *ngIf="compositeField.fields.length > 1" class="fieldset-component">
|
||||
<h5 *ngIf="compositeField.title">{{compositeField.title}}</h5>
|
||||
|
|
|
@ -2,6 +2,7 @@ import { VisibilityRulesService } from '../../visibility-rules/visibility-rules.
|
|||
import { FormGroup, Form, FormArray } from '@angular/forms';
|
||||
import { Component, Input, OnInit, ViewEncapsulation } from '@angular/core';
|
||||
import { CompositeField } from '../../models/CompositeField';
|
||||
import { Section } from '@app/models/Section';
|
||||
|
||||
|
||||
@Component({
|
||||
|
|
|
@ -22,6 +22,7 @@ export class Field extends BaseModel implements Serializable<Field>, FormGenerat
|
|||
public multiplicityItems: Array<Field> = new Array<Field>();
|
||||
public data: any;
|
||||
public validations: Array<any>;//Array<ValidationTypes>
|
||||
public validationRequired = false;
|
||||
|
||||
fromJSONObject(item: any): Field {
|
||||
this.id = item.id;
|
||||
|
@ -47,18 +48,16 @@ export class Field extends BaseModel implements Serializable<Field>, FormGenerat
|
|||
|
||||
|
||||
buildForm(): FormGroup {
|
||||
let validationRequired = "false";
|
||||
if(this.validations)
|
||||
this.validations.forEach(validation => {
|
||||
if (validation == "REQUIRED")
|
||||
{validationRequired = "true";}
|
||||
if (validation == ValidationTypes.Required ) this.validationRequired = true;
|
||||
});
|
||||
|
||||
let formGroup = this.formBuilder.group({
|
||||
id: [this.id],
|
||||
data:[this.data],
|
||||
/* title: [this.title], */
|
||||
value: [this.value, validationRequired == "true"? Validators.required:null]/* ,
|
||||
value: [this.value, this.validationRequired == true? Validators.required:null]/* ,
|
||||
description: [this.description],
|
||||
extendedDescription:[this.extendedDescription],
|
||||
viewStyle: [this.viewStyle],
|
||||
|
|
Loading…
Reference in New Issue