Skip to content
Snippets Groups Projects
Commit 2c64f9f9 authored by Florent Poittevin's avatar Florent Poittevin
Browse files

fix: deposit async validation on field that doesn't have other validation

parent c8e5ada0
No related branches found
No related tags found
No related merge requests found
...@@ -88,9 +88,7 @@ ...@@ -88,9 +88,7 @@
"builder": "@angular-devkit/build-angular:dev-server", "builder": "@angular-devkit/build-angular:dev-server",
"options": { "options": {
"browserTarget": "DLCM-Frontend:build", "browserTarget": "DLCM-Frontend:build",
"vendorSourceMap": true,
"sourceMap": { "sourceMap": {
"hidden": true,
"scripts": true, "scripts": true,
"styles": true, "styles": true,
"vendor": true "vendor": true
......
...@@ -8,7 +8,8 @@ ...@@ -8,7 +8,8 @@
{{orgUnit.name}} {{orgUnit.name}}
</mat-option> </mat-option>
</mat-select> </mat-select>
<mat-error *ngIf="getFormControl(formDefinition.organizationalUnitId).invalid">{{'required' | translate}}</mat-error> <mat-error
*ngIf="getFormControl(formDefinition.organizationalUnitId).invalid && getFormControl(formDefinition.organizationalUnitId).getError('required')">{{'required' | translate}}</mat-error>
<mat-error *ngFor="let error of getFormControl(formDefinition.organizationalUnitId).errors?.errorsFromBackend">{{error}}</mat-error> <mat-error *ngFor="let error of getFormControl(formDefinition.organizationalUnitId).errors?.errorsFromBackend">{{error}}</mat-error>
</mat-form-field> </mat-form-field>
...@@ -18,7 +19,8 @@ ...@@ -18,7 +19,8 @@
[placeholder]="'deposit.title' | translate" [placeholder]="'deposit.title' | translate"
[required]="isRequired(formDefinition.title)" [required]="isRequired(formDefinition.title)"
> >
<mat-error *ngIf="getFormControl(formDefinition.title).invalid">{{'required' | translate}}</mat-error> <mat-error
*ngIf="getFormControl(formDefinition.title).invalid && getFormControl(formDefinition.title).getError('required')">{{'required' | translate}}</mat-error>
<mat-error *ngFor="let error of getFormControl(formDefinition.title).errors?.errorsFromBackend">{{error}}</mat-error> <mat-error *ngFor="let error of getFormControl(formDefinition.title).errors?.errorsFromBackend">{{error}}</mat-error>
<!-- <solidify-field-error *ngIf="getFormControl(formDefinition.title) as formControl" [detectChange]="formControl.errors" [formControl]="formControl"></solidify-field-error>--> <!-- <solidify-field-error *ngIf="getFormControl(formDefinition.title) as formControl" [detectChange]="formControl.errors" [formControl]="formControl"></solidify-field-error>-->
</mat-form-field> </mat-form-field>
...@@ -50,8 +52,8 @@ ...@@ -50,8 +52,8 @@
[required]="isRequired(formDefinition.publicationDate)"> [required]="isRequired(formDefinition.publicationDate)">
<mat-datepicker-toggle matSuffix [for]="publicationDateDatepicker"></mat-datepicker-toggle> <mat-datepicker-toggle matSuffix [for]="publicationDateDatepicker"></mat-datepicker-toggle>
<mat-datepicker #publicationDateDatepicker></mat-datepicker> <mat-datepicker #publicationDateDatepicker></mat-datepicker>
<mat-error *ngIf="getFormControl(formDefinition.title).invalid">{{'required' | translate}}</mat-error> <mat-error *ngIf="getFormControl(formDefinition.publicationDate).invalid">{{'required' | translate}}</mat-error>
<mat-error *ngFor="let error of getFormControl(formDefinition.title).errors?.errorsFromBackend">{{error}}</mat-error> <mat-error *ngFor="let error of getFormControl(formDefinition.publicationDate).errors?.errorsFromBackend">{{error}}</mat-error>
</mat-form-field> </mat-form-field>
<mat-form-field> <mat-form-field>
...@@ -72,9 +74,9 @@ ...@@ -72,9 +74,9 @@
[placeholder]="'deposit.collectionEnd' | translate"> [placeholder]="'deposit.collectionEnd' | translate">
<mat-datepicker-toggle matSuffix [for]="collectionEndDatepicker"></mat-datepicker-toggle> <mat-datepicker-toggle matSuffix [for]="collectionEndDatepicker"></mat-datepicker-toggle>
<mat-datepicker #collectionEndDatepicker></mat-datepicker> <mat-datepicker #collectionEndDatepicker></mat-datepicker>
<mat-error *ngIf="getFormControl(formDefinition.collectionEnd).invalid">{{'required' | translate}}</mat-error> <mat-error
*ngIf="getFormControl(formDefinition.collectionEnd).invalid && getFormControl(formDefinition.collectionEnd).getError('required')">{{'required' | translate}}</mat-error>
<mat-error *ngFor="let error of getFormControl(formDefinition.collectionEnd).errors?.errorsFromBackend">{{error}}</mat-error> <mat-error *ngFor="let error of getFormControl(formDefinition.collectionEnd).errors?.errorsFromBackend">{{error}}</mat-error>
<!-- {{getFormControl(formDefinition.collectionEnd).errors | json}}-->
</mat-form-field> </mat-form-field>
<dlcm-shared-multi-select [list]="listPersons" <dlcm-shared-multi-select [list]="listPersons"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment