From 7cf2ac0e3e59e6408580c208ff48996e909316e4 Mon Sep 17 00:00:00 2001 From: Pablo Bonilla Date: Sun, 1 Aug 2021 20:17:50 -0600 Subject: [PATCH] Fix survey template register validations --- .../plantilla/list/plantilla.component.html | 30 ++++++++++++++++--- .../plantilla/list/plantilla.component.ts | 8 ++--- src/main/webapp/i18n/es/global.json | 3 +- 3 files changed, 32 insertions(+), 9 deletions(-) diff --git a/src/main/webapp/app/entities/plantilla/list/plantilla.component.html b/src/main/webapp/app/entities/plantilla/list/plantilla.component.html index 400e2c0..565edfe 100644 --- a/src/main/webapp/app/entities/plantilla/list/plantilla.component.html +++ b/src/main/webapp/app/entities/plantilla/list/plantilla.component.html @@ -26,9 +26,9 @@ - +
No templates found @@ -56,7 +56,8 @@ {{ plantilla.fechaPublicacionTienda | formatShortDatetime | titlecase }} No establecida {{ plantilla.estado }} - {{ plantilla.precio | currency: 'USD':'symbol-narrow' }} + ${{ plantilla.precio | number: '1.2' }} + Gratis {{ plantilla.categoria?.nombre }}
@@ -168,7 +169,7 @@
- +
+ This field should be great than or equals to 0. +
@@ -207,6 +215,20 @@ {{ categoriaOption.nombre }} +
+ + This field is required. + +
diff --git a/src/main/webapp/app/entities/plantilla/list/plantilla.component.ts b/src/main/webapp/app/entities/plantilla/list/plantilla.component.ts index dc1f19f..9145186 100644 --- a/src/main/webapp/app/entities/plantilla/list/plantilla.component.ts +++ b/src/main/webapp/app/entities/plantilla/list/plantilla.component.ts @@ -33,10 +33,10 @@ export class PlantillaComponent implements OnInit { templateCreateForm = this.fb.group({ id: [], - nombre: [null, [Validators.minLength(1), Validators.maxLength(50)]], - descripcion: [], - precio: [null, [Validators.required]], - categoria: [], + nombre: [null, [Validators.required, Validators.minLength(1), Validators.maxLength(50)]], + descripcion: [[Validators.required]], + precio: [null, [Validators.required, Validators.min(0)]], + categoria: [null, [Validators.required]], }); constructor( diff --git a/src/main/webapp/i18n/es/global.json b/src/main/webapp/i18n/es/global.json index 42d43b3..02866f3 100644 --- a/src/main/webapp/i18n/es/global.json +++ b/src/main/webapp/i18n/es/global.json @@ -151,7 +151,8 @@ "pattern": "Este campo debe seguir el patrón {{pattern}}.", "number": "Este campo debe ser un número.", "integerNumber": "Este campo debe ser un número entero.", - "datetimelocal": "Este campo debe ser una fecha y hora." + "datetimelocal": "Este campo debe ser una fecha y hora.", + "minoigual": "Este campo debe ser mayor o igual que 0." }, "publish": { "title": "Publicar encuesta",