From 87f125453d976fbaf9382f0f3a6aaaf484660b35 Mon Sep 17 00:00:00 2001 From: carlossa Date: Fri, 14 Jul 2023 13:35:13 +0200 Subject: [PATCH] refs #5640 fix mayus quit function --- loopback/locale/es.json | 6 ++++-- modules/client/back/models/client.js | 14 ++++++++++++++ modules/client/front/fiscal-data/index.html | 4 ++-- modules/client/front/fiscal-data/index.js | 6 ------ 4 files changed, 20 insertions(+), 10 deletions(-) diff --git a/loopback/locale/es.json b/loopback/locale/es.json index 784ff5e6e..55a7e2f82 100644 --- a/loopback/locale/es.json +++ b/loopback/locale/es.json @@ -305,5 +305,7 @@ "The renew period has not been exceeded": "El periodo de renovación no ha sido superado", "Valid priorities": "Prioridades válidas: %d", "Negative basis of tickets": "Base negativa para los tickets: {{ticketsIds}}", - "You cannot assign an alias that you are not assigned to": "No puede asignar un alias que no tenga asignado" -} + "You cannot assign an alias that you are not assigned to": "No puede asignar un alias que no tenga asignado", + "Social name should be uppercase": "Social name should be uppercase", + "Street should be uppercase": "Street should be uppercase" +} \ No newline at end of file diff --git a/modules/client/back/models/client.js b/modules/client/back/models/client.js index ca279ef71..9302d81c7 100644 --- a/modules/client/back/models/client.js +++ b/modules/client/back/models/client.js @@ -36,6 +36,20 @@ module.exports = Self => { min: 3, max: 10 }); + Self.validatesFormatOf('street', { + message: 'Street should be uppercase', + allowNull: false, + allowBlank: false, + with: /^[^a-z]*$/ + }); + + Self.validatesFormatOf('socialName', { + message: 'Social name should be uppercase', + allowNull: false, + allowBlank: false, + with: /^[^a-z]*$/ + }); + Self.validateAsync('socialName', socialNameIsUnique, { message: 'The company name must be unique' }); diff --git a/modules/client/front/fiscal-data/index.html b/modules/client/front/fiscal-data/index.html index 4d001e226..d1de87309 100644 --- a/modules/client/front/fiscal-data/index.html +++ b/modules/client/front/fiscal-data/index.html @@ -33,7 +33,7 @@ ng-model="$ctrl.client.socialName" info="Only letters, numbers and spaces can be used" required="true" - ng-keyup="$ctrl.mayus($event)" + ng-keyup="$ctrl.client.socialName = $ctrl.client.socialName.toUpperCase()" rule> diff --git a/modules/client/front/fiscal-data/index.js b/modules/client/front/fiscal-data/index.js index 1599c917b..acad38185 100644 --- a/modules/client/front/fiscal-data/index.js +++ b/modules/client/front/fiscal-data/index.js @@ -177,12 +177,6 @@ export default class Controller extends Section { this.client.provinceFk = response.provinceFk; this.client.countryFk = response.countryFk; } - - mayus(event) { - let input = event.target; - let inputValue = input.value; - input.value = inputValue.toUpperCase(); - } } ngModule.vnComponent('vnClientFiscalData', {