From 13c9cb56c7d15ef054c871ee5521f08c3cfd2ff5 Mon Sep 17 00:00:00 2001 From: Gerard Date: Thu, 5 Apr 2018 11:09:22 +0200 Subject: [PATCH] Arreglado bug revision --- client/ticket/src/locale/es.yml | 1 - client/ticket/src/tracking/edit/edit.js | 8 +++++--- services/loopback/common/locale/en.json | 4 +++- services/loopback/common/locale/es.json | 3 ++- services/ticket/common/models/ticketTracking.js | 2 ++ 5 files changed, 12 insertions(+), 6 deletions(-) diff --git a/client/ticket/src/locale/es.yml b/client/ticket/src/locale/es.yml index dafc3ca1c..3d996caab 100644 --- a/client/ticket/src/locale/es.yml +++ b/client/ticket/src/locale/es.yml @@ -25,7 +25,6 @@ Package type: Tipo de porte Price: Precio Quantity: Cantidad Sale: Lineas del pedido -Sale Checked: Control clientes Shipment: Salida Next: Siguiente Some fields are invalid: Algunos campos no son válidos diff --git a/client/ticket/src/tracking/edit/edit.js b/client/ticket/src/tracking/edit/edit.js index 2d1f5e5a0..6b92f48ff 100644 --- a/client/ticket/src/tracking/edit/edit.js +++ b/client/ticket/src/tracking/edit/edit.js @@ -1,9 +1,11 @@ import ngModule from '../../module'; -export default class Controller { - constructor($scope, $state) { +class Controller { + constructor($scope, $state, vnApp, $translate) { this.$ = $scope; this.$state = $state; + this.vnApp = vnApp; + this.$translate = $translate; this.ticket = { ticketFk: $state.params.id, text: null @@ -17,7 +19,7 @@ export default class Controller { ); } } -Controller.$inject = ['$scope', '$state']; +Controller.$inject = ['$scope', '$state', 'vnApp', '$translate']; ngModule.component('vnTicketTrackingEdit', { template: require('./edit.html'), diff --git a/services/loopback/common/locale/en.json b/services/loopback/common/locale/en.json index cd258a4b6..cd329536f 100644 --- a/services/loopback/common/locale/en.json +++ b/services/loopback/common/locale/en.json @@ -9,5 +9,7 @@ "Quantity cannot be zero": "Quantity cannot be zero", "can't be blank": "can't be blank", "DNI Incorrecto": "DNI Incorrecto", - "El NIF/CIF debe ser único": "El NIF/CIF debe ser único" + "El NIF/CIF debe ser único": "El NIF/CIF debe ser único", + "State cannot be blank": "State cannot be blank", + "La razón social debe ser única": "La razón social debe ser única" } \ No newline at end of file diff --git a/services/loopback/common/locale/es.json b/services/loopback/common/locale/es.json index 4c2c33c60..0e72c14f6 100644 --- a/services/loopback/common/locale/es.json +++ b/services/loopback/common/locale/es.json @@ -10,5 +10,6 @@ "Ya existe un usuario con ese nombre": "Ya existe un usuario con ese nombre", "is invalid": "is invalid", "Enter an integer different to zero": "Introduce un entero distinto de cero", - "Package cannot be blank": "Package cannot be blank" + "Package cannot be blank": "Package cannot be blank", + "State cannot be blank": "El estado no puede estar en blanco" } \ No newline at end of file diff --git a/services/ticket/common/models/ticketTracking.js b/services/ticket/common/models/ticketTracking.js index 91f890af5..248b5e281 100644 --- a/services/ticket/common/models/ticketTracking.js +++ b/services/ticket/common/models/ticketTracking.js @@ -1,6 +1,8 @@ module.exports = function(Self) { require('../methods/ticketTracking/filter')(Self); + Self.validatesPresenceOf('stateFk', {message: 'State cannot be blank'}); + Self.observe('before save', function(ctx, next) { let token = ctx.options.accessToken; let userId = token && token.userId;