From 018e17487e3fd542543efc4673596c91951180aa Mon Sep 17 00:00:00 2001 From: Carlos Jimenez Ruiz Date: Fri, 3 Jul 2020 12:13:42 +0200 Subject: [PATCH 1/3] imput validation is ok with Jest --- .../components/input-number/index.spec.js | 27 +++++++------------ 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/front/core/components/input-number/index.spec.js b/front/core/components/input-number/index.spec.js index d1bbe251c..0e0f8c4a5 100644 --- a/front/core/components/input-number/index.spec.js +++ b/front/core/components/input-number/index.spec.js @@ -7,7 +7,7 @@ describe('Component vnInputNumber', () => { beforeEach(ngModule('vnCore')); beforeEach(angular.mock.inject(($compile, $rootScope) => { - $element = $compile(``)($rootScope); + $element = $compile(``)($rootScope); $ctrl = $element.controller('vnInputNumber'); })); @@ -20,12 +20,10 @@ describe('Component vnInputNumber', () => { $ctrl.field = -1; $ctrl.min = 0; - // FIXME: Input validation doesn't work with Jest? - // expect($ctrl.shownError).toContain('Please select a value that is no less than 0'); - expect($ctrl.shownError).toBeNull(); + expect($ctrl.shownError).toContain('Constraints not satisfied'); }); - it(`should unset error property when value is upper than min`, () => { + it(`should unset error property when value is greater than min`, () => { $ctrl.field = 1; $ctrl.min = 0; @@ -34,19 +32,16 @@ describe('Component vnInputNumber', () => { }); describe('max() setter', () => { - it(`should set error property when value is upper than max`, () => { + it(`should set error property when value is greater than max`, () => { $ctrl.field = 1; $ctrl.max = 0; - // FIXME: Input validation doesn't work with Jest? - // expect($ctrl.shownError).toContain('Please select a value that is no more than 0'); - expect($ctrl.shownError).toBeNull(); + expect($ctrl.shownError).toContain('Constraints not satisfied'); }); - // FIXME: Input validation doesn't work with Jest? it(`should unset error property when value is lower than max`, () => { $ctrl.field = -1; - $ctrl.min = 0; + $ctrl.max = 0; expect($ctrl.shownError).toBeNull(); }); @@ -54,14 +49,12 @@ describe('Component vnInputNumber', () => { describe('step() setter', () => { it(`should increase value when add icon is clicked`, () => { - $ctrl.step = 1; - $ctrl.field = 1; + $ctrl.input.step = 1; + $ctrl.input.value = 0; - // FIXME: Doesn't work with Jest? - // $ctrl.stepUp(); - // $element[0].querySelector('vn-icon[icon=add]').click(); + $ctrl.stepUp(); - expect($ctrl.field).toBe(1); + expect($ctrl.input.value).toBe('1'); }); }); }); From 663b5fb9aae6ecb19d3bb07d6f4517bd4f937b87 Mon Sep 17 00:00:00 2001 From: Carlos Jimenez Ruiz Date: Fri, 3 Jul 2020 13:28:49 +0200 Subject: [PATCH 2/3] descriptor can now have 4 quicklinks --- front/salix/components/descriptor/index.js | 3 ++- front/salix/components/descriptor/style.scss | 2 +- modules/ticket/front/descriptor/index.html | 16 +++++++++++++++- modules/ticket/front/descriptor/index.js | 6 ++++++ 4 files changed, 24 insertions(+), 3 deletions(-) diff --git a/front/salix/components/descriptor/index.js b/front/salix/components/descriptor/index.js index d87a4c395..3d6dd1b3f 100644 --- a/front/salix/components/descriptor/index.js +++ b/front/salix/components/descriptor/index.js @@ -94,7 +94,8 @@ ngModule.vnComponent('vnDescriptor', { transclude: { btnOne: '?btnOne', btnTwo: '?btnTwo', - btnThree: '?btnThree' + btnThree: '?btnThree', + btnFour: '?btnFour' } }); diff --git a/front/salix/components/descriptor/style.scss b/front/salix/components/descriptor/style.scss index 03a9002d5..3bddaaf44 100644 --- a/front/salix/components/descriptor/style.scss +++ b/front/salix/components/descriptor/style.scss @@ -88,7 +88,7 @@ vn-descriptor-content { display: flex; align-items: center; justify-content: center; - padding: 0 $spacing-md; + padding: 10px 5px; margin: 0 $spacing-sm; & > vn-icon { diff --git a/modules/ticket/front/descriptor/index.html b/modules/ticket/front/descriptor/index.html index a82103f08..1ad27aac3 100644 --- a/modules/ticket/front/descriptor/index.html +++ b/modules/ticket/front/descriptor/index.html @@ -146,6 +146,20 @@
+ + +
+
+ + +
+
-
+
{ this.isEditable = res.data; From f2e1f00ae32778d968667fcd1eb6140553e1a905 Mon Sep 17 00:00:00 2001 From: Carlos Jimenez Ruiz Date: Fri, 3 Jul 2020 16:43:45 +0200 Subject: [PATCH 3/3] using csss variables plus a traduction --- front/salix/components/descriptor/style.scss | 2 +- print/templates/reports/claim-pickup-order/locale/es.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/front/salix/components/descriptor/style.scss b/front/salix/components/descriptor/style.scss index 3bddaaf44..9649d61e5 100644 --- a/front/salix/components/descriptor/style.scss +++ b/front/salix/components/descriptor/style.scss @@ -88,7 +88,7 @@ vn-descriptor-content { display: flex; align-items: center; justify-content: center; - padding: 10px 5px; + padding: 0 $spacing-sm; margin: 0 $spacing-sm; & > vn-icon { diff --git a/print/templates/reports/claim-pickup-order/locale/es.yml b/print/templates/reports/claim-pickup-order/locale/es.yml index b37793b70..54990a05c 100644 --- a/print/templates/reports/claim-pickup-order/locale/es.yml +++ b/print/templates/reports/claim-pickup-order/locale/es.yml @@ -11,5 +11,5 @@ clientSignature: Firma del cliente claim: Reclamación {0} sections: agency: - description: 'Para agilizar tu recogida, por favor, pónte en contacto con la oficina + description: 'Para agilizar su recogida, por favor, póngase en contacto con la oficina de integrados.
Tlf: 96 166 77 88 - Ana Gómez (Ext. 2113) (agomezf@integra2.es)'