From 688881fac41a4018ebf187fc3b71e2030220853d Mon Sep 17 00:00:00 2001 From: Juan Date: Tue, 27 Feb 2018 13:28:07 +0100 Subject: [PATCH] Bug #97 - Show dash when no secured credit --- client/client/src/descriptor/descriptor.html | 10 ++++++---- client/client/src/descriptor/style.scss | 2 +- services/loopback/common/validations/validateDni.js | 10 +++++----- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/client/client/src/descriptor/descriptor.html b/client/client/src/descriptor/descriptor.html index e9b776ecd..3d2d5b504 100644 --- a/client/client/src/descriptor/descriptor.html +++ b/client/client/src/descriptor/descriptor.html @@ -5,16 +5,18 @@
{{$ctrl.client.name}}
- Id {{$ctrl.client.id}} + Id {{$ctrl.client.id}}
- Phone {{$ctrl.client.phone | phone}} + Phone {{$ctrl.client.phone | phone}}
- Credit {{$ctrl.client.credit | number:2}}€ + Credit {{$ctrl.client.credit | currency:'€':2}}
- Secured credit {{$ctrl.client.creditInsurance || 0 | number:2}}€ + Secured credit + {{$ctrl.client.creditInsurance | currency:'€':2}} + -
diff --git a/client/client/src/descriptor/style.scss b/client/client/src/descriptor/style.scss index b702e945c..ec646d950 100644 --- a/client/client/src/descriptor/style.scss +++ b/client/client/src/descriptor/style.scss @@ -1,5 +1,5 @@ vn-client-descriptor { - .data span { + .data .label { font-size: .9em; color: #666; } diff --git a/services/loopback/common/validations/validateDni.js b/services/loopback/common/validations/validateDni.js index 0cb6cfe6b..8a313c278 100644 --- a/services/loopback/common/validations/validateDni.js +++ b/services/loopback/common/validations/validateDni.js @@ -13,7 +13,7 @@ module.exports = fiWithCountry => { let validators = { es: { - regExp: /^ES[A-Z0-9]\d{7}[A-Z0-9]$/, + regExp: /^[A-Z0-9]\d{7}[A-Z0-9]$/, validate: () => { let isCif = /[A-W]/.test(fi.charAt(0)); let lastDigit = fi.charAt(len - 1); @@ -55,13 +55,13 @@ module.exports = fiWithCountry => { } }, pt: { - regExp: /^PT\d{9}$/ + regExp: /^\d{9}$/ }, fr: { - regExp: /^FR[A-Z0-9]{2}\d{9}$/ + regExp: /^[A-Z0-9]{2}\d{9}$/ }, it: { - regExp: /^IT\d{11}$/ + regExp: /^\d{11}$/ } }; @@ -70,6 +70,6 @@ module.exports = fiWithCountry => { if (!validator) return false; - return validator.regExp.test(fiWithCountry) + return validator.regExp.test(fi) && (!validator.validate || validator.validate()); };