mirror of
https://framagit.org/framasoft/framadate/funky-framadate-front.git
synced 2023-08-25 13:53:14 +02:00
debug error messages validation form
This commit is contained in:
parent
7b82b5506d
commit
54f9e22070
@ -29,7 +29,7 @@ export class AdminConsultationComponent implements OnInit {
|
||||
this._Activatedroute.paramMap.subscribe((params: ParamMap) => {
|
||||
this.admin_key = params.get('admin_key');
|
||||
if (!this.admin_key) {
|
||||
this.router.navigate('page-not-found');
|
||||
this.router.navigate(['page-not-found']);
|
||||
}
|
||||
this.apiService.getPollByAdminKey(this.admin_key).then(
|
||||
(res) => {
|
||||
@ -41,7 +41,7 @@ export class AdminConsultationComponent implements OnInit {
|
||||
},
|
||||
(err) => {
|
||||
if (!this.admin_key) {
|
||||
this.router.navigate('page-not-found');
|
||||
this.router.navigate(['page-not-found']);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
@ -1,5 +1,6 @@
|
||||
<div
|
||||
class="validation-error-list padded"
|
||||
*ngIf="(form.valid && !hide_on_valid) || !form.valid"
|
||||
[ngClass]="{ 'has-background-warning': totalErrors > 0, 'has-background-success': totalErrors === 0 }"
|
||||
>
|
||||
<h1 class="title is-1">
|
||||
@ -24,4 +25,10 @@
|
||||
{{ m }}
|
||||
</li>
|
||||
</ul>
|
||||
<div class="debug" *ngIf="!environment.production">
|
||||
<pre>
|
||||
{{ messages | json }}
|
||||
</pre
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1,6 +1,7 @@
|
||||
import { Component, Inject, Input, OnInit } from '@angular/core';
|
||||
import { FormGroup, ValidationErrors } from '@angular/forms';
|
||||
import { DOCUMENT } from '@angular/common';
|
||||
import { environment } from '../../../../../../../environments/environment';
|
||||
|
||||
@Component({
|
||||
selector: 'app-errors-list',
|
||||
@ -12,6 +13,8 @@ export class ErrorsListComponent implements OnInit {
|
||||
public totalErrors = 0;
|
||||
public firstErrorId = '';
|
||||
public messages = [];
|
||||
public hide_on_valid = true;
|
||||
public environment = environment;
|
||||
|
||||
constructor(@Inject(DOCUMENT) private document: any) {}
|
||||
|
||||
|
@ -146,6 +146,7 @@
|
||||
"lang": "Sélectionner la langue"
|
||||
},
|
||||
"validation": {
|
||||
"required": "champ requis",
|
||||
"You must enter a value": "You must enter a EEEE"
|
||||
},
|
||||
"You must enter a value": "You must enter a valueeeeeeee",
|
||||
|
Loading…
Reference in New Issue
Block a user