From ae4533c61eec239112b0867fc7025a5fd404cdfb Mon Sep 17 00:00:00 2001 From: Carlos Jimenez Ruiz Date: Mon, 30 Sep 2019 13:16:31 +0200 Subject: [PATCH 1/6] =?UTF-8?q?#1726=20client.index=20a=C3=B1adir=20icono?= =?UTF-8?q?=20de=20Listado=20tickets?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/client/front/index/index.spec.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/client/front/index/index.spec.js b/modules/client/front/index/index.spec.js index 9a881ed4b..b7319667d 100644 --- a/modules/client/front/index/index.spec.js +++ b/modules/client/front/index/index.spec.js @@ -13,8 +13,8 @@ describe('Client index', () => { controller = $componentController('vnClientIndex', {$scope, $state}); })); - describe('x()', () => { - it('should request to patch the propagation of tax status', () => { + describe('filterTickets()', () => { + it('should navigate to the ticket index using params as filter', () => { const client = {id: 101}; const event = {preventDefault: () => {}}; spyOn(event, 'preventDefault'); From 5b38889a7274f9c3e588889af91aa9248c2e434e Mon Sep 17 00:00:00 2001 From: Carlos Jimenez Ruiz Date: Mon, 30 Sep 2019 14:49:04 +0200 Subject: [PATCH 2/6] #1739 claim.detail dialog add cambiar campos --- modules/claim/front/detail/index.html | 12 ++++++---- modules/claim/front/detail/index.js | 4 ++-- modules/claim/front/detail/index.spec.js | 28 ++++++++++++++++++++++-- 3 files changed, 36 insertions(+), 8 deletions(-) diff --git a/modules/claim/front/detail/index.html b/modules/claim/front/detail/index.html index 5fc032e33..f4aea3247 100644 --- a/modules/claim/front/detail/index.html +++ b/modules/claim/front/detail/index.html @@ -45,7 +45,7 @@ + ng-click="$ctrl.showItemDescriptor($event, saleClaimed.sale.itemFk)"> {{::saleClaimed.sale.concept}} @@ -87,7 +87,6 @@ - Id Landed Quantity Description @@ -98,10 +97,15 @@ - {{sale.saleFk}} {{sale.landed | dateTime: 'dd/MM/yyyy'}} {{sale.quantity}} - {{sale.concept}} + + + {{sale.concept}} + + {{sale.price | currency: 'EUR':2}} {{sale.discount}} % diff --git a/modules/claim/front/detail/index.js b/modules/claim/front/detail/index.js index 137ad4d70..1c2cb9e97 100644 --- a/modules/claim/front/detail/index.js +++ b/modules/claim/front/detail/index.js @@ -111,8 +111,8 @@ class Controller { return total; } - // Item Descriptor - showDescriptor(event, itemFk) { + showItemDescriptor(event, itemFk) { + event.stopImmediatePropagation(); this.$.descriptor.itemFk = itemFk; this.$.descriptor.parent = event.target; this.$.descriptor.show(); diff --git a/modules/claim/front/detail/index.spec.js b/modules/claim/front/detail/index.spec.js index c25d6fe43..bb3866b4c 100644 --- a/modules/claim/front/detail/index.spec.js +++ b/modules/claim/front/detail/index.spec.js @@ -3,6 +3,7 @@ import crudModel from 'core/mocks/crud-model'; describe('claim', () => { describe('Component vnClaimDetail', () => { + let $scope; let controller; let $httpBackend; let $state; @@ -12,12 +13,16 @@ describe('claim', () => { $translateProvider.translations('en', {}); })); - beforeEach(angular.mock.inject(($componentController, _$state_, _$httpBackend_) => { + beforeEach(angular.mock.inject(($componentController, _$state_, _$httpBackend_, $rootScope) => { + $scope = $rootScope.$new(); + $scope.descriptor = { + show: () => {} + }; $httpBackend = _$httpBackend_; $httpBackend.when('GET', 'claim/api/Claims/ClaimBeginnings').respond({}); $state = _$state_; aclService = {hasAny: () => true}; - controller = $componentController('vnClaimDetail', {$state, aclService}); + controller = $componentController('vnClaimDetail', {$state, aclService, $scope}); controller.salesToClaim = [{saleFk: 1}, {saleFk: 2}]; controller.salesClaimed = [{id: 1, sale: {}}]; controller.claim = {ticketFk: 1}; @@ -119,5 +124,24 @@ describe('claim', () => { expect(controller.$.model.refresh).toHaveBeenCalledWith(); }); }); + + describe('showItemDescriptor()', () => { + it('should configure the descriptor then show it', () => { + const itemId = 500; + const event = { + stopImmediatePropagation: () => {}, + target: 'the target element' + }; + spyOn(event, 'stopImmediatePropagation'); + spyOn(controller.$.descriptor, 'show'); + + controller.showItemDescriptor(event, itemId); + + expect(event.stopImmediatePropagation).toHaveBeenCalledWith(); + expect(controller.$.descriptor.itemFk).toEqual(itemId); + expect(controller.$.descriptor.parent).toEqual(event.target); + expect(controller.$.descriptor.show).toHaveBeenCalledWith(); + }); + }); }); }); From fe95406594d0c4a074ab4feba7d46bdcf2719c02 Mon Sep 17 00:00:00 2001 From: Joan Sanchez Date: Tue, 1 Oct 2019 08:14:08 +0200 Subject: [PATCH 3/6] Ticket list order by zone hour #1728 --- modules/ticket/front/index/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ticket/front/index/index.html b/modules/ticket/front/index/index.html index 5c12ccb0a..8b2060e42 100644 --- a/modules/ticket/front/index/index.html +++ b/modules/ticket/front/index/index.html @@ -50,7 +50,7 @@ Agency Warehouse Invoice - Closure + Closure Total From 26be791cf00e46290a0d3b96436db9be4d5bd7c5 Mon Sep 17 00:00:00 2001 From: Joan Sanchez Date: Tue, 1 Oct 2019 10:35:27 +0200 Subject: [PATCH 4/6] fixed styles --- front/salix/components/app/style.scss | 1 + front/salix/styles/index.js | 1 + front/salix/styles/photo-list.scss | 38 ++++++++++++++++++++++++ modules/claim/front/dms/index/index.html | 5 ++-- modules/claim/front/dms/index/style.scss | 1 + modules/claim/front/summary/index.html | 5 ++-- modules/claim/front/summary/style.scss | 36 ++++------------------ 7 files changed, 51 insertions(+), 36 deletions(-) create mode 100644 front/salix/styles/photo-list.scss diff --git a/front/salix/components/app/style.scss b/front/salix/components/app/style.scss index a2082dc8e..fa9f0706f 100644 --- a/front/salix/components/app/style.scss +++ b/front/salix/components/app/style.scss @@ -3,6 +3,7 @@ body { background-color: $color-bg; overflow: auto; + height: 100% } vn-app { height: inherit; diff --git a/front/salix/styles/index.js b/front/salix/styles/index.js index 806021463..969793a32 100644 --- a/front/salix/styles/index.js +++ b/front/salix/styles/index.js @@ -14,3 +14,4 @@ import './summary.scss'; import './descriptor.scss'; import './list.scss'; import './modal-form.scss'; +import './photo-list.scss'; diff --git a/front/salix/styles/photo-list.scss b/front/salix/styles/photo-list.scss new file mode 100644 index 000000000..c573d06a2 --- /dev/null +++ b/front/salix/styles/photo-list.scss @@ -0,0 +1,38 @@ +@import "./variables"; +.photo-list { + justify-content: center; + align-items: flex-start; + align-content: flex-start; + flex-wrap: wrap; + + .photo { + box-sizing: border-box; + transition: all 0.5s; + padding: $pad-small; + position: relative; + opacity: 0.7; + width: 28em; + + .image { + box-shadow: 0 2px 2px 0 rgba(0,0,0,.14), + 0 3px 1px -2px rgba(0,0,0,.2), + 0 1px 5px 0 rgba(0,0,0,.12); + overflow: hidden; + cursor: zoom-in; + height: 100%; + + img { + max-width: 100% + } + } + .actions { + position: absolute; + right: 1em; + top: 1em + } + } + + .photo:hover { + opacity: 1 + } +} \ No newline at end of file diff --git a/modules/claim/front/dms/index/index.html b/modules/claim/front/dms/index/index.html index 91dad4e1e..9b24c65ca 100644 --- a/modules/claim/front/dms/index/index.html +++ b/modules/claim/front/dms/index/index.html @@ -6,9 +6,8 @@
-
-
diff --git a/modules/claim/front/dms/index/style.scss b/modules/claim/front/dms/index/style.scss index 067a7c95c..d02798940 100644 --- a/modules/claim/front/dms/index/style.scss +++ b/modules/claim/front/dms/index/style.scss @@ -10,6 +10,7 @@ vn-claim-dms-index { .photo { width: 32em; + height: 18em; } } diff --git a/modules/claim/front/summary/index.html b/modules/claim/front/summary/index.html index 7877987d1..65d08777b 100644 --- a/modules/claim/front/summary/index.html +++ b/modules/claim/front/summary/index.html @@ -83,9 +83,8 @@

Photos

-
-
diff --git a/modules/claim/front/summary/style.scss b/modules/claim/front/summary/style.scss index 280e519c2..38136f24a 100644 --- a/modules/claim/front/summary/style.scss +++ b/modules/claim/front/summary/style.scss @@ -1,36 +1,12 @@ @import "./variables"; -.photo-list { - justify-content: center; - align-items: flex-start; - align-content: flex-start; - flex-wrap: wrap; - +vn-claim-summary { .photo { - box-sizing: border-box; - padding: $pad-small; - position: relative; - opacity: 0.7; - transition: all 0.5s; - width: 28em; - - .image { - border: 2px solid $color-bg-dark; - border-radius: 0.2em; - overflow: hidden; - - img, video { - max-width: 100% - } - } - .actions { - position: absolute; - right: 1em; - top: 1em - } + height: 15.5em; } - - .photo:hover { - opacity: 1 + .photo .image { + border: 2px solid $color-bg-dark; + border-radius: 0.2em; } + } \ No newline at end of file From cef28307d03f858ccbfc1db83d5d52b90314dfd5 Mon Sep 17 00:00:00 2001 From: Carlos Jimenez Ruiz Date: Tue, 1 Oct 2019 10:47:06 +0200 Subject: [PATCH 5/6] #1660 ticket.log si el usuario es un cliente falla --- modules/worker/front/log/index.html | 10 ++++------ modules/worker/front/log/index.js | 1 + 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/modules/worker/front/log/index.html b/modules/worker/front/log/index.html index 8ba6b285b..1a4ac0a5f 100644 --- a/modules/worker/front/log/index.html +++ b/modules/worker/front/log/index.html @@ -31,10 +31,9 @@
Changed by: {{::log.user.name | dashIfEmpty}} + translate>{{::log.user.name | dashIfEmpty}}
@@ -53,10 +52,9 @@ {{::log.user.name | dashIfEmpty}} + translate>{{::log.user.name | dashIfEmpty}} diff --git a/modules/worker/front/log/index.js b/modules/worker/front/log/index.js index cd85833ab..4a577658b 100644 --- a/modules/worker/front/log/index.js +++ b/modules/worker/front/log/index.js @@ -43,6 +43,7 @@ export default class Controller { showWorkerDescriptor(event, workerFk) { if (event.defaultPrevented) return; + if (!workerFk) return; event.preventDefault(); event.stopPropagation(); From e8a9de6acdf325810efe1687f3b2a79c0c0047d9 Mon Sep 17 00:00:00 2001 From: Carlos Jimenez Ruiz Date: Tue, 1 Oct 2019 11:06:20 +0200 Subject: [PATCH 6/6] ticket.index.total warning css range from 1 to 50 --- modules/ticket/front/index/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/ticket/front/index/index.js b/modules/ticket/front/index/index.js index d2e9646a1..2a2f3a238 100644 --- a/modules/ticket/front/index/index.js +++ b/modules/ticket/front/index/index.js @@ -103,7 +103,8 @@ export default class Controller { } totalPriceColor(ticket) { - if (parseInt(ticket.total) < 50) + const total = parseInt(ticket.total); + if (total > 0 && total < 50) return 'warning'; }