From 3f325df13306ccc143a07ad546d9e7cf59e46c7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Mon, 9 Sep 2024 20:25:55 +0200 Subject: [PATCH] feat: individual transportation types for participants --- .../Private/Assets/js/myep/BookingEdit.vue | 34 ++++------- .../myep/components/ParticipantSizesForm.vue | 12 ++-- .../js/myep/components/PickupSelect.vue | 9 ++- .../myep/components/TransportationSelect.vue | 59 +++++++++++++------ 4 files changed, 67 insertions(+), 47 deletions(-) diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/myep/BookingEdit.vue b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/myep/BookingEdit.vue index 9019c600..67e4a616 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/myep/BookingEdit.vue +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/myep/BookingEdit.vue @@ -119,13 +119,17 @@ :participant="participant" :mutable="mutableFields.services.mutable" v-on:updated="onParticipantDataUpdated($event, index)"/> +
@@ -402,9 +406,14 @@ this.dirty = true; }, onTransportationUpdated (event) { - let factor = event.action === 'select' ? -1 : 1; - this.services.transportation[event.service.id].available += this.participantData.length * factor; - this.bookingData.selectedTransportationIds = event.selectedTransportationIds; + let services = this.services.transportation + if (event.action === 'select') { + services[event.service.id].available--; + } else { + services[event.service.id].available++; + } + this.services.transportation = services + this.dirty = true; }, hasSelectedRentals (participant) { @@ -463,7 +472,6 @@ method: 'PUT', body: JSON.stringify({ participantData: this.participantData, - selectedTransportations: this.selectedTransportations, remarks: this.bookingData.remarks, }) } @@ -501,22 +509,6 @@ } return filteredContingents; }, - selectedTransportations () { - let selectedTransportations = []; - for (let id of this.bookingData.selectedTransportationIds) { - selectedTransportations.push(this.services.transportation[id]); - } - return selectedTransportations; - }, - showPickups () { - for (let id of this.bookingData.selectedTransportationIds) { - if ('BUS' === this.services.transportation[id].subType) { - return true; - } - } - - return false; - }, totalPrice () { let totalPrice = 0; this.participantData.forEach(participant => { diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/myep/components/ParticipantSizesForm.vue b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/myep/components/ParticipantSizesForm.vue index 8c23a656..f718f9a5 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/myep/components/ParticipantSizesForm.vue +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/myep/components/ParticipantSizesForm.vue @@ -7,17 +7,17 @@
- - -
diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/myep/components/PickupSelect.vue b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/myep/components/PickupSelect.vue index d8962038..ed7b63e1 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/myep/components/PickupSelect.vue +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/myep/components/PickupSelect.vue @@ -1,5 +1,5 @@