From 8878593bbef94166a3ae53c5901ea232c8977c02 Mon Sep 17 00:00:00 2001 From: Joan Date: Tue, 29 May 2018 14:33:29 +0200 Subject: [PATCH] Show item descriptor on itemFk click --- client/ticket/src/component/index.html | 4 +- client/ticket/src/component/index.js | 10 +++++ client/ticket/src/component/style.scss | 46 +++++++++++++++-------- client/ticket/src/expedition/index.html | 4 +- client/ticket/src/expedition/index.js | 11 ++++++ client/ticket/src/sale-checked/index.html | 4 +- client/ticket/src/sale-checked/index.js | 12 +++++- client/ticket/src/sale/index.html | 4 +- client/ticket/src/summary/index.html | 8 +++- client/ticket/src/summary/index.js | 15 +++++++- client/ticket/src/volume/index.html | 5 ++- client/ticket/src/volume/index.js | 10 +++++ 12 files changed, 105 insertions(+), 28 deletions(-) diff --git a/client/ticket/src/component/index.html b/client/ticket/src/component/index.html index 15aa71f43..11d600bb7 100644 --- a/client/ticket/src/component/index.html +++ b/client/ticket/src/component/index.html @@ -36,7 +36,8 @@ {{::sale.itemFk}} + }}" number pointer + ng-click="$ctrl.showDescriptor($event, sale.itemFk)">{{::sale.itemFk}} @@ -69,3 +70,4 @@ + diff --git a/client/ticket/src/component/index.js b/client/ticket/src/component/index.js index 4eb51fe70..2c912c33c 100644 --- a/client/ticket/src/component/index.js +++ b/client/ticket/src/component/index.js @@ -43,6 +43,16 @@ class Controller extends FilterTicketList { } return sum; } + + showDescriptor(event, itemFk) { + this.$scope.descriptor.itemFk = itemFk; + this.$scope.descriptor.parent = event.target; + this.$scope.descriptor.show(); + } + + onDescriptorLoad() { + this.$scope.popover.relocate(); + } } Controller.$inject = ['$scope', '$timeout', '$state']; diff --git a/client/ticket/src/component/style.scss b/client/ticket/src/component/style.scss index a08ba23a5..08a16c8f0 100644 --- a/client/ticket/src/component/style.scss +++ b/client/ticket/src/component/style.scss @@ -1,27 +1,41 @@ -vn-ticket-components .vn-grid { - tbody:not(:last-child) { - border-bottom: none; - } +vn-ticket-components { + vn-fetched-tags { + & vn-horizontal { + flex-direction: column; + text-align: center; - tfoot tr:first-child td { - padding-top: 10px !important; + & .inline-tag { + display: inline-block; + float: none + } + } } - tr { - td { - padding-top: .1em !important; - padding-bottom: .1em !important; + .vn-grid { + tbody:not(:last-child) { + border-bottom: none; } - td.first { + tfoot tr:first-child td { padding-top: 10px !important; } + + tr { + td { + padding-top: .1em !important; + padding-bottom: .1em !important; + } - td.last { - padding-bottom: 10px !important; + td.first { + padding-top: 10px !important; + } + + td.last { + padding-bottom: 10px !important; + } + } + tr:not(:first-child):not(:last-child), { + border-bottom: none; } } - tr:not(:first-child):not(:last-child), { - border-bottom: none; - } } \ No newline at end of file diff --git a/client/ticket/src/expedition/index.html b/client/ticket/src/expedition/index.html index cc4e3ebb4..8da3bbfb5 100644 --- a/client/ticket/src/expedition/index.html +++ b/client/ticket/src/expedition/index.html @@ -25,7 +25,8 @@ vn-tooltip="delete expedition" ng-click="$ctrl.deleteExpedition(expedition)">delete - {{::expedition.itemFk}} + {{::expedition.itemFk}} {{::expedition.item.name}} {{::expedition.package.name}} {{::expedition.counter}} @@ -41,3 +42,4 @@ + diff --git a/client/ticket/src/expedition/index.js b/client/ticket/src/expedition/index.js index 4eb91af50..e4f980306 100644 --- a/client/ticket/src/expedition/index.js +++ b/client/ticket/src/expedition/index.js @@ -4,6 +4,7 @@ import FilterTicketList from '../filter-ticket-list'; class Controller extends FilterTicketList { constructor($scope, $timeout, $stateParams, $http) { super($scope, $timeout, $stateParams); + this.$scope = $scope; this.params = $stateParams; this.$http = $http; } @@ -13,6 +14,16 @@ class Controller extends FilterTicketList { () => this.$.index.accept() ); } + + showDescriptor(event, itemFk) { + this.$scope.descriptor.itemFk = itemFk; + this.$scope.descriptor.parent = event.target; + this.$scope.descriptor.show(); + } + + onDescriptorLoad() { + this.$scope.popover.relocate(); + } } Controller.$inject = ['$scope', '$timeout', '$state', '$http']; diff --git a/client/ticket/src/sale-checked/index.html b/client/ticket/src/sale-checked/index.html index e8662802c..00de7cec2 100644 --- a/client/ticket/src/sale-checked/index.html +++ b/client/ticket/src/sale-checked/index.html @@ -20,7 +20,8 @@ disabled="true"> - {{::sale.itemFk}} + {{::sale.itemFk}} {{::sale.quantity}} @@ -34,3 +35,4 @@ + diff --git a/client/ticket/src/sale-checked/index.js b/client/ticket/src/sale-checked/index.js index 5feb145c6..cdeccfa1c 100644 --- a/client/ticket/src/sale-checked/index.js +++ b/client/ticket/src/sale-checked/index.js @@ -4,9 +4,19 @@ import FilterTicketList from '../filter-ticket-list'; class Controller extends FilterTicketList { constructor($scope, $timeout, $state) { super($scope, $timeout, $state); - + this.$scope = $scope; this.onOrder('quantity', 'ASC'); } + + showDescriptor(event, itemFk) { + this.$scope.descriptor.itemFk = itemFk; + this.$scope.descriptor.parent = event.target; + this.$scope.descriptor.show(); + } + + onDescriptorLoad() { + this.$scope.popover.relocate(); + } } Controller.$inject = ['$scope', '$timeout', '$state']; diff --git a/client/ticket/src/sale/index.html b/client/ticket/src/sale/index.html index 97c74893f..6834bbc5f 100644 --- a/client/ticket/src/sale/index.html +++ b/client/ticket/src/sale/index.html @@ -62,7 +62,5 @@ - - - + diff --git a/client/ticket/src/summary/index.html b/client/ticket/src/summary/index.html index da04f99da..f8c39d2a2 100644 --- a/client/ticket/src/summary/index.html +++ b/client/ticket/src/summary/index.html @@ -73,7 +73,10 @@ vn-tooltip="delete expedition" ng-click="$ctrl.deleteExpedition(expedition)">warning --> - {{("000000"+sale.itemFk).slice(-6)}} + + {{("000000"+sale.itemFk).slice(-6)}} + {{::sale.quantity}} {{::sale.price | currency:'€':2}} @@ -84,4 +87,5 @@ - \ No newline at end of file + + diff --git a/client/ticket/src/summary/index.js b/client/ticket/src/summary/index.js index cb17ba909..2e208b4dc 100644 --- a/client/ticket/src/summary/index.js +++ b/client/ticket/src/summary/index.js @@ -2,7 +2,8 @@ import ngModule from '../module'; import './style.scss'; class Controller { - constructor($http) { + constructor($scope, $http) { + this.$scope = $scope; this.$http = $http; } @@ -15,9 +16,19 @@ class Controller { this.summary = res.data; }); } + + showDescriptor(event, itemFk) { + this.$scope.descriptor.itemFk = itemFk; + this.$scope.descriptor.parent = event.target; + this.$scope.descriptor.show(); + } + + onDescriptorLoad() { + this.$scope.popover.relocate(); + } } -Controller.$inject = ['$http']; +Controller.$inject = ['$scope', '$http']; ngModule.component('vnTicketSummary', { template: require('./index.html'), diff --git a/client/ticket/src/volume/index.html b/client/ticket/src/volume/index.html index 0f2863bd5..9bab229d6 100644 --- a/client/ticket/src/volume/index.html +++ b/client/ticket/src/volume/index.html @@ -23,7 +23,8 @@ - {{::sale.itemFk}} + {{::sale.itemFk}} {{::sale.quantity}} {{::sale.volume.m3 | number:3}} @@ -38,3 +39,5 @@ + + diff --git a/client/ticket/src/volume/index.js b/client/ticket/src/volume/index.js index 43ef6ba0c..d984d9a3b 100644 --- a/client/ticket/src/volume/index.js +++ b/client/ticket/src/volume/index.js @@ -28,6 +28,16 @@ class Controller extends FilterTicketList { } }); } + + showDescriptor(event, itemFk) { + this.$scope.descriptor.itemFk = itemFk; + this.$scope.descriptor.parent = event.target; + this.$scope.descriptor.show(); + } + + onDescriptorLoad() { + this.$scope.popover.relocate(); + } } Controller.$inject = ['$scope', '$http', '$translate', '$timeout', '$state'];