From 3e0fd10b41160f7ae3eb23a89aa8eb1874459c89 Mon Sep 17 00:00:00 2001 From: Joan Sanchez Date: Thu, 6 Feb 2020 14:33:28 +0100 Subject: [PATCH 1/5] 2029 - Item request fixes & searchbar filters working --- modules/item/front/request/index.html | 30 ++++++++++----------------- modules/item/front/request/index.js | 2 +- 2 files changed, 12 insertions(+), 20 deletions(-) diff --git a/modules/item/front/request/index.html b/modules/item/front/request/index.html index 6d6e786dc..e0cf05107 100644 --- a/modules/item/front/request/index.html +++ b/modules/item/front/request/index.html @@ -6,14 +6,15 @@ order="shipped DESC, isOk ASC"> - + suggested-filter="$ctrl.filter.where" + info="Search request by id or alias"> + + @@ -21,8 +22,6 @@ Ticket ID Shipped - Warehouse - SalesPerson Description Requested Price @@ -47,15 +46,7 @@ {{::request.shipped | date: 'dd/MM/yyyy'}} - {{::request.warehouse}} - - - {{::request.salesPersonNickname}} - - - {{::request.description}} + {{::request.description}} {{::request.quantity}} {{::request.price | currency: 'EUR':2}} @@ -82,7 +73,7 @@ - + + translate-attr="{title: 'Discard'}" + tabindex="-1"> @@ -124,7 +116,7 @@
Specify the reasons to deny this request
- diff --git a/modules/item/front/request/index.js b/modules/item/front/request/index.js index b56df41a8..b91e5d6d1 100644 --- a/modules/item/front/request/index.js +++ b/modules/item/front/request/index.js @@ -86,6 +86,7 @@ export default class Controller extends Component { } onSearch(params) { + console.log(params); if (params) this.$.model.applyFilter(null, params); else @@ -96,7 +97,6 @@ export default class Controller extends Component { this.selectedRequest = requestId; this.$.denyReason.parent = event.target; this.$.denyReason.show(); - document.querySelector('vn-item-request vn-textarea textArea').focus(); } clear() { From 5cd3bde306c5dc7766a4a2fffe9f667b98dc4028 Mon Sep 17 00:00:00 2001 From: Bernat Exposito Domenech Date: Thu, 6 Feb 2020 14:59:00 +0100 Subject: [PATCH 2/5] ticketRequest front test --- modules/ticket/front/request/index/index.js | 2 + .../ticket/front/request/index/index.spec.js | 62 +++++++++++++++++++ .../ticket/front/request/index/locale/es.yml | 3 +- 3 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 modules/ticket/front/request/index/index.spec.js diff --git a/modules/ticket/front/request/index/index.js b/modules/ticket/front/request/index/index.js index 38d800aeb..e8cb54f22 100644 --- a/modules/ticket/front/request/index/index.js +++ b/modules/ticket/front/request/index/index.js @@ -89,6 +89,8 @@ class Controller { isEditable(isOk) { if (isOk != null) return true; + + return false; } } diff --git a/modules/ticket/front/request/index/index.spec.js b/modules/ticket/front/request/index/index.spec.js new file mode 100644 index 000000000..90d71f062 --- /dev/null +++ b/modules/ticket/front/request/index/index.spec.js @@ -0,0 +1,62 @@ +import './index'; + +describe('Ticket', () => { + describe('Component vnTicketRequestIndex', () => { + let controller; + let $scope; + + beforeEach(ngModule('ticket')); + + beforeEach(angular.mock.inject(($componentController, $rootScope) => { + $scope = $rootScope.$new(); + + controller = $componentController('vnTicketRequestIndex', {$scope}); + })); + + describe('getRequestState()', () => { + it('should return New when the state is null', () => { + let state = null; + let result = controller.getRequestState(state); + + expect(result).toEqual('New'); + }); + + it('should return Denied when the state is false', () => { + let state = false; + let result = controller.getRequestState(state); + + expect(result).toEqual('Denied'); + }); + + it('should return Acepted when the state is true', () => { + let state = true; + let result = controller.getRequestState(state); + + expect(result).toEqual('Acepted'); + }); + }); + + describe('isEditable()', () => { + it('should return true when isOk is true', () => { + let isOk = true; + let result = controller.isEditable(isOk); + + expect(result).toEqual(true); + }); + + it('should return true when isOk is false', () => { + let isOk = false; + let result = controller.isEditable(isOk); + + expect(result).toEqual(true); + }); + + it('should return true when isOk is null', () => { + let isOk = null; + let result = controller.isEditable(isOk); + + expect(result).toEqual(false); + }); + }); + }); +}); diff --git a/modules/ticket/front/request/index/locale/es.yml b/modules/ticket/front/request/index/locale/es.yml index 65442cde1..1adcbad49 100644 --- a/modules/ticket/front/request/index/locale/es.yml +++ b/modules/ticket/front/request/index/locale/es.yml @@ -3,4 +3,5 @@ Atender: Comprador Remove request: Eliminar petición New request: Crear petición Sale id: Id linea -Requester: Solicitante \ No newline at end of file +Requester: Solicitante +New purchase request: Nueva petición de compra \ No newline at end of file From b623646f257e902d49179e6696864165aad7f02d Mon Sep 17 00:00:00 2001 From: Joan Sanchez Date: Fri, 7 Feb 2020 07:02:27 +0100 Subject: [PATCH 3/5] removed console --- modules/item/front/request/index.js | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/item/front/request/index.js b/modules/item/front/request/index.js index b91e5d6d1..3684a1911 100644 --- a/modules/item/front/request/index.js +++ b/modules/item/front/request/index.js @@ -86,7 +86,6 @@ export default class Controller extends Component { } onSearch(params) { - console.log(params); if (params) this.$.model.applyFilter(null, params); else From 2f81727594dae619bbc5e0a1cac455edc4e42e86 Mon Sep 17 00:00:00 2001 From: Bernat Exposito Domenech Date: Fri, 7 Feb 2020 07:43:22 +0100 Subject: [PATCH 4/5] reload_card_volume --- modules/route/front/card/index.html | 2 +- modules/route/front/descriptor/index.js | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/modules/route/front/card/index.html b/modules/route/front/card/index.html index 051d8714f..9e0ae4e8c 100644 --- a/modules/route/front/card/index.html +++ b/modules/route/front/card/index.html @@ -1,5 +1,5 @@ - + diff --git a/modules/route/front/descriptor/index.js b/modules/route/front/descriptor/index.js index cfa718855..1beb7e095 100644 --- a/modules/route/front/descriptor/index.js +++ b/modules/route/front/descriptor/index.js @@ -70,7 +70,7 @@ class Controller { let url = `Routes/${this.route.id}/updateVolume`; this.$http.post(url).then(() => { this.vnApp.showSuccess(this.$translate.instant('Volume updated')); - if (this.card) this.card.reload(); + this.cardReload(); }); } } @@ -82,10 +82,8 @@ ngModule.component('vnRouteDescriptor', { template: require('./index.html'), bindings: { route: '<', + cardReload: '&?', quicklinks: '<' }, - require: { - card: '^?vnRouteCard' - }, controller: Controller }); From b192cb15c09055006af9230b1b3db3e5d042988c Mon Sep 17 00:00:00 2001 From: Joan Sanchez Date: Fri, 7 Feb 2020 07:47:11 +0100 Subject: [PATCH 5/5] Show data save snackbar on auto-save --- e2e/paths/06-claim-module/04_claim_action.spec.js | 5 ++--- modules/claim/front/action/index.html | 7 +++++-- modules/claim/front/action/index.js | 4 ++++ 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/e2e/paths/06-claim-module/04_claim_action.spec.js b/e2e/paths/06-claim-module/04_claim_action.spec.js index 460cd49ae..c0bc91365 100644 --- a/e2e/paths/06-claim-module/04_claim_action.spec.js +++ b/e2e/paths/06-claim-module/04_claim_action.spec.js @@ -32,12 +32,11 @@ describe('Claim action path', () => { expect(result).toEqual('Data saved!'); }); - // #2036 claim.action destinatario it('should edit the second line destination field', async() => { await page.autocompleteSearch(selectors.claimAction.secondLineDestination, 'Bueno'); - // const result = await page.waitForLastSnackbar(); + const result = await page.waitForLastSnackbar(); - // expect(result).toEqual('Data saved!'); + expect(result).toEqual('Data saved!'); }); it('should delete the first line', async() => { diff --git a/modules/claim/front/action/index.html b/modules/claim/front/action/index.html index 7c663eacd..31db6dabd 100644 --- a/modules/claim/front/action/index.html +++ b/modules/claim/front/action/index.html @@ -1,7 +1,10 @@ - + data="$ctrl.salesClaimed" + auto-load="true" + auto-save="true" + on-save="$ctrl.onSave()">