From af6a9d8022db8af4a01d8d28af1f45398ad858a5 Mon Sep 17 00:00:00 2001 From: Joan Sanchez Date: Mon, 4 Feb 2019 12:14:07 +0100 Subject: [PATCH 1/4] fixed zone treeview bugs --- front/core/components/treeview/child.html | 2 +- front/core/components/treeview/index.js | 1 + modules/agency/front/index/index.js | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/front/core/components/treeview/child.html b/front/core/components/treeview/child.html index 437e7ca7d..af5fe128b 100644 --- a/front/core/components/treeview/child.html +++ b/front/core/components/treeview/child.html @@ -5,7 +5,7 @@ - diff --git a/front/core/components/treeview/index.js b/front/core/components/treeview/index.js index 6449ec450..e732d4347 100644 --- a/front/core/components/treeview/index.js +++ b/front/core/components/treeview/index.js @@ -20,6 +20,7 @@ export default class Treeview extends Component { refresh() { this.model.refresh().then(() => { this.data = this.model.data; + console.log(this.data); this.repaintAll(); }); } diff --git a/modules/agency/front/index/index.js b/modules/agency/front/index/index.js index 6c2d250c5..0958059af 100644 --- a/modules/agency/front/index/index.js +++ b/modules/agency/front/index/index.js @@ -16,7 +16,7 @@ export default class Controller { case 'search': return /^\d+$/.test(value) ? {id: value} - : {name: {regexp: value}}; + : {name: {like: `%${value}%`}}; case 'warehouseFk': case 'agencyModeFk': return {[param]: value}; From 879c9b8877664f4ee15d91fdd6897d5382ac44bb Mon Sep 17 00:00:00 2001 From: Gerard Date: Mon, 4 Feb 2019 12:24:47 +0100 Subject: [PATCH 2/4] #1093 ticket.descriptor ha dejado de funcionar en el modulo item --- .../item/front/ticket-descriptor/addStowaway.js | 8 +++----- modules/item/front/ticket-descriptor/index.html | 5 +++-- modules/item/front/ticket-descriptor/index.js | 15 ++++++++++++--- .../front/ticket-descriptor/removeStowaway.js | 8 +++----- modules/ticket/front/card/index.html | 2 +- 5 files changed, 22 insertions(+), 16 deletions(-) diff --git a/modules/item/front/ticket-descriptor/addStowaway.js b/modules/item/front/ticket-descriptor/addStowaway.js index b1e530850..514d46503 100644 --- a/modules/item/front/ticket-descriptor/addStowaway.js +++ b/modules/item/front/ticket-descriptor/addStowaway.js @@ -20,7 +20,7 @@ class Controller { let params = {id: this.possibleStowaways[index].id, shipFk: this.ticket.id}; this.$http.post(`/api/Stowaways/`, params) .then(() => { - this.card.reload(); + this.cardReload(); this.vnApp.showSuccess(this.$translate.instant('Data saved!')); }); } @@ -40,9 +40,7 @@ ngModule.component('vnAddStowaway', { template: require('./addStowaway.html'), controller: Controller, bindings: { - ticket: '<' - }, - require: { - card: '^vnTicketCard' + ticket: '<', + cardReload: '&?' } }); diff --git a/modules/item/front/ticket-descriptor/index.html b/modules/item/front/ticket-descriptor/index.html index 1dd69d7b8..3e23a2175 100644 --- a/modules/item/front/ticket-descriptor/index.html +++ b/modules/item/front/ticket-descriptor/index.html @@ -100,6 +100,7 @@ show-field="id" value-field="id" vn-tooltip="Ship stowaways" + tooltip-position="up" data="$ctrl.ticket.ship" on-change="$ctrl.goToTicket(value)"> @@ -152,5 +153,5 @@ question="You are going to delete this ticket" message="Continue anyway?"> - - \ No newline at end of file + + \ No newline at end of file diff --git a/modules/item/front/ticket-descriptor/index.js b/modules/item/front/ticket-descriptor/index.js index 91e323ff8..948994701 100644 --- a/modules/item/front/ticket-descriptor/index.js +++ b/modules/item/front/ticket-descriptor/index.js @@ -11,7 +11,7 @@ class Controller { this.moreOptions = [ {callback: this.showAddTurnDialog, name: 'Add turn', show: true}, {callback: this.showDeleteTicketDialog, name: 'Delete ticket', show: true}, - {callback: this.showAddStowaway, name: 'Add stowaway', show: true}, + {callback: this.showAddStowaway, name: 'Add stowaway', show: () => this.isTicketModule()}, {callback: this.showRemoveStowaway, name: 'Remove stowaway', show: () => this.shouldShowRemoveStowaway()}, /* callback: this.showChangeShipped, name: 'Change shipped hour', show: true} */ ]; @@ -37,8 +37,16 @@ class Controller { } } + isTicketModule() { + let path = this.$state.getCurrentPath(); + if (path[1].state.name === 'ticket') + return true; + + return false; + } + shouldShowRemoveStowaway() { - if (!this._ticket) + if (!this._ticket || !this.isTicketModule()) return false; return (this._ticket.stowaway || (this._ticket.ship && this._ticket.ship.length > 0)); @@ -157,7 +165,8 @@ Controller.$inject = ['$state', '$scope', '$http', 'vnApp', '$translate']; ngModule.component('vnTicketDescriptor', { template: require('./index.html'), bindings: { - ticket: '<' + ticket: '<', + cardReload: '&' }, controller: Controller }); diff --git a/modules/item/front/ticket-descriptor/removeStowaway.js b/modules/item/front/ticket-descriptor/removeStowaway.js index 6d4e966bf..9553a8a66 100644 --- a/modules/item/front/ticket-descriptor/removeStowaway.js +++ b/modules/item/front/ticket-descriptor/removeStowaway.js @@ -46,7 +46,7 @@ class Controller { deleteStowaway(response) { if (response === 'ACCEPT') { this.$http.delete(`/api/Stowaways/${this.stowawayToDelete.id}`).then(res => { - this.card.reload(); + this.cardReload(); this.vnApp.showSuccess(this.$translate.instant('Data saved!')); }); } @@ -72,9 +72,7 @@ ngModule.component('vnRemoveStowaway', { template: require('./removeStowaway.html'), controller: Controller, bindings: { - ticket: '<' - }, - require: { - card: '^vnTicketCard' + ticket: '<', + cardReload: '&?' } }); diff --git a/modules/ticket/front/card/index.html b/modules/ticket/front/card/index.html index ca8c7d88b..99f8933f3 100644 --- a/modules/ticket/front/card/index.html +++ b/modules/ticket/front/card/index.html @@ -1,6 +1,6 @@
- +
From 3869742fd7a3bc08fae68eaca4cc273361879129 Mon Sep 17 00:00:00 2001 From: Gerard Date: Mon, 4 Feb 2019 12:41:38 +0100 Subject: [PATCH 3/4] =?UTF-8?q?#1088=20ticket.descriptor=20a=C3=B1adir=20p?= =?UTF-8?q?olizon=20interval=20server=20error?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/ticket/back/methods/ticket/getPossibleStowaways.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/ticket/back/methods/ticket/getPossibleStowaways.js b/modules/ticket/back/methods/ticket/getPossibleStowaways.js index 4ff5fa9d5..581a0a9c3 100644 --- a/modules/ticket/back/methods/ticket/getPossibleStowaways.js +++ b/modules/ticket/back/methods/ticket/getPossibleStowaways.js @@ -20,6 +20,10 @@ module.exports = Self => { Self.getPossibleStowaways = async ticketFk => { let ship = await Self.app.models.Ticket.findById(ticketFk); + + if (!ship || !ship.shipped) + return []; + let lowestDate = new Date(ship.shipped.getTime()); lowestDate.setHours(0, 0, -1, 0); From bce67487c187bc564f5187fb0d34d1e85ab87ca5 Mon Sep 17 00:00:00 2001 From: Joan Sanchez Date: Mon, 4 Feb 2019 15:21:10 +0100 Subject: [PATCH 4/4] catalog filter requery fix #1034 --- modules/order/front/filter/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/order/front/filter/index.js b/modules/order/front/filter/index.js index aa3f3cc3d..e4a25eb52 100644 --- a/modules/order/front/filter/index.js +++ b/modules/order/front/filter/index.js @@ -27,9 +27,9 @@ class Controller { } set order(value) { - this._order = value; + if (!value.id || this._order) return; - if (!value.id) return; + this._order = value; this.$scope.$$postDigest(() => { let category;