From 05eea132cdb5a3a76898195aa539eb20abcfa330 Mon Sep 17 00:00:00 2001 From: Gerard Date: Wed, 27 Mar 2019 12:50:03 +0100 Subject: [PATCH 1/5] textfield oldValue now is called when it should --- front/core/components/textfield/textfield.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/front/core/components/textfield/textfield.js b/front/core/components/textfield/textfield.js index 88a585eda..8d2964b9b 100644 --- a/front/core/components/textfield/textfield.js +++ b/front/core/components/textfield/textfield.js @@ -15,7 +15,7 @@ export default class Textfield extends Input { this.hasMouseIn = false; this.input.addEventListener('keydown', () => { - if (!this.oldValue) + if (this.oldValue === undefined) this.saveOldValue(); }); this.input.addEventListener('keyup', e => { From 8110325af837fa544f146a4d19b706b73a541cd4 Mon Sep 17 00:00:00 2001 From: Joan Sanchez Date: Fri, 29 Mar 2019 07:29:09 +0100 Subject: [PATCH 2/5] send sms from ticket descriptor & ticket line #991 --- db/install/changes/00-smsConfig.sql | 1 - modules/client/front/index.js | 2 + modules/client/front/sms/index.html | 23 ++++++++++ modules/client/front/sms/index.js | 42 +++++++++++++++++++ modules/client/front/sms/index.spec.js | 34 +++++++++++++++ modules/client/front/sms/locale/es.yml | 4 ++ modules/client/front/sms/style.scss | 7 ++++ modules/ticket/front/card/index.js | 1 + modules/ticket/front/descriptor/index.html | 6 ++- modules/ticket/front/descriptor/index.js | 12 +++++- modules/ticket/front/descriptor/locale/en.yml | 3 ++ modules/ticket/front/descriptor/locale/es.yml | 5 ++- modules/ticket/front/sale/index.html | 4 ++ modules/ticket/front/sale/index.js | 23 +++++++++- modules/ticket/front/sale/index.spec.js | 20 ++++++++- modules/ticket/front/sale/locale/en.yml | 3 ++ modules/ticket/front/sale/locale/es.yml | 3 ++ 17 files changed, 187 insertions(+), 6 deletions(-) delete mode 100644 db/install/changes/00-smsConfig.sql create mode 100644 modules/client/front/sms/index.html create mode 100644 modules/client/front/sms/index.js create mode 100644 modules/client/front/sms/index.spec.js create mode 100644 modules/client/front/sms/locale/es.yml create mode 100644 modules/client/front/sms/style.scss create mode 100644 modules/ticket/front/descriptor/locale/en.yml create mode 100644 modules/ticket/front/sale/locale/en.yml diff --git a/db/install/changes/00-smsConfig.sql b/db/install/changes/00-smsConfig.sql deleted file mode 100644 index 7d2c6e1b7..000000000 --- a/db/install/changes/00-smsConfig.sql +++ /dev/null @@ -1 +0,0 @@ -INSERT INTO `vn`.`smsConfig` (`id`, `uri`, `user`, `password`, `title`) VALUES ('1', 'https://websms.xtratelecom.es/api_php/server.wsdl', 'FERRERTORIBIO', 'HERMANOS', 'Verdnatura'); diff --git a/modules/client/front/index.js b/modules/client/front/index.js index cf72ee0b2..b4166676b 100644 --- a/modules/client/front/index.js +++ b/modules/client/front/index.js @@ -34,3 +34,5 @@ import './sample/index'; import './sample/create'; import './web-payment'; import './log'; +import './sms'; + diff --git a/modules/client/front/sms/index.html b/modules/client/front/sms/index.html new file mode 100644 index 000000000..30bf2dcc8 --- /dev/null +++ b/modules/client/front/sms/index.html @@ -0,0 +1,23 @@ + + +
Send SMS
+ + + + + + + + +
+ + + + +
\ No newline at end of file diff --git a/modules/client/front/sms/index.js b/modules/client/front/sms/index.js new file mode 100644 index 000000000..03bafdec0 --- /dev/null +++ b/modules/client/front/sms/index.js @@ -0,0 +1,42 @@ +import ngModule from '../module'; +import Component from 'core/lib/component'; +import './style.scss'; + +class Controller extends Component { + constructor($element, $scope, $http, $translate, vnApp) { + super($element, $scope); + + this.$scope = $scope; + this.$http = $http; + this.$translate = $translate; + this.vnApp = vnApp; + } + + open() { + this.$scope.SMSDialog.show(); + } + + onResponse(response) { + if (response === 'ACCEPT') { + let params = { + recipient: this.sms.recipient, + message: this.sms.message + }; + this.$http.post(`/client/api/Sms/send`, params).then(res => { + this.vnApp.showMessage(this.$translate.instant('SMS sent!')); + + if (res.data) this.emit('send', {response: res.data}); + }); + } + } +} + +Controller.$inject = ['$element', '$scope', '$http', '$translate', 'vnApp']; + +ngModule.component('vnClientSms', { + template: require('./index.html'), + controller: Controller, + bindings: { + sms: '<', + } +}); diff --git a/modules/client/front/sms/index.spec.js b/modules/client/front/sms/index.spec.js new file mode 100644 index 000000000..e8f530025 --- /dev/null +++ b/modules/client/front/sms/index.spec.js @@ -0,0 +1,34 @@ +import './index'; + +describe('Client', () => { + describe('Component vnClientSms', () => { + let controller; + let $httpBackend; + let $element; + + beforeEach(ngModule('client')); + + beforeEach(angular.mock.inject(($componentController, _$httpBackend_) => { + $httpBackend = _$httpBackend_; + $element = angular.element(''); + controller = $componentController('vnClientSms', {$element}); + controller.client = {id: 101}; + })); + + describe('onResponse()', () => { + it('should perform a POST query and show a success snackbar', () => { + let params = {recipient: 111111111, message: 'My SMS'}; + controller.sms = {recipient: 111111111, message: 'My SMS'}; + + spyOn(controller.vnApp, 'showMessage'); + $httpBackend.when('POST', `/client/api/Sms/send`, params).respond(200, params); + $httpBackend.expect('POST', `/client/api/Sms/send`, params).respond(params); + + controller.onResponse('ACCEPT'); + $httpBackend.flush(); + + expect(controller.vnApp.showMessage).toHaveBeenCalledWith('SMS sent!'); + }); + }); + }); +}); diff --git a/modules/client/front/sms/locale/es.yml b/modules/client/front/sms/locale/es.yml new file mode 100644 index 000000000..28933f774 --- /dev/null +++ b/modules/client/front/sms/locale/es.yml @@ -0,0 +1,4 @@ +Send SMS: Enviar SMS +Recipient: Destinatario +Message: Mensaje +SMS sent!: ¡SMS enviado! \ No newline at end of file diff --git a/modules/client/front/sms/style.scss b/modules/client/front/sms/style.scss new file mode 100644 index 000000000..60a625880 --- /dev/null +++ b/modules/client/front/sms/style.scss @@ -0,0 +1,7 @@ +@import "variables"; + +vn-client-sms { + textarea { + height: 8em + } +} \ No newline at end of file diff --git a/modules/ticket/front/card/index.js b/modules/ticket/front/card/index.js index 776b450ca..9c1e45e78 100644 --- a/modules/ticket/front/card/index.js +++ b/modules/ticket/front/card/index.js @@ -7,6 +7,7 @@ class Controller { this.filter = { include: [ {relation: 'warehouse', scope: {fields: ['name']}}, + {relation: 'address'}, {relation: 'ship'}, {relation: 'agencyMode', scope: {fields: ['name']}}, {relation: 'stowaway'}, diff --git a/modules/ticket/front/descriptor/index.html b/modules/ticket/front/descriptor/index.html index 4521deb9d..41bcfec8b 100644 --- a/modules/ticket/front/descriptor/index.html +++ b/modules/ticket/front/descriptor/index.html @@ -177,4 +177,8 @@ - \ No newline at end of file + + + + + \ No newline at end of file diff --git a/modules/ticket/front/descriptor/index.js b/modules/ticket/front/descriptor/index.js index e85ed702b..a58d84c2a 100644 --- a/modules/ticket/front/descriptor/index.js +++ b/modules/ticket/front/descriptor/index.js @@ -13,7 +13,8 @@ class Controller { {callback: this.showRemoveStowaway, name: 'Remove stowaway', show: () => this.shouldShowRemoveStowaway()}, {callback: this.showDeliveryNote, name: 'Show Delivery Note', show: true}, {callback: this.showDeleteTicketDialog, name: 'Delete ticket', show: true}, - {callback: this.showChangeShipped, name: 'Change shipped hour', show: true} + {callback: this.showChangeShipped, name: 'Change shipped hour', show: true}, + {callback: this.showSMSDialog, name: 'Send SMS', show: true} ]; } @@ -163,6 +164,15 @@ class Controller { let url = `/api/report/rpt-delivery-note?ticketFk=${this.ticket.id}`; window.open(url); } + + showSMSDialog() { + const address = this.ticket.address; + this.newSMS = { + recipient: address.mobile || null, + message: this.$translate.instant('SMSPayment') + }; + this.$scope.sms.open(); + } } Controller.$inject = ['$state', '$scope', '$http', 'vnApp', '$translate']; diff --git a/modules/ticket/front/descriptor/locale/en.yml b/modules/ticket/front/descriptor/locale/en.yml new file mode 100644 index 000000000..4dca75a51 --- /dev/null +++ b/modules/ticket/front/descriptor/locale/en.yml @@ -0,0 +1,3 @@ +SMSPayment: >- + Verdnatura communicates: Your order is pending of payment. + Please, enter the web page and make the payment with card. Thank you. \ No newline at end of file diff --git a/modules/ticket/front/descriptor/locale/es.yml b/modules/ticket/front/descriptor/locale/es.yml index 953d75cbb..bf2a121eb 100644 --- a/modules/ticket/front/descriptor/locale/es.yml +++ b/modules/ticket/front/descriptor/locale/es.yml @@ -9,4 +9,7 @@ Remove stowaway: Borrar polizón Are you sure you want to delete this stowaway?: ¿Estas seguro de que quieres borrar este polizón? Show Delivery Note: Ver albarán Change shipped hour: Cambiar hora de envío -Shipped hour: Hora de envío \ No newline at end of file +Shipped hour: Hora de envío +SMSPayment: >- + Verdnatura le comunica: Su pedido está pendiente de pago. + Por favor, entre en la página web y efectue el pago con tarjeta. Muchas gracias. \ No newline at end of file diff --git a/modules/ticket/front/sale/index.html b/modules/ticket/front/sale/index.html index 479ac8f09..8ec48fa36 100644 --- a/modules/ticket/front/sale/index.html +++ b/modules/ticket/front/sale/index.html @@ -285,6 +285,10 @@ + + + + { + const instance = this.sales[line.instance]; + return `${instance.quantity} ${instance.concept}`; + }); + const notAvailables = items.join(', '); + const params = { + ticketFk: this.ticket.id, + created: this.ticket.created, + notAvailables + }; + this.newSMS = { + recipient: address.mobile || null, + message: this.$translate.instant('SMSAvailability', params) + }; + this.$scope.sms.open(); + } } Controller.$inject = ['$scope', '$state', '$http', 'vnApp', '$translate']; diff --git a/modules/ticket/front/sale/index.spec.js b/modules/ticket/front/sale/index.spec.js index fea921a14..113e29c80 100644 --- a/modules/ticket/front/sale/index.spec.js +++ b/modules/ticket/front/sale/index.spec.js @@ -11,16 +11,20 @@ describe('Ticket', () => { id: 1, clientFk: 1, shipped: 1, - client: {salesPersonFk: 1} + created: new Date(), + client: {salesPersonFk: 1}, + address: {mobile: 111111111} }; let sales = [ { id: 1, + concept: 'Item 1', quantity: 5, price: 23.5, discount: 0 }, { id: 4, + concept: 'Item 2', quantity: 20, price: 5.5, discount: 0 @@ -30,6 +34,7 @@ describe('Ticket', () => { beforeEach(() => { ngModule('item'); ngModule('ticket'); + ngModule('client'); }); beforeEach(angular.mock.inject(($compile, $rootScope, $state, _$httpBackend_) => { @@ -166,5 +171,18 @@ describe('Ticket', () => { $httpBackend.flush(); }); }); + + describe('showSMSDialog()', () => { + it('should open an SMS dialog with specified data', () => { + spyOn(controller.$scope.sms, 'open'); + + controller.sales[1].checked = true; + controller.showSMSDialog(); + + expect(controller.$scope.sms.open).toHaveBeenCalledWith(); + expect(controller.newSMS.recipient).toEqual(111111111); + expect(controller.newSMS.message).not.toEqual(''); + }); + }); }); }); diff --git a/modules/ticket/front/sale/locale/en.yml b/modules/ticket/front/sale/locale/en.yml new file mode 100644 index 000000000..469e2a04e --- /dev/null +++ b/modules/ticket/front/sale/locale/en.yml @@ -0,0 +1,3 @@ +SMSAvailability: >- + Verdnatura communicates: Your order {{ticketFk}} created on {{created | date: "dd/MM/yyyy"}}. + {{notAvailables}} not available. Sorry for the inconvenience. \ No newline at end of file diff --git a/modules/ticket/front/sale/locale/es.yml b/modules/ticket/front/sale/locale/es.yml index bbb08957f..3b6406d9e 100644 --- a/modules/ticket/front/sale/locale/es.yml +++ b/modules/ticket/front/sale/locale/es.yml @@ -28,3 +28,6 @@ Claim: Reclamación Transfer lines: Transferir líneas Change ticket state to 'Ok': Cambiar estado del ticket a 'Ok' Reserved: Reservado +SMSAvailability: >- + Verdnatura le comunica: Pedido {{ticketFk}} día {{created | date: "dd/MM/yyyy"}}. + {{notAvailables}} no disponible/s. Disculpe las molestias. From 280efdae505b52b090a75c559e5e7d5a327b1c95 Mon Sep 17 00:00:00 2001 From: Gerard Date: Fri, 29 Mar 2019 07:36:26 +0100 Subject: [PATCH 3/5] #732 Loggable now inserts the correct values for FK values --- e2e/paths/item-module/11_item_log.spec.js | 2 +- loopback/common/models/loggable.js | 36 ++++++++++++++----- modules/client/back/models/address.json | 2 +- .../client/back/models/client-contact.json | 2 +- modules/client/back/models/client-sample.json | 2 +- modules/client/back/models/client.json | 3 +- modules/client/back/models/greuge.json | 2 +- modules/item/back/models/item-barcode.json | 2 +- modules/item/back/models/item-botanical.json | 2 +- modules/item/back/models/item-niche.json | 2 +- modules/item/back/models/item-tag.json | 2 +- .../back/models/ticket-observation.json | 6 +++- .../ticket/back/models/ticket-request.json | 3 +- .../ticket/back/models/ticket-service.json | 2 +- .../ticket/back/models/ticket-tracking.json | 2 +- modules/ticket/back/models/ticket-weekly.json | 2 +- 16 files changed, 48 insertions(+), 24 deletions(-) diff --git a/e2e/paths/item-module/11_item_log.spec.js b/e2e/paths/item-module/11_item_log.spec.js index 4b9593c54..cf3beb528 100644 --- a/e2e/paths/item-module/11_item_log.spec.js +++ b/e2e/paths/item-module/11_item_log.spec.js @@ -71,6 +71,6 @@ describe('Item log path', () => { const fifthLineCreatedProperty = await nightmare .waitToGetProperty(selectors.itemLog.fifthLineCreatedProperty, 'innerText'); - expect(fifthLineCreatedProperty).toEqual('5080000'); + expect(fifthLineCreatedProperty).toEqual('Coral y materiales similares'); }); }); diff --git a/loopback/common/models/loggable.js b/loopback/common/models/loggable.js index c7550d10c..0c09d5f13 100644 --- a/loopback/common/models/loggable.js +++ b/loopback/common/models/loggable.js @@ -92,6 +92,8 @@ module.exports = function(Self) { newInstance: {} }; + delete instance.originFk; + let logModel = definition.settings.log.model; await ctx.Model.app.models[logModel].create(logRecord, options); }); @@ -111,10 +113,28 @@ module.exports = function(Self) { let val1 = ctx.Model.relations[key1]; if (val1.keyFrom == key && key != 'id') { let recordSet = await ctx.Model.app.models[val1.modelTo.modelName].findById(val, options); - let definition = val1.modelTo.definition; - let changedModelValue = definition.settings.log && definition.settings.log.changedModelValue; - val = (changedModelValue && recordSet && recordSet[changedModelValue]) || (recordSet && recordSet.id) || val; // FIXME preparar todos los modelos con campo name + let showField = val1.modelTo && val1.modelTo.definition.settings.log && val1.modelTo.definition.settings.log.showField && recordSet && recordSet[val1.modelTo.definition.settings.log.showField]; + if (!showField) { + const showFieldNames = [ + 'name', + 'description', + 'code' + ]; + for (field of showFieldNames) { + if (val1.modelTo.definition.properties && val1.modelTo.definition.properties[field] && recordSet && recordSet[field]) { + showField = field; + break; + } + } + } + + if (showField) { + val = recordSet[showField]; + break; + } + + val = recordSet && recordSet.id; // FIXME preparar todos los modelos con campo name break; } } @@ -161,18 +181,18 @@ module.exports = function(Self) { } // Sets the changedModelValue to save and the instances changed in case its an updateAll - let changedModelValue = definition.settings.log.changedModelValue; + let showField = definition.settings.log.showField; let where; - if (changedModelValue && (!ctx.instance || !ctx.instance[changedModelValue]) && ctx.where) { + if (showField && (!ctx.instance || !ctx.instance[showField]) && ctx.where) { changedModelId = []; where = []; - let changedInstances = await ctx.Model.app.models[definition.name].find({where: ctx.where, fields: ['id', changedModelValue]}, options); + let changedInstances = await ctx.Model.app.models[definition.name].find({where: ctx.where, fields: ['id', showField]}, options); changedInstances.forEach(element => { - where.push(element[changedModelValue]); + where.push(element[showField]); changedModelId.push(element.id); }); } else if (ctx.hookState.oldInstance) - where = ctx.instance[changedModelValue]; + where = ctx.instance[showField]; // Set oldInstance, newInstance, userFk and action diff --git a/modules/client/back/models/address.json b/modules/client/back/models/address.json index 26a8a0487..ffc80c49b 100644 --- a/modules/client/back/models/address.json +++ b/modules/client/back/models/address.json @@ -5,7 +5,7 @@ "log": { "model": "ClientLog", "relation": "client", - "changedModelValue": "nickname" + "showField": "nickname" }, "options": { "mysql": { diff --git a/modules/client/back/models/client-contact.json b/modules/client/back/models/client-contact.json index 467dce757..ea916c072 100644 --- a/modules/client/back/models/client-contact.json +++ b/modules/client/back/models/client-contact.json @@ -5,7 +5,7 @@ "log": { "model": "ClientLog", "relation": "client", - "changedModelValue": "name" + "showField": "name" }, "options": { "mysql": { diff --git a/modules/client/back/models/client-sample.json b/modules/client/back/models/client-sample.json index e29832b4b..812da8be8 100644 --- a/modules/client/back/models/client-sample.json +++ b/modules/client/back/models/client-sample.json @@ -4,7 +4,7 @@ "log": { "model": "ClientLog", "relation": "client", - "changedModelValue": "type" + "showField": "type" }, "options": { "mysql": { diff --git a/modules/client/back/models/client.json b/modules/client/back/models/client.json index fbc41ee2d..fc542ce14 100644 --- a/modules/client/back/models/client.json +++ b/modules/client/back/models/client.json @@ -2,7 +2,8 @@ "name": "Client", "base": "Loggable", "log": { - "model":"ClientLog" + "model":"ClientLog", + "showField": "id" }, "options": { "mysql": { diff --git a/modules/client/back/models/greuge.json b/modules/client/back/models/greuge.json index 67410c4a8..50f3a321b 100644 --- a/modules/client/back/models/greuge.json +++ b/modules/client/back/models/greuge.json @@ -4,7 +4,7 @@ "log": { "model": "ClientLog", "relation": "client", - "changedModelValue": "description" + "showField": "description" }, "options": { "mysql": { diff --git a/modules/item/back/models/item-barcode.json b/modules/item/back/models/item-barcode.json index c2fa166e1..b9de53dd1 100644 --- a/modules/item/back/models/item-barcode.json +++ b/modules/item/back/models/item-barcode.json @@ -4,7 +4,7 @@ "log": { "model": "ItemLog", "relation": "item", - "changedModelValue": "code" + "showField": "code" }, "options": { "mysql": { diff --git a/modules/item/back/models/item-botanical.json b/modules/item/back/models/item-botanical.json index 2a1234e36..12248602d 100644 --- a/modules/item/back/models/item-botanical.json +++ b/modules/item/back/models/item-botanical.json @@ -4,7 +4,7 @@ "log": { "model": "ItemLog", "relation": "item", - "changedModelValue": "botanical" + "showField": "botanical" }, "options": { "mysql": { diff --git a/modules/item/back/models/item-niche.json b/modules/item/back/models/item-niche.json index aadcab28e..260eb07b9 100644 --- a/modules/item/back/models/item-niche.json +++ b/modules/item/back/models/item-niche.json @@ -4,7 +4,7 @@ "log": { "model": "ItemLog", "relation": "item", - "changedModelValue": "code" + "showField": "code" }, "options": { "mysql": { diff --git a/modules/item/back/models/item-tag.json b/modules/item/back/models/item-tag.json index d68e1a299..e276703a6 100644 --- a/modules/item/back/models/item-tag.json +++ b/modules/item/back/models/item-tag.json @@ -4,7 +4,7 @@ "log": { "model": "ItemLog", "relation": "item", - "changedModelValue": "value" + "showField": "value" }, "options": { "mysql": { diff --git a/modules/ticket/back/models/ticket-observation.json b/modules/ticket/back/models/ticket-observation.json index e5b0169c1..51469c7a6 100644 --- a/modules/ticket/back/models/ticket-observation.json +++ b/modules/ticket/back/models/ticket-observation.json @@ -1,6 +1,10 @@ { "name": "TicketObservation", - "base": "VnModel", + "base": "Loggable", + "log": { + "model": "TicketLog", + "relation": "ticket" + }, "options": { "mysql": { "table": "ticketObservation" diff --git a/modules/ticket/back/models/ticket-request.json b/modules/ticket/back/models/ticket-request.json index 32d3163e2..dfb609e3c 100644 --- a/modules/ticket/back/models/ticket-request.json +++ b/modules/ticket/back/models/ticket-request.json @@ -3,8 +3,7 @@ "base": "Loggable", "log": { "model": "TicketLog", - "relation": "ticket", - "changedModelValue": "description" + "relation": "ticket" }, "options": { "mysql": { diff --git a/modules/ticket/back/models/ticket-service.json b/modules/ticket/back/models/ticket-service.json index e14ff68ec..b3878e89e 100644 --- a/modules/ticket/back/models/ticket-service.json +++ b/modules/ticket/back/models/ticket-service.json @@ -4,7 +4,7 @@ "log": { "model": "TicketLog", "relation": "ticket", - "changedModelValue": "description" + "showField": "description" }, "options": { "mysql": { diff --git a/modules/ticket/back/models/ticket-tracking.json b/modules/ticket/back/models/ticket-tracking.json index 3512643d1..550df7d9c 100644 --- a/modules/ticket/back/models/ticket-tracking.json +++ b/modules/ticket/back/models/ticket-tracking.json @@ -4,7 +4,7 @@ "log": { "model": "TicketLog", "relation": "ticket", - "changedModelValue": "stateFk" + "showField": "stateFk" }, "options": { "mysql": { diff --git a/modules/ticket/back/models/ticket-weekly.json b/modules/ticket/back/models/ticket-weekly.json index 7c107659a..2f630dc64 100644 --- a/modules/ticket/back/models/ticket-weekly.json +++ b/modules/ticket/back/models/ticket-weekly.json @@ -4,7 +4,7 @@ "log": { "model": "TicketLog", "relation": "ticket", - "changedModelValue": "ticketFk" + "showField": "ticketFk" }, "options": { "mysql": { From 545925465354b8221d89c66511e7ac9452feaa97 Mon Sep 17 00:00:00 2001 From: Gerard Date: Fri, 29 Mar 2019 07:37:16 +0100 Subject: [PATCH 4/5] textField now saves the correct oldValue --- front/core/components/textfield/textfield.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/front/core/components/textfield/textfield.js b/front/core/components/textfield/textfield.js index 8d2964b9b..f9b51f29f 100644 --- a/front/core/components/textfield/textfield.js +++ b/front/core/components/textfield/textfield.js @@ -14,10 +14,6 @@ export default class Textfield extends Input { this.hasFocus = false; this.hasMouseIn = false; - this.input.addEventListener('keydown', () => { - if (this.oldValue === undefined) - this.saveOldValue(); - }); this.input.addEventListener('keyup', e => { if (e.defaultPrevented || e.key != 'Escape') return; From 8db51fdf64440acb75ce8bb2c013d478dddb270e Mon Sep 17 00:00:00 2001 From: Joan Sanchez Date: Fri, 29 Mar 2019 08:01:15 +0100 Subject: [PATCH 5/5] added shrink class to item index #1278 --- modules/item/front/fetched-tags/index.html | 4 +- modules/item/front/index/index.html | 57 ++++++++++--------- modules/order/front/line/index.html | 1 - modules/order/front/summary/index.html | 1 - modules/order/front/volume/index.html | 1 - .../methods/route/specs/getTickets.spec.js | 2 +- .../back/methods/route/specs/summary.spec.js | 2 +- modules/ticket/front/component/index.html | 1 - modules/ticket/front/data/step-two/index.html | 3 +- modules/ticket/front/sale-checked/index.html | 1 - modules/ticket/front/sale-tracking/index.html | 1 - modules/ticket/front/sale/index.html | 1 - modules/ticket/front/summary/index.html | 3 +- modules/ticket/front/volume/index.html | 3 +- 14 files changed, 38 insertions(+), 43 deletions(-) diff --git a/modules/item/front/fetched-tags/index.html b/modules/item/front/fetched-tags/index.html index 78420c79f..c613a042d 100644 --- a/modules/item/front/fetched-tags/index.html +++ b/modules/item/front/fetched-tags/index.html @@ -1,7 +1,7 @@ - {{::$ctrl.title}} + {{::$ctrl.item.name}} -

{{::$ctrl.subName}}

+

{{::$ctrl.subName}}

- - Id - Grouping - Packing + + Id + Grouping + Packing Description - Stems - Size - Niche - Type - Category - Intrastat - Origin - Buyer - Density + Stems + Size + Niche + Type + Category + Intrastat + Origin + Buyer + Density Active @@ -49,38 +49,43 @@ ng-click="$ctrl.stopEvent($event)" on-error-src/> - + {{::item.id | zeroFill:6}} - {{::item.grouping | dashIfEmpty}} - {{::item.packing | dashIfEmpty}} + {{::item.grouping | dashIfEmpty}} + {{::item.packing | dashIfEmpty}} - {{::item.stems}} - {{::item.size}} - {{::item.niche}} - {{::item.type}} - {{::item.category}} - {{::item.intrastat}} - {{::item.origin}} - + {{::item.stems}} + {{::item.size}} + {{::item.niche}} + + {{::item.type}} + + + {{::item.category}} + + + {{::item.intrastat}} + + {{::item.origin}} + {{::item.userNickname}} - {{::item.density}} + {{::item.density}} diff --git a/modules/order/front/summary/index.html b/modules/order/front/summary/index.html index c4450469b..ea2abef08 100644 --- a/modules/order/front/summary/index.html +++ b/modules/order/front/summary/index.html @@ -72,7 +72,6 @@ diff --git a/modules/order/front/volume/index.html b/modules/order/front/volume/index.html index 5b081783e..4772ccd43 100644 --- a/modules/order/front/volume/index.html +++ b/modules/order/front/volume/index.html @@ -42,7 +42,6 @@ diff --git a/modules/route/back/methods/route/specs/getTickets.spec.js b/modules/route/back/methods/route/specs/getTickets.spec.js index 1c850099c..decb1abe5 100644 --- a/modules/route/back/methods/route/specs/getTickets.spec.js +++ b/modules/route/back/methods/route/specs/getTickets.spec.js @@ -1,7 +1,7 @@ const app = require('vn-loopback/server/server'); describe('route summary()', () => { - it('should return a summary object containing data freom his tickets', async() => { + it('should return a summary object containing data from his tickets', async() => { let result = await app.models.Route.getTickets(1); expect(result[2].id).toEqual(11); diff --git a/modules/route/back/methods/route/specs/summary.spec.js b/modules/route/back/methods/route/specs/summary.spec.js index 658519c51..304cd2f43 100644 --- a/modules/route/back/methods/route/specs/summary.spec.js +++ b/modules/route/back/methods/route/specs/summary.spec.js @@ -8,7 +8,7 @@ describe('route summary()', () => { expect(result.route.workerFk).toEqual(56); }); - it('should return a summary object containing data freom his tickets', async() => { + it('should return a summary object containing data from his tickets', async() => { let result = await app.models.Route.summary(1); expect(result.tickets[2].id).toEqual(11); diff --git a/modules/ticket/front/component/index.html b/modules/ticket/front/component/index.html index 67f225946..dfcfde6f6 100644 --- a/modules/ticket/front/component/index.html +++ b/modules/ticket/front/component/index.html @@ -51,7 +51,6 @@ diff --git a/modules/ticket/front/data/step-two/index.html b/modules/ticket/front/data/step-two/index.html index 12da56584..a8c3859e5 100644 --- a/modules/ticket/front/data/step-two/index.html +++ b/modules/ticket/front/data/step-two/index.html @@ -18,8 +18,7 @@ + item="::sale.item"> {{::sale.quantity}} diff --git a/modules/ticket/front/sale-checked/index.html b/modules/ticket/front/sale-checked/index.html index 00eeb2981..4126e3477 100644 --- a/modules/ticket/front/sale-checked/index.html +++ b/modules/ticket/front/sale-checked/index.html @@ -37,7 +37,6 @@ diff --git a/modules/ticket/front/sale-tracking/index.html b/modules/ticket/front/sale-tracking/index.html index 9093ebdba..2920f74e9 100644 --- a/modules/ticket/front/sale-tracking/index.html +++ b/modules/ticket/front/sale-tracking/index.html @@ -41,7 +41,6 @@ diff --git a/modules/ticket/front/sale/index.html b/modules/ticket/front/sale/index.html index 8ec48fa36..12b381773 100644 --- a/modules/ticket/front/sale/index.html +++ b/modules/ticket/front/sale/index.html @@ -121,7 +121,6 @@ diff --git a/modules/ticket/front/summary/index.html b/modules/ticket/front/summary/index.html index 5a37cc959..20a603802 100644 --- a/modules/ticket/front/summary/index.html +++ b/modules/ticket/front/summary/index.html @@ -100,8 +100,7 @@ {{::sale.price | currency: 'EUR':2}} diff --git a/modules/ticket/front/volume/index.html b/modules/ticket/front/volume/index.html index 1efb07149..cfb095bd5 100644 --- a/modules/ticket/front/volume/index.html +++ b/modules/ticket/front/volume/index.html @@ -45,8 +45,7 @@ {{::sale.quantity}}