Ge|bmR=A2$XpM7TA^j`$W)e4AJKTY$$%&GQC%ZqgcE8|%|)we>n5d8
zYZ$fBupCkQyircK*-9Sg8N|)4>dM0XYB`@}?;pI^@bm!ZY*FAT!6$Y15-n6nZKM$V&ME>=)`Q_~`Eoy2-dC3XHikS@?WL9lVI6iV$
zFPVhTz1{6-19SMyjYikgRry-Z93uC^#_P}+}mql%$A4#;y-cq%Ei93
zr?;i6R<2m8t(1IW2><~Q_*C`pP1p0#za_N(9suyYm-m;)u`B=n{4NU8MJq`4Ko;#P
z>CoTDz(+ctH)5yQkV~(>WX>b6RG)DwkEBJk1HpOgo(bIDTql~)_kgCZDB=4ckx+ty
zh<;F!up3#;;h>|z>0m&@eS-x{q}B%WMpE6)^7sYQK#=HZ2?{!RUr^Dr6Ou)TkM&h3cK}(L=Xs{qk+7IBwvC^S3#=C^Bqc+dX6W%x8r-3O#<>W4nJ?{5MBD%
zAr)}xY0so9u-J`CQ{4LN9!yABUhGEBTo#cUR5*Iko{CUubOuHyW)?PVS=nKiJh)^Un8hDh}Y6H8p3uIyf>MU70!K)u}$?#>#+Yb9QQ#Z)17#?7+g%fXM=1qcj9u
zOnU01ow-@&%v)1S1HIPa_8KM2dE7MYo@}-wC!5P%#BNhgH(wdQN!Tv+_gk6MjF(63
zq-RddSw1ZA4vo*!m(5#KPZn!D)hBg}wLEUJ+Q+0sd3-RvMXc|`RyGfPx0vHq@9WJ!
zfmZW?6q1KtmMug0t)kmMEazN5lcmzvhqgn23t#9xYTwDXJT^g_73Sl2K&=+2ICC@Q
zM-e8!M+dpENB@*>07MP}-V+LE#q#GdzV3E4@yO$$hO795sfc93dbcQ;XkE3n>
SXoc;WFL3*Wy!n$LECUGU0X4P&
From e6bc71ee337689dc72d96e4cd5bd4b123c119cd9 Mon Sep 17 00:00:00 2001
From: Bernat
Date: Thu, 13 Sep 2018 11:08:31 +0200
Subject: [PATCH 23/34] update fixtures table packaging
---
.../changes/1.1.0/{ticketGetTax.sql => 01-ticketGetTax.sql} | 0
services/db/install/dump/fixtures.sql | 4 ++--
2 files changed, 2 insertions(+), 2 deletions(-)
rename services/db/install/changes/1.1.0/{ticketGetTax.sql => 01-ticketGetTax.sql} (100%)
diff --git a/services/db/install/changes/1.1.0/ticketGetTax.sql b/services/db/install/changes/1.1.0/01-ticketGetTax.sql
similarity index 100%
rename from services/db/install/changes/1.1.0/ticketGetTax.sql
rename to services/db/install/changes/1.1.0/01-ticketGetTax.sql
diff --git a/services/db/install/dump/fixtures.sql b/services/db/install/dump/fixtures.sql
index 7e8a25d09..956e29971 100644
--- a/services/db/install/dump/fixtures.sql
+++ b/services/db/install/dump/fixtures.sql
@@ -507,13 +507,13 @@ INSERT INTO `vn`.`packaging`(`id`, `volume`, `width`, `height`, `depth`, `isPack
VALUES
(1, 0.00, 10, 10, 0, 0, CURDATE(), 1, 1.50),
(2, 100.00, 20, 20, 0, 0, CURDATE(), 2, 1.00),
- ('a', 50.00, 30, 30, 0, 1, CURDATE(), 3, 0.00);
+ (3, 50.00, 30, 30, 0, 1, CURDATE(), 71, 0.00);
INSERT INTO `vn`.`ticketPackaging`(`id`, `ticketFk`, `packagingFk`, `quantity`, `created`, `pvp`)
VALUES
( 1, 1, 1, 2, CURDATE(), NULL),
( 2, 2, 2, 1, CURDATE(), NULL),
- ( 3, 3, 'a', 4, CURDATE(), NULL);
+ ( 3, 3, 3, 4, CURDATE(), NULL);
INSERT INTO `vn`.`sale`(`id`, `itemFk`, `ticketFk`, `concept`, `quantity`, `price`, `discount`, `reserved`, `isPicked`, `created`)
VALUES
From 094a6eda68ae5e903f1aa32b72ca182ea0b4b86a Mon Sep 17 00:00:00 2001
From: gerard
Date: Thu, 13 Sep 2018 11:27:38 +0200
Subject: [PATCH 24/34] Bug #644 Crear componente Input Number
---
client/core/src/components/index.js | 1 +
.../src/components/input-number/index.html | 42 +++++
.../core/src/components/input-number/index.js | 104 ++++++++++++
.../src/components/input-number/index.spec.js | 160 ++++++++++++++++++
.../src/components/input-number/style.scss | 21 +++
.../src/components/textfield/textfield.js | 4 +-
6 files changed, 331 insertions(+), 1 deletion(-)
create mode 100644 client/core/src/components/input-number/index.html
create mode 100644 client/core/src/components/input-number/index.js
create mode 100644 client/core/src/components/input-number/index.spec.js
create mode 100644 client/core/src/components/input-number/style.scss
diff --git a/client/core/src/components/index.js b/client/core/src/components/index.js
index dbba202d0..6ca4fd0e5 100644
--- a/client/core/src/components/index.js
+++ b/client/core/src/components/index.js
@@ -40,3 +40,4 @@ import './table';
import './th';
import './input-range';
import './chip';
+import './input-number';
diff --git a/client/core/src/components/input-number/index.html b/client/core/src/components/input-number/index.html
new file mode 100644
index 000000000..1eb20fda3
--- /dev/null
+++ b/client/core/src/components/input-number/index.html
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ info_outline
+
+
+
+
+
diff --git a/client/core/src/components/input-number/index.js b/client/core/src/components/input-number/index.js
new file mode 100644
index 000000000..e344abd88
--- /dev/null
+++ b/client/core/src/components/input-number/index.js
@@ -0,0 +1,104 @@
+import ngModule from '../../module';
+import Textfield from '../textfield/textfield';
+import './style.scss';
+
+export default class InputNumber extends Textfield {
+
+ constructor($element, $scope, $attrs, vnTemplate, $transclude) {
+ super($element, $scope, $attrs, vnTemplate, $transclude);
+
+ this.input.addEventListener('change', () => {
+ this.validateValue();
+ });
+ }
+
+ get value() {
+ return this._value;
+ }
+
+ set value(value) {
+ this._value = value;
+ this.hasValue = this._value !== null;
+
+ if (this.hasValue) this.element.classList.add('not-empty');
+ else this.element.classList.remove('not-empty');
+
+ this.element.querySelector('.infix').classList.remove('invalid', 'validated');
+ }
+
+ get max() {
+ return this.input.max;
+ }
+
+ set max(value) {
+ if (value)
+ this.input.max = value;
+ }
+
+ get min() {
+ return this.input.min;
+ }
+
+ set min(value) {
+ if (!value) value = 0;
+ this.input.min = value;
+ }
+
+ get step() {
+ return parseInt(this.input.step);
+ }
+
+ set step(value) {
+ this.input.step = value;
+ }
+
+ validateValue() {
+ if ((this.validate() !== undefined && !this.validate()) ||
+ (this.max && this.value > this.max) ||
+ (this.min && this.value < this.min) ||
+ (this.step && this.value % this.step != 0)) {
+ this.$element[0].querySelector('.infix').classList.add('invalid', 'validated');
+ }
+
+ if (this.onChange)
+ this.onChange();
+ }
+
+ add() {
+ if (this.step && this.value % this.step != 0) {
+ this.value += (this.step - this.value % this.step);
+ } else {
+ this.value += this.step;
+ }
+
+ this.validateValue();
+ }
+
+ remove() {
+ if (this.step && this.value % this.step != 0) {
+ this.value -= (this.step + this.value % this.step);
+ } else {
+ this.value -= this.step;
+ }
+ this.validateValue();
+ }
+}
+
+InputNumber.$inject = ['$element', '$scope', '$attrs', 'vnTemplate', '$transclude'];
+
+ngModule.component('vnInputNumber', {
+ template: require('./index.html'),
+ controller: InputNumber,
+ bindings: {
+ label: '@?',
+ disabled: '',
+ min: '',
+ max: '',
+ step: '',
+ rule: '@?',
+ value: '=model',
+ validate: '&',
+ onChange: '&',
+ onClear: '&'
+ }
+});
diff --git a/client/core/src/components/input-number/index.spec.js b/client/core/src/components/input-number/index.spec.js
new file mode 100644
index 000000000..4663e3c8b
--- /dev/null
+++ b/client/core/src/components/input-number/index.spec.js
@@ -0,0 +1,160 @@
+import './index.js';
+
+describe('Component vnInputNumber', () => {
+ let $componentController;
+ let $scope;
+ let $attrs;
+ let $timeout;
+ let $element;
+ let controller;
+
+ beforeEach(() => {
+ angular.mock.module('claim');
+ });
+
+ beforeEach(angular.mock.inject((_$componentController_, $rootScope, _$httpBackend_, _$timeout_) => {
+ $componentController = _$componentController_;
+ $scope = $rootScope.$new();
+ $attrs = {};
+ $timeout = _$timeout_;
+ $element = angular.element('');
+ controller = $componentController('vnInputNumber', {$element, $scope, $attrs, $timeout, $transclude: () => {}});
+ }));
+
+ describe('value() setter', () => {
+ it(`should set _value to a given value, add the class not-empty and remove invalid and validated`, () => {
+ controller.value = 'pepino';
+ let classes = controller.element.classList.toString();
+
+ expect(classes).toContain('not-empty');
+ expect(controller._value).toEqual('pepino');
+
+ classes = controller.element.querySelector('.infix').classList.toString();
+
+ expect(classes).not.toContain('invalid validated');
+ });
+
+ it(`should set _value to a given value and not add the class not-empty if the given value is null`, () => {
+ controller.value = null;
+ let classes = controller.element.classList.toString();
+
+ expect(classes).not.toContain('not-empty');
+ expect(controller._value).toEqual(null);
+ });
+ });
+
+ describe('max() setter', () => {
+ it(`should set input.max to a given value`, () => {
+ controller.max = 10;
+
+ expect(controller.input.max).toEqual('10');
+ });
+ });
+
+ describe('min() setter', () => {
+ it(`should set input.min if theres a given value`, () => {
+ controller.min = 1;
+
+ expect(controller.input.min).toEqual('1');
+ });
+
+ it(`should set input.min to 0 if theres not a given value`, () => {
+ controller.min = null;
+
+ expect(controller.input.min).toEqual('0');
+ });
+ });
+
+ describe('step() setter/getter', () => {
+ it(`should set input.step to a given value`, () => {
+ controller.step = 50;
+
+ expect(controller.input.step).toEqual('50');
+ });
+
+ it(`should return a number`, () => {
+ controller.step = 50;
+
+ expect(controller.step).toEqual(50);
+ expect(typeof controller.step).toEqual('number');
+ });
+ });
+
+ describe('validateValue()', () => {
+ it(`should add the classes invalid and validated if the value is less than min`, () => {
+ controller.validate = () => {};
+ controller.min = 0;
+ controller.value = -7;
+ let classes = controller.element.querySelector('.infix').classList.toString();
+
+ expect(classes).not.toContain('invalid validated');
+ expect(controller.value).toEqual(-7);
+
+ controller.validateValue();
+ classes = controller.element.querySelector('.infix').classList.toString();
+
+ expect(classes).toContain('infix invalid validated');
+ });
+
+ it(`should add the classes invalid and validated if the value is greater than max`, () => {
+ controller.validate = () => {};
+ controller.max = 10;
+ controller.value = 15;
+ let classes = controller.element.querySelector('.infix').classList.toString();
+
+ expect(classes).not.toContain('invalid validated');
+ expect(controller.value).toEqual(15);
+
+ controller.validateValue();
+ classes = controller.element.querySelector('.infix').classList.toString();
+
+ expect(classes).toContain('infix invalid validated');
+ });
+
+ it(`should add the classes invalid and validated if the value is not a valid step`, () => {
+ controller.validate = () => {};
+ controller.step = 5;
+ controller.value = 7;
+ let classes = controller.element.querySelector('.infix').classList.toString();
+
+ expect(classes).not.toContain('invalid validated');
+ expect(controller.value).toEqual(7);
+
+ controller.validateValue();
+ classes = controller.element.querySelector('.infix').classList.toString();
+
+ expect(classes).toContain('infix invalid validated');
+ });
+
+ it(`should add the classes invalid and validated if the function validate returns false`, () => {
+ controller.validate = () => {
+ return false;
+ };
+ controller.step = 5;
+ controller.value = 7;
+ let classes = controller.element.querySelector('.infix').classList.toString();
+
+ expect(classes).not.toContain('invalid validated');
+ expect(controller.value).toEqual(7);
+
+ controller.validateValue();
+ classes = controller.element.querySelector('.infix').classList.toString();
+
+ expect(classes).toContain('infix invalid validated');
+ });
+ });
+
+ describe('add()', () => {
+ it(`should set value to the next possible step and call validateValue`, () => {
+ spyOn(controller, 'validateValue');
+
+ controller.step = 50;
+ controller.value = -1;
+
+ controller.remove();
+
+ expect(controller.value).toEqual(-50);
+ expect(controller.validateValue).toHaveBeenCalledWith();
+ });
+ });
+});
diff --git a/client/core/src/components/input-number/style.scss b/client/core/src/components/input-number/style.scss
new file mode 100644
index 000000000..2b7749d26
--- /dev/null
+++ b/client/core/src/components/input-number/style.scss
@@ -0,0 +1,21 @@
+@import 'colors';
+@import '../textfield/style.scss';
+
+vn-input-number {
+ @extend vn-textfield;
+ input {
+ text-align: center!important;
+ }
+ vn-icon[icon=add],
+ vn-icon[icon=remove]{
+ &:not(:hover){
+ color: $secondary-font-color;
+ }
+ i {
+ -moz-user-select: none;
+ -webkit-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+ }
+ }
+}
\ No newline at end of file
diff --git a/client/core/src/components/textfield/textfield.js b/client/core/src/components/textfield/textfield.js
index 64b91faa0..3817ab0d5 100644
--- a/client/core/src/components/textfield/textfield.js
+++ b/client/core/src/components/textfield/textfield.js
@@ -81,6 +81,7 @@ export default class Textfield extends Input {
clear() {
this.saveOldValue();
this.value = null;
+ if (this.onClear) this.onClear();
this.input.focus();
}
}
@@ -102,6 +103,7 @@ ngModule.component('vnTextfield', {
rule: '@?',
type: '@?',
vnTabIndex: '@?',
- onChange: '&'
+ onChange: '&',
+ onClear: '&'
}
});
From 7638881c541a0de6f886d4649a5cb64c897a322d Mon Sep 17 00:00:00 2001
From: Carlos Jimenez <=>
Date: Thu, 13 Sep 2018 11:29:21 +0200
Subject: [PATCH 25/34] corrected description
---
e2e/paths/item-module/06_create_item_botanical.spec.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/e2e/paths/item-module/06_create_item_botanical.spec.js b/e2e/paths/item-module/06_create_item_botanical.spec.js
index c06376365..1bc3dfa39 100644
--- a/e2e/paths/item-module/06_create_item_botanical.spec.js
+++ b/e2e/paths/item-module/06_create_item_botanical.spec.js
@@ -20,7 +20,7 @@ describe('Item', () => {
});
});
- it('should search for the item Gem of Time', () => {
+ it('should search for the item Mjolnir', () => {
return nightmare
.wait(selectors.itemsIndex.searchResult)
.type(selectors.itemsIndex.searchItemInput, 'Mjolnir')
From b2b2c71117e6871e5c7185a15fd30ded5d399424 Mon Sep 17 00:00:00 2001
From: Carlos Jimenez <=>
Date: Thu, 13 Sep 2018 11:29:53 +0200
Subject: [PATCH 26/34] #640 Ticket Create packages path is excluded
---
e2e/paths/ticket-module/04_create_ticket_packages.spec.js | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/e2e/paths/ticket-module/04_create_ticket_packages.spec.js b/e2e/paths/ticket-module/04_create_ticket_packages.spec.js
index f9f36f424..0966f8e7e 100644
--- a/e2e/paths/ticket-module/04_create_ticket_packages.spec.js
+++ b/e2e/paths/ticket-module/04_create_ticket_packages.spec.js
@@ -95,7 +95,7 @@ describe('Ticket Create packages path', () => {
return nightmare
.waitToClick(selectors.ticketPackages.firstPackageSelect)
.waitToClick(selectors.ticketPackages.firstPackageSelectOptionThree)
- .waitForTextInInput(selectors.ticketPackages.firstPackageSelect, 'Iron Patriot')
+ .waitForTextInInput(selectors.ticketPackages.firstPackageSelect, 'ShippingCost')
.click(selectors.ticketPackages.savePackagesButton)
.waitForLastSnackbar()
.then(result => {
@@ -108,10 +108,10 @@ describe('Ticket Create packages path', () => {
.click(selectors.ticketSales.saleButton)
.wait(selectors.ticketSales.firstPackageSelect)
.click(selectors.ticketPackages.packagesButton)
- .waitForTextInInput(selectors.ticketPackages.firstPackageSelect, 'Iron Patriot')
+ .waitForTextInInput(selectors.ticketPackages.firstPackageSelect, 'ShippingCost')
.getInputValue(selectors.ticketPackages.firstPackageSelect)
.then(result => {
- expect(result).toEqual('Iron Patriot');
+ expect(result).toEqual('ShippingCost');
});
});
From 24f89156e4f208fa7003ce17f261f7a503e660f3 Mon Sep 17 00:00:00 2001
From: Bernat
Date: Thu, 13 Sep 2018 12:32:33 +0200
Subject: [PATCH 27/34] update fixtures, fix test and selectors
---
e2e/helpers/selectors.js | 6 ++--
.../02_edit_item_basic_data.spec.js | 2 +-
.../08_item_create_and_clone.spec.js | 2 +-
.../04_create_ticket_packages.spec.js | 10 +++---
services/db/install/dump/fixtures.sql | 34 ++++++++++---------
.../packaging/specs/listPackaging.spec.js | 2 +-
6 files changed, 29 insertions(+), 27 deletions(-)
diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js
index 571493ed4..1e238b2c0 100644
--- a/e2e/helpers/selectors.js
+++ b/e2e/helpers/selectors.js
@@ -167,7 +167,7 @@ export default {
itemCreateView: {
name: `${components.vnTextfield}[name="name"]`,
typeSelect: `vn-autocomplete[field="$ctrl.item.typeFk"] input`,
- typeSelectOptionOne: `vn-autocomplete[field="$ctrl.item.typeFk"] vn-drop-down ul > li:nth-child(2)`,
+ typeSelectOptionThree: `vn-autocomplete[field="$ctrl.item.typeFk"] vn-drop-down ul > li:nth-child(3)`,
intrastatSelect: `vn-autocomplete[field="$ctrl.item.intrastatFk"] input`,
intrastatSelectOptionOne: `vn-autocomplete[field="$ctrl.item.intrastatFk"] vn-drop-down ul > li:nth-child(2)`,
originSelect: `vn-autocomplete[field="$ctrl.item.originFk"] input`,
@@ -180,7 +180,7 @@ export default {
goToItemIndexButton: 'vn-item-descriptor [ui-sref="item.index"]',
basicDataButton: `vn-menu-item a[ui-sref="item.card.data"]`,
typeSelect: `vn-autocomplete[field="$ctrl.item.typeFk"] input`,
- typeSelectOptionTwo: `vn-autocomplete[field="$ctrl.item.typeFk"] vn-drop-down ul > li:nth-child(2)`,
+ typeSelectOptionThree: `vn-autocomplete[field="$ctrl.item.typeFk"] vn-drop-down ul > li:nth-child(3)`,
intrastatSelect: `vn-autocomplete[field="$ctrl.item.intrastatFk"] input`,
intrastatSelectOptionOne: `vn-autocomplete[field="$ctrl.item.intrastatFk"] vn-drop-down ul > li:nth-child(1)`,
nameInput: `vn-horizontal:nth-child(2) > ${components.vnTextfield}`,
@@ -297,7 +297,7 @@ export default {
ticketPackages: {
packagesButton: `vn-menu-item a[ui-sref="ticket.card.package.index"]`,
firstPackageSelect: `vn-autocomplete[label="Package"] > div > div > input`,
- firstPackageSelectOptionThree: `vn-autocomplete[label="Package"] vn-drop-down ul > li:nth-child(3)`,
+ firstPackageSelectOptionTwo: `vn-autocomplete[label="Package"] vn-drop-down ul > li:nth-child(2)`,
firstQuantityInput: `vn-textfield[label="Quantity"] input`,
firstRemovePackageButton: `vn-icon[vn-tooltip="Remove package"]`,
addPackageButton: `vn-icon-button[vn-tooltip="Add package"]`,
diff --git a/e2e/paths/item-module/02_edit_item_basic_data.spec.js b/e2e/paths/item-module/02_edit_item_basic_data.spec.js
index 3a1bde0b1..f0361aa9c 100644
--- a/e2e/paths/item-module/02_edit_item_basic_data.spec.js
+++ b/e2e/paths/item-module/02_edit_item_basic_data.spec.js
@@ -49,7 +49,7 @@ describe('Item', () => {
.clearInput(selectors.itemBasicData.nameInput)
.type(selectors.itemBasicData.nameInput, 'Rose of Purity')
.waitToClick(selectors.itemBasicData.typeSelect)
- .waitToClick(selectors.itemBasicData.typeSelectOptionTwo)
+ .waitToClick(selectors.itemBasicData.typeSelectOptionThree)
.waitToClick(selectors.itemBasicData.intrastatSelect)
.waitToClick(selectors.itemBasicData.intrastatSelectOptionOne)
.clearInput(selectors.itemBasicData.relevancyInput)
diff --git a/e2e/paths/item-module/08_item_create_and_clone.spec.js b/e2e/paths/item-module/08_item_create_and_clone.spec.js
index 706977ac9..b74e65a18 100644
--- a/e2e/paths/item-module/08_item_create_and_clone.spec.js
+++ b/e2e/paths/item-module/08_item_create_and_clone.spec.js
@@ -65,7 +65,7 @@ describe('Item', () => {
return nightmare
.type(selectors.itemCreateView.name, 'Infinity Gauntlet')
.waitToClick(selectors.itemCreateView.typeSelect)
- .waitToClick(selectors.itemCreateView.typeSelectOptionOne)
+ .waitToClick(selectors.itemCreateView.typeSelectOptionThree)
.waitToClick(selectors.itemCreateView.intrastatSelect)
.waitToClick(selectors.itemCreateView.intrastatSelectOptionOne)
.waitToClick(selectors.itemCreateView.originSelect)
diff --git a/e2e/paths/ticket-module/04_create_ticket_packages.spec.js b/e2e/paths/ticket-module/04_create_ticket_packages.spec.js
index 0966f8e7e..916d7bf48 100644
--- a/e2e/paths/ticket-module/04_create_ticket_packages.spec.js
+++ b/e2e/paths/ticket-module/04_create_ticket_packages.spec.js
@@ -50,7 +50,7 @@ describe('Ticket Create packages path', () => {
.waitToClick(selectors.ticketPackages.firstRemovePackageButton)
.waitToClick(selectors.ticketPackages.addPackageButton)
.waitToClick(selectors.ticketPackages.firstPackageSelect)
- .waitToClick(selectors.ticketPackages.firstPackageSelectOptionThree)
+ .waitToClick(selectors.ticketPackages.firstPackageSelectOptionTwo)
.click(selectors.ticketPackages.savePackagesButton)
.waitForLastSnackbar()
.then(result => {
@@ -94,8 +94,8 @@ describe('Ticket Create packages path', () => {
it(`should create a new package with correct data`, () => {
return nightmare
.waitToClick(selectors.ticketPackages.firstPackageSelect)
- .waitToClick(selectors.ticketPackages.firstPackageSelectOptionThree)
- .waitForTextInInput(selectors.ticketPackages.firstPackageSelect, 'ShippingCost')
+ .waitToClick(selectors.ticketPackages.firstPackageSelectOptionTwo)
+ .waitForTextInInput(selectors.ticketPackages.firstPackageSelect, 'Legendary Box')
.click(selectors.ticketPackages.savePackagesButton)
.waitForLastSnackbar()
.then(result => {
@@ -108,10 +108,10 @@ describe('Ticket Create packages path', () => {
.click(selectors.ticketSales.saleButton)
.wait(selectors.ticketSales.firstPackageSelect)
.click(selectors.ticketPackages.packagesButton)
- .waitForTextInInput(selectors.ticketPackages.firstPackageSelect, 'ShippingCost')
+ .waitForTextInInput(selectors.ticketPackages.firstPackageSelect, 'Legendary Box')
.getInputValue(selectors.ticketPackages.firstPackageSelect)
.then(result => {
- expect(result).toEqual('ShippingCost');
+ expect(result).toEqual('Legendary Box');
});
});
diff --git a/services/db/install/dump/fixtures.sql b/services/db/install/dump/fixtures.sql
index 956e29971..4cc87d81d 100644
--- a/services/db/install/dump/fixtures.sql
+++ b/services/db/install/dump/fixtures.sql
@@ -441,10 +441,11 @@ INSERT INTO `vn`.`itemCategory`(`id`, `name`, `display`, `color`, `icon`)
INSERT INTO `vn`.`itemType`(`id`, `code`, `name`, `categoryFk`, `life`,`workerFk`, `isPackaging`)
VALUES
- (1, 'CRI', 'Crisantemo' , 2, 31, 5, 0),
- (2, 'ITG', 'Anthurium' , 1, 31, 5, 0),
- (3, 'WPN', 'Paniculata' , 2, 31, 5, 0),
- (4, 'PRT', 'Delivery ports', 3, 31, 5, 1);
+ (1, 'CRI', 'Crisantemo', 2, 31, 5, 0),
+ (2, 'ITG', 'Anthurium', 1, 31, 5, 0),
+ (3, 'WPN', 'Paniculata', 2, 31, 5, 0),
+ (4, 'PRT', 'Delivery ports', 3, NULL, 5, 1),
+ (5, 'CON', 'Container', 3, NULL, 5, 1);
INSERT INTO `vn`.`ink`(`id`, `name`, `picture`, `showOrder`)
VALUES
@@ -487,12 +488,14 @@ INSERT INTO `vn`.`intrastat`(`id`, `description`, `taxClassFk`, `taxCodeFk`)
INSERT INTO `vn`.`item`(`id`, `name`,`typeFk`,`size`,`inkFk`,`category`,`stems`,`originFk`,`description`,`producerFk`,`intrastatFk`,`isOnOffer`,`expenceFk`,`isBargain`,`comment`,`relevancy`,`image`,`taxClassFk`,`longName`,`subName`,`tag5`,`value5`,`tag6`,`value6`,`tag7`,`value7`,`tag8`,`value8`)
VALUES
- (1 , 'Gem of Time', 2, 70, 'AMA', 'EXT', 1 , 1, 'One of the infinity gems' , 1 , 06021010, 0, 2000000000, 0, NULL, 0, 66540, 1, 'Gem of Time' , NULL, 'Medida', '70', 'Color', 'Amarillo' , 'Categoria', 'EXT', 'Tallos', '1'),
- (2 , 'Gem of Mind', 2, 70, 'AZL', 'EXT', 1 , 2, 'One of the infinity gems' , 1 , 06021010, 0, 2000000000, 0, NULL, 0, 65540, 1, 'Gem of Mind' , NULL, 'Medida', '70', 'Color', 'Azul' , 'Categoria', 'EXT', 'Tallos', '1'),
- (3 , 'Iron Patriot', 1, 60, 'AMR', 'EXT', 1 , 3, 'Rhodeys armor' , 1 , 05080000, 0, 4751000000, 0, NULL, 0, 61692, 1, 'Iron Patriot', NULL, 'Medida', '60', 'Color', 'Rosa/Amarillo', 'Categoria', 'EXT', 'Tallos', '1'),
- (4 , 'Mark I', 1, 60, 'AMR', 'EXT', 1 , 1, 'Iron Mans first armor' , 1 , 05080000, 1, 4751000000, 0, NULL, 0, 66090, 2, 'Mark I' , NULL, 'Medida', '60', 'Color', 'Rosa/Amarillo', 'Categoria', 'EXT', 'Tallos', '1'),
- (5 , 'Mjolnir', 3, 30, 'AZL', 'EXT', 1 , 2, 'Thors hammer!' , 2 , 06021010, 1, 4751000000, 0, NULL, 0, 67350, 2, 'Mjolnir' , NULL, 'Medida', '30', 'Color', 'Azul' , 'Categoria', 'EXT', 'Tallos', '1'),
- (71, 'ShippingCost', 4, NULL, NULL, NULL, NULL, 1, NULL , NULL, 06021010, 1, 4751000000, 0, NULL, 0, NULL, 2, 'ShippingCost', NULL, NULL , NULL, NULL , NULL , NULL, NULL , NULL , NULL);
+ (1 , 'Gem of Time', 2, 70, 'AMA', 'EXT', 1 , 1, 'One of the infinity gems', 1, 06021010, 0, 2000000000, 0, NULL, 0, 66540, 1, 'Gem of Time', NULL, 'Medida', '70', 'Color', 'Amarillo' , 'Categoria', 'EXT', 'Tallos', '1'),
+ (2 , 'Gem of Mind', 2, 70, 'AZL', 'EXT', 1 , 2, 'One of the infinity gems', 1, 06021010, 0, 2000000000, 0, NULL, 0, 65540, 1, 'Gem of Mind', NULL, 'Medida', '70', 'Color', 'Azul' , 'Categoria', 'EXT', 'Tallos', '1'),
+ (3 , 'Iron Patriot', 1, 60, 'AMR', 'EXT', 1 , 3, 'Rhodeys armor', 1, 05080000, 0, 4751000000, 0, NULL, 0, 61692, 1, 'Iron Patriot', NULL, 'Medida', '60', 'Color', 'Rosa/Amarillo', 'Categoria', 'EXT', 'Tallos', '1'),
+ (4 , 'Mark I', 1, 60, 'AMR', 'EXT', 1 , 1, 'Iron Mans first armor', 1, 05080000, 1, 4751000000, 0, NULL, 0, 66090, 2, 'Mark I', NULL, 'Medida', '60', 'Color', 'Rosa/Amarillo', 'Categoria', 'EXT', 'Tallos', '1'),
+ (5 , 'Mjolnir', 3, 30, 'GRE', 'EXT', 1 , 2, 'Thors hammer!', 2, 06021010, 1, 4751000000, 0, NULL, 0, 67350, 2, 'Mjolnir', NULL, 'Medida', '30', 'Color', 'Azul' , 'Categoria', 'EXT', 'Tallos', '1'),
+ (6 , 'Broken Box', 5, 30, 'GRE', 'EXT', 1 , 2, NULL, NULL, 06021010, 0, 4751000000, 0, NULL, 0, 67350, 2, 'Legendary Box', NULL, 'Medida', '30', 'Color', 'Gris' , NULL, NULL, NULL, NULL),
+ (7 , 'Legendary Box', 5, 90, 'AZL', 'EXT', 1 , 2, NULL, NULL, 06021010, 0, 4751000000, 0, NULL, 0, 67350, 2, 'Broken Box', NULL, 'Medida', '90', 'Color', 'Gris' , NULL, NULL, NULL, NULL),
+ (71, 'ShippingCost', 4, NULL, NULL, NULL, NULL, 1, NULL, NULL, 06021010, 1, 4751000000, 0, NULL, 0, NULL, 2, 'ShippingCost', NULL, NULL , NULL, NULL , NULL , NULL, NULL, NULL, NULL);
INSERT INTO `vn`.`expedition`(`id`, `agencyModeFk`, `ticketFk`, `isBox`, `created`, `itemFk`, `counter`, `checked`, `workerFk`)
VALUES
@@ -505,15 +508,14 @@ INSERT INTO `vn`.`expedition`(`id`, `agencyModeFk`, `ticketFk`, `isBox`, `create
INSERT INTO `vn`.`packaging`(`id`, `volume`, `width`, `height`, `depth`, `isPackageReturnable`, `created`, `itemFk`, `price`)
VALUES
- (1, 0.00, 10, 10, 0, 0, CURDATE(), 1, 1.50),
- (2, 100.00, 20, 20, 0, 0, CURDATE(), 2, 1.00),
- (3, 50.00, 30, 30, 0, 1, CURDATE(), 71, 0.00);
+ (1, 0.00, 10, 10, 0, 0, CURDATE(), 6, 1.50),
+ (2, 100.00, 20, 20, 0, 0, CURDATE(), 7, 1.00);
INSERT INTO `vn`.`ticketPackaging`(`id`, `ticketFk`, `packagingFk`, `quantity`, `created`, `pvp`)
VALUES
- ( 1, 1, 1, 2, CURDATE(), NULL),
- ( 2, 2, 2, 1, CURDATE(), NULL),
- ( 3, 3, 3, 4, CURDATE(), NULL);
+ ( 1, 1, 2, 2, CURDATE(), NULL),
+ ( 2, 2, 2, 1, CURDATE(), NULL),
+ ( 3, 3, 2, 4, CURDATE(), NULL);
INSERT INTO `vn`.`sale`(`id`, `itemFk`, `ticketFk`, `concept`, `quantity`, `price`, `discount`, `reserved`, `isPicked`, `created`)
VALUES
diff --git a/services/ticket/common/methods/packaging/specs/listPackaging.spec.js b/services/ticket/common/methods/packaging/specs/listPackaging.spec.js
index 3b503d833..36530e36e 100644
--- a/services/ticket/common/methods/packaging/specs/listPackaging.spec.js
+++ b/services/ticket/common/methods/packaging/specs/listPackaging.spec.js
@@ -6,7 +6,7 @@ describe('ticket listPackaging()', () => {
let response = await app.models.Packaging.listPackaging(filter);
expect(response[0].name).toBeDefined();
- expect(response[0].name).toEqual('Gem of Time');
+ expect(response[0].name).toEqual('Broken Box');
});
});
From fe80a6b8c842c0d6a666c794ca4eedf9bb37235c Mon Sep 17 00:00:00 2001
From: gerard
Date: Thu, 13 Sep 2018 12:36:52 +0200
Subject: [PATCH 28/34] Bug #651 Al borrar un ticket no se cambia su estado a
eliminado
---
services/loopback/common/methods/ticket/deleted.js | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/services/loopback/common/methods/ticket/deleted.js b/services/loopback/common/methods/ticket/deleted.js
index 36bffaf95..2636963a8 100644
--- a/services/loopback/common/methods/ticket/deleted.js
+++ b/services/loopback/common/methods/ticket/deleted.js
@@ -1,5 +1,5 @@
module.exports = Self => {
- Self.remoteMethod('deleted', {
+ Self.remoteMethodCtx('deleted', {
description: 'Sets the isDeleted value of a ticket to 1',
accessType: '',
accepts: [{
@@ -19,7 +19,15 @@ module.exports = Self => {
}
});
- Self.deleted = async params => {
- return await Self.app.models.Ticket.update({id: params.id}, {isDeleted: '1'});
+ Self.deleted = async(ctx, params) => {
+ await Self.app.models.Ticket.update({id: params.id}, {isDeleted: '1'});
+
+ if (ctx.req.accessToken) {
+ let token = ctx.req.accessToken;
+ let currentUserId = token && token.userId;
+ let worker = await Self.app.models.Worker.findOne({where: {userFk: currentUserId}});
+ params.workerFk = worker.id;
+ }
+ return await Self.app.models.TicketTracking.create({ticketFk: params.id, stateFk: 17, workerFk: params.workerFk});
};
};
From a2506a787e201ce14b968f54fe0b058aac07a0d9 Mon Sep 17 00:00:00 2001
From: gerard
Date: Thu, 13 Sep 2018 12:39:56 +0200
Subject: [PATCH 29/34] updated description
---
services/loopback/common/methods/sale/moveToTicket.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/services/loopback/common/methods/sale/moveToTicket.js b/services/loopback/common/methods/sale/moveToTicket.js
index 9f6a47d70..254ad859e 100644
--- a/services/loopback/common/methods/sale/moveToTicket.js
+++ b/services/loopback/common/methods/sale/moveToTicket.js
@@ -2,7 +2,7 @@ let UserError = require('../../helpers').UserError;
module.exports = Self => {
Self.remoteMethod('moveToTicket', {
- description: 'Change the state of a ticket',
+ description: 'Moves a line to a given ticket',
accessType: '',
accepts: [{
arg: 'params',
From 1e3b3b0ffaa247a990fbe297a0297e308eb60eea Mon Sep 17 00:00:00 2001
From: gerard
Date: Thu, 13 Sep 2018 12:46:32 +0200
Subject: [PATCH 30/34] Tarea #644 Crear componente Input Number
---
client/salix/src/styles/misc.scss | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/client/salix/src/styles/misc.scss b/client/salix/src/styles/misc.scss
index bb722f87b..7e3619cf1 100644
--- a/client/salix/src/styles/misc.scss
+++ b/client/salix/src/styles/misc.scss
@@ -17,6 +17,12 @@ input[type=reset]::-moz-focus-inner
{
border: none;
}
+.unselectable {
+ -moz-user-select: none;
+ -webkit-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+}
.link{
text-decoration: underline;
cursor: pointer;
From a6b63d4113e22108b5726722a8c94f59b8870201 Mon Sep 17 00:00:00 2001
From: gerard
Date: Thu, 13 Sep 2018 14:01:26 +0200
Subject: [PATCH 31/34] Bug #652 El componente textarea muestra mal el label
---
client/core/src/components/textarea/style.scss | 18 ++++++++++++++++++
.../core/src/components/textarea/textarea.html | 2 +-
2 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/client/core/src/components/textarea/style.scss b/client/core/src/components/textarea/style.scss
index 91b29b3cf..52f579e24 100644
--- a/client/core/src/components/textarea/style.scss
+++ b/client/core/src/components/textarea/style.scss
@@ -1,6 +1,24 @@
+@import 'colors';
+
vn-textarea {
& > .mdl-textfield {
width: initial;
display: block;
}
+ label {
+ position: absolute;
+ bottom: 0;
+ pointer-events: none;
+ color: $secondary-font-color;
+ transition-duration: .2s;
+ transition-timing-function: cubic-bezier(.4,0,.2,1);
+ }
+ & textarea.ng-not-empty+label.placeholder{
+ top: 5px;
+ color: $main-01;
+ padding: 0;
+ font-size: 12px;
+ visibility: visible!important;
+ content: normal!important;
+ }
}
\ No newline at end of file
diff --git a/client/core/src/components/textarea/textarea.html b/client/core/src/components/textarea/textarea.html
index b60aef926..9bd419e55 100644
--- a/client/core/src/components/textarea/textarea.html
+++ b/client/core/src/components/textarea/textarea.html
@@ -5,5 +5,5 @@
ng-disabled="$ctrl.disabled"
ng-model="$ctrl.model">
-
+
\ No newline at end of file
From 7211277b25dbadaf40015851afb25aac2f681f9f Mon Sep 17 00:00:00 2001
From: Carlos Jimenez <=>
Date: Thu, 13 Sep 2018 14:29:59 +0200
Subject: [PATCH 32/34] amends on spec file
---
.../methods/ticket/specs/deleted.spec.js | 20 ++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)
diff --git a/services/loopback/common/methods/ticket/specs/deleted.spec.js b/services/loopback/common/methods/ticket/specs/deleted.spec.js
index 7b1e8e2dc..fda330111 100644
--- a/services/loopback/common/methods/ticket/specs/deleted.spec.js
+++ b/services/loopback/common/methods/ticket/specs/deleted.spec.js
@@ -1,15 +1,21 @@
const app = require(`${servicesDir}/ticket/server/server`);
describe('ticket deleted()', () => {
- it('should call the getShipped method', async() => {
- let oldTicket = await app.models.Ticket.findOne({where: {id: 1}});
+ let ticket;
+ afterAll(async() => {
+ ticket.isDeleted = 0;
+ await app.models.Ticket.upsert(ticket);
+ });
+
+ it('YOU should work this out', async() => {
+ ticket = await app.models.Ticket.findOne({where: {id: 1}});
+
+ expect(ticket.isDeleted).toEqual(false);
- expect(oldTicket.isDeleted).toEqual(false);
await app.models.Ticket.deleted({id: 1});
- let ticket = await app.models.Ticket.findOne({where: {id: 1}, fields: ['isDeleted']});
- expect(ticket.isDeleted).toEqual(true);
- oldTicket.isDeleted = 0;
- await app.models.Ticket.upsert(oldTicket);
+ let deletedTicket = await app.models.Ticket.findOne({where: {id: 1}, fields: ['isDeleted']});
+
+ expect(deletedTicket.isDeleted).toEqual(true);
});
});
From 447044faf92f98994463fd780c0d6a832dc6212c Mon Sep 17 00:00:00 2001
From: Carlos Jimenez <=>
Date: Thu, 13 Sep 2018 14:33:09 +0200
Subject: [PATCH 33/34] task updated #651 Al borrar un ticket no se cambia su
estado a eliminado
---
services/loopback/common/methods/ticket/specs/deleted.spec.js | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/services/loopback/common/methods/ticket/specs/deleted.spec.js b/services/loopback/common/methods/ticket/specs/deleted.spec.js
index fda330111..5ca217537 100644
--- a/services/loopback/common/methods/ticket/specs/deleted.spec.js
+++ b/services/loopback/common/methods/ticket/specs/deleted.spec.js
@@ -1,6 +1,7 @@
const app = require(`${servicesDir}/ticket/server/server`);
-describe('ticket deleted()', () => {
+// #651 Al borrar un ticket no se cambia su estado a eliminado
+xdescribe('ticket deleted()', () => {
let ticket;
afterAll(async() => {
ticket.isDeleted = 0;
From d39365b63bda05ece52e7415572b507f7deba8c7 Mon Sep 17 00:00:00 2001
From: gerard
Date: Thu, 13 Sep 2018 15:13:42 +0200
Subject: [PATCH 34/34] Bug #651 Al borrar un ticket no se cambia su estado a
eliminado test
---
.../common/methods/ticket/specs/deleted.spec.js | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/services/loopback/common/methods/ticket/specs/deleted.spec.js b/services/loopback/common/methods/ticket/specs/deleted.spec.js
index 5ca217537..84c7b784c 100644
--- a/services/loopback/common/methods/ticket/specs/deleted.spec.js
+++ b/services/loopback/common/methods/ticket/specs/deleted.spec.js
@@ -1,22 +1,25 @@
const app = require(`${servicesDir}/ticket/server/server`);
-// #651 Al borrar un ticket no se cambia su estado a eliminado
-xdescribe('ticket deleted()', () => {
+describe('ticket deleted()', () => {
let ticket;
+
afterAll(async() => {
- ticket.isDeleted = 0;
await app.models.Ticket.upsert(ticket);
+ await app.models.TicketTracking.create({ticketFk: ticket.id, stateFk: 3});
});
- it('YOU should work this out', async() => {
+ it('should change the state of a ticket to deleted, and set the property isDeleted true', async() => {
ticket = await app.models.Ticket.findOne({where: {id: 1}});
expect(ticket.isDeleted).toEqual(false);
-
- await app.models.Ticket.deleted({id: 1});
+ ctx = {req: {accessToken: {userId: 9}}};
+ params = {id: 1};
+ await app.models.Ticket.deleted(ctx, params);
let deletedTicket = await app.models.Ticket.findOne({where: {id: 1}, fields: ['isDeleted']});
+ let changedState = await app.models.TicketState.findOne({where: {id: 1}});
expect(deletedTicket.isDeleted).toEqual(true);
+ expect(changedState.stateFk).toEqual(17);
});
});