diff --git a/package-lock.json b/package-lock.json index f76d2702..e794a5c4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -751,6 +751,12 @@ "integrity": "sha1-nufoM3KQ2pUoggGmpX9BcDF4MN4=", "dev": true }, + "babel-plugin-syntax-object-rest-spread": { + "version": "6.13.0", + "resolved": "http://registry.npmjs.org/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz", + "integrity": "sha1-/WU28rzhODb/o6VFjEkDpZe7O/U=", + "dev": true + }, "babel-plugin-syntax-trailing-function-commas": { "version": "6.22.0", "resolved": "https://registry.npmjs.org/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.22.0.tgz", @@ -1013,6 +1019,16 @@ "babel-runtime": "^6.22.0" } }, + "babel-plugin-transform-object-rest-spread": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-object-rest-spread/-/babel-plugin-transform-object-rest-spread-6.26.0.tgz", + "integrity": "sha1-DzZpLVD+9rfi1LOsFHgTepY7ewY=", + "dev": true, + "requires": { + "babel-plugin-syntax-object-rest-spread": "^6.8.0", + "babel-runtime": "^6.26.0" + } + }, "babel-plugin-transform-regenerator": { "version": "6.26.0", "resolved": "https://registry.npmjs.org/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.26.0.tgz", diff --git a/package.json b/package.json index e7999da0..69c711c3 100644 --- a/package.json +++ b/package.json @@ -32,6 +32,7 @@ "devDependencies": { "@symfony/webpack-encore": "^0.19.0", "autoprefixer": "^8.6.5", + "babel-plugin-transform-object-rest-spread": "^6.26.0", "node-sass": "^4.9.3", "postcss-loader": "^2.1.6", "sass-loader": "^6.0.7", diff --git a/web/typo3conf/ext/ep_products/Classes/Controller/AjaxSearchController.php b/web/typo3conf/ext/ep_products/Classes/Controller/AjaxSearchController.php index b496aba9..8b7433cf 100644 --- a/web/typo3conf/ext/ep_products/Classes/Controller/AjaxSearchController.php +++ b/web/typo3conf/ext/ep_products/Classes/Controller/AjaxSearchController.php @@ -84,8 +84,8 @@ class AjaxSearchController extends ActionController /** * @param FilterSettings $filterSettings * @param integer $referringPageUid - * * @return string + * @throws \Doctrine\DBAL\DBALException */ public function searchresultAction(FilterSettings $filterSettings = null, $referringPageUid = null) { @@ -115,7 +115,6 @@ class AjaxSearchController extends ActionController $options = [ 'defaultDetailPageUid' => $this->settings['defaultDetailPageUid'], 'referringPageUid' => $referringPageUid, - 'filterSettings' => $filterSettings, ]; $this->searchResultUrlService->process($searchResult, $options); diff --git a/web/typo3conf/ext/ep_products/Classes/Controller/ProductController.php b/web/typo3conf/ext/ep_products/Classes/Controller/ProductController.php index e873aff5..2a3c5542 100644 --- a/web/typo3conf/ext/ep_products/Classes/Controller/ProductController.php +++ b/web/typo3conf/ext/ep_products/Classes/Controller/ProductController.php @@ -27,7 +27,6 @@ namespace EP\EpProducts\Controller; * This copyright notice MUST APPEAR in all copies of the script! ***************************************************************/ -use EP\EpProducts\Domain\Model\FilterSettings; use EP\EpProducts\Domain\Model\Hotel; use EP\EpProducts\Domain\Model\Product; use EP\EpProducts\Domain\Repository\HotelRepository; @@ -36,15 +35,12 @@ use EP\EpProducts\Service\DateService; use EP\EpProducts\Service\FilterService; use EP\EpProducts\Service\HotelDataService; use EP\EpProducts\Service\ProductDataService; -use EP\EpProducts\Traits\RequestArgumentTypeConversionTrait; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Extbase\Mvc\Controller\ActionController; class ProductController extends ActionController { - use RequestArgumentTypeConversionTrait; - /** * @var \EP\EpProducts\Domain\Repository\ProductRepository */ @@ -101,22 +97,15 @@ class ProductController extends ActionController $this->filterService = $filterService; } - public function initializeAction() - { - $this->processFilterSettingsArgument(); - } - /** * @param Product $product * @param Hotel $hotel - * @param FilterSettings $filterSettings - * @param int $referringPageUid + * @throws \TYPO3\CMS\Extbase\Mvc\Exception\StopActionException + * @throws \TYPO3\CMS\Extbase\Mvc\Exception\UnsupportedRequestTypeException */ public function detailAction( Product $product = null, - Hotel $hotel = null, - FilterSettings $filterSettings = null, - $referringPageUid = null + Hotel $hotel = null ) { // Get product to display from flexform settings if not provided via url @@ -138,8 +127,6 @@ class ProductController extends ActionController if ($product->getHotels()->count() > 1) { $arguments = [ 'product' => $product, - 'filterSettings' => $filterSettings, - 'referringPageUid' => $referringPageUid, ]; $this->forward('hotelList', null, null, $arguments); } @@ -153,11 +140,8 @@ class ProductController extends ActionController $noInfoConceptUids = GeneralUtility::trimExplode(',', $this->settings['noInfoConceptUids']); $isProductWithNoInfoConcept = ($product->getConcept() !== null) && \in_array($product->getConcept()->getUid(), $noInfoConceptUids, false); $this->view->assignMultiple([ - 'filterSettings' => $filterSettings, 'hotel' => $hotel, 'product' => $product, - 'referringPageUid' => $referringPageUid, - 'currentPageUid' => $GLOBALS['TSFE']->id, 'isProductWithExcludedConcept' => $isProductWithExcludedConcept, 'isProductWithNoInfoConcept' => $isProductWithNoInfoConcept, ]); @@ -181,21 +165,16 @@ class ProductController extends ActionController /** * @param Product $product - * @param FilterSettings $filterSettings - * @param int $referringPageUid */ public function hotelListAction( - Product $product, - FilterSettings $filterSettings = null, - $referringPageUid = null + Product $product ) { $hotels = $this->hotelDataService->getList($product); $this->view->assignMultiple([ - 'filterSettings' => $filterSettings, 'hotels' => $hotels, 'product' => $product, - 'referringPageUid' => $referringPageUid, + 'currentPageUid' => $GLOBALS['TSFE']->id, 'linkHotel' => true, ]); } diff --git a/web/typo3conf/ext/ep_products/Classes/Controller/SearchController.php b/web/typo3conf/ext/ep_products/Classes/Controller/SearchController.php index 172499bf..4cc16036 100644 --- a/web/typo3conf/ext/ep_products/Classes/Controller/SearchController.php +++ b/web/typo3conf/ext/ep_products/Classes/Controller/SearchController.php @@ -110,25 +110,15 @@ class SearchController extends ActionController */ public function searchresultAction(SearchParams $searchParams = null, FilterSettings $filterSettings = null) { - if ($searchParams === null) { - $searchParams = new SearchParams(); - } else { + if ($searchParams !== null) { $this->logSearch($searchParams); - } - if ($filterSettings === null) { $filterSettings = FilterSettings::fromSearchParams($searchParams); } - $excludedConceptUids = GeneralUtility::trimExplode(',', $this->settings['excludedConceptUids']); - $filterOptions = $this->filterService->getFilterOptions($filterSettings, $excludedConceptUids); - if ($filterOptions === null) { - $filterOptions = $this->filterService->getFilterOptions($this->defaultFilterSettings, $excludedConceptUids); - } $this->view->assignMultiple([ 'detailPageUid' => $this->settings['detailPageUid'], 'referringPageUid' => $GLOBALS['TSFE']->id, 'filterSettings' => $filterSettings, - 'filterOptions' => $filterOptions, ]); } diff --git a/web/typo3conf/ext/ep_products/Classes/Domain/Repository/DateRepository.php b/web/typo3conf/ext/ep_products/Classes/Domain/Repository/DateRepository.php index 2d0eef0c..2b661552 100644 --- a/web/typo3conf/ext/ep_products/Classes/Domain/Repository/DateRepository.php +++ b/web/typo3conf/ext/ep_products/Classes/Domain/Repository/DateRepository.php @@ -129,13 +129,13 @@ class DateRepository extends AbstractRepository $qb = $this->getDbConnection()->createQueryBuilder(); $query = $qb - ->select('hotel uid') + ->select('hotel as uid') ->addSelectLiteral('REPLACE(hotel_name, "\r\n", " ") name') ->from('tx_epproducts_domain_model_date', 'date') ->where('product_searchable = 1') ->andWhere($qb->expr()->orX( - $qb->expr()->like('LOWER(hotel_name) COLLATE utf8_bin',':searchName'), - $qb->expr()->like('LOWER(hotel_keywords) COLLATE utf8_bin', ':searchKeywords') + $qb->expr()->like('hotel_name',':searchName'), + $qb->expr()->like('hotel_keywords', ':searchKeywords') )) ->orderBy('hotel_name') ->groupBy('hotel_name') @@ -170,14 +170,14 @@ class DateRepository extends AbstractRepository ->from('tx_epproducts_domain_model_date', 'date') ->where('product_searchable = 1') ->andWhere($qb->expr()->orX( - $qb->expr()->like('LOWER(product_name) COLLATE utf8_bin',':searchName'), - $qb->expr()->like('LOWER(product_keywords) COLLATE utf8_bin', ':searchKeywords'), - $qb->expr()->like('LOWER(country_name) COLLATE utf8_bin',':searchKeywords'), - $qb->expr()->like('LOWER(country_keywords) COLLATE utf8_bin', ':searchKeywords'), - $qb->expr()->like('LOWER(region_name) COLLATE utf8_bin', ':searchKeywords'), - $qb->expr()->like('LOWER(region_keywords) COLLATE utf8_bin', ':searchKeywords'), - $qb->expr()->like('LOWER(city_name) COLLATE utf8_bin', ':searchKeywords'), - $qb->expr()->like('LOWER(city_keywords) COLLATE utf8_bin', ':searchKeywords') + $qb->expr()->like('product_name',':searchName'), + $qb->expr()->like('product_keywords', ':searchKeywords'), + $qb->expr()->like('country_name',':searchKeywords'), + $qb->expr()->like('country_keywords', ':searchKeywords'), + $qb->expr()->like('region_name', ':searchKeywords'), + $qb->expr()->like('region_keywords', ':searchKeywords'), + $qb->expr()->like('city_name', ':searchKeywords'), + $qb->expr()->like('city_keywords', ':searchKeywords') )) ->orderBy('product_name') ->groupBy('product_name') @@ -218,8 +218,8 @@ class DateRepository extends AbstractRepository ->from('tx_epproducts_domain_model_date', 'date') ->where('product_searchable = 1') ->andWhere($qb->expr()->orX( - $qb->expr()->like('LOWER(' . $type . '_name) COLLATE utf8_bin',':searchName'), - $qb->expr()->like('LOWER(' . $type . '_keywords) COLLATE utf8_bin', ':searchKeywords') + $qb->expr()->like($type . '_name',':searchName'), + $qb->expr()->like($type . '_keywords', ':searchKeywords') )) ->orderBy($type . '_name') ->groupBy($type . '_name') diff --git a/web/typo3conf/ext/ep_products/Classes/Service/SearchResultUrlService.php b/web/typo3conf/ext/ep_products/Classes/Service/SearchResultUrlService.php index 42e53e2d..8069be3c 100644 --- a/web/typo3conf/ext/ep_products/Classes/Service/SearchResultUrlService.php +++ b/web/typo3conf/ext/ep_products/Classes/Service/SearchResultUrlService.php @@ -54,13 +54,9 @@ class SearchResultUrlService implements SingletonInterface public function process(SearchResult $searchResult, array $options) { $optionsResolver = new OptionsResolver(); - $optionsResolver->setRequired([ 'defaultDetailPageUid', 'referringPageUid', 'filterSettings' ]); - $optionsResolver->setAllowedTypes('filterSettings', FilterSettings::class); + $optionsResolver->setRequired([ 'defaultDetailPageUid', 'referringPageUid' ]); $resolvedOptions = $optionsResolver->resolve($options); - /** @var FilterSettings $filterSettings */ - $filterSettings = $resolvedOptions['filterSettings']; - $encodedFilterSettings = FilterSettingsEncoder::encode($filterSettings); $defaultDetailPageUid = $resolvedOptions['defaultDetailPageUid']; $referringPageUid = $resolvedOptions['referringPageUid']; @@ -75,7 +71,6 @@ class SearchResultUrlService implements SingletonInterface 'product' => $item['product']['uid'], 'hotel' => $item['hotel']['uid'], 'referringPageUid' => $referringPageUid, - 'filterSettings' => $encodedFilterSettings, ]; $uri = $this ->uriBuilder diff --git a/web/typo3conf/ext/ep_products/Classes/Traits/RequestArgumentTypeConversionTrait.php b/web/typo3conf/ext/ep_products/Classes/Traits/RequestArgumentTypeConversionTrait.php index 0e020575..289eb0c1 100644 --- a/web/typo3conf/ext/ep_products/Classes/Traits/RequestArgumentTypeConversionTrait.php +++ b/web/typo3conf/ext/ep_products/Classes/Traits/RequestArgumentTypeConversionTrait.php @@ -136,13 +136,13 @@ trait RequestArgumentTypeConversionTrait */ static protected function convertType($value) { - if (is_string($value) && (strtolower($value) === 'true' || strtolower($value) === 'false')) { + if (\is_string($value) && (strtolower($value) === 'true' || strtolower($value) === 'false')) { return strtolower($value) === 'true'; } - if (is_numeric($value)) { + if (\is_numeric($value)) { return (int) $value; } - if (is_array($value)) { + if (\is_array($value)) { return array_map(function($item) { return static::convertType($item); }, $value); diff --git a/web/typo3conf/ext/ep_theme/Resources/Private/Assets/js/_app.js b/web/typo3conf/ext/ep_theme/Resources/Private/Assets/js/_app.js index ebc3e046..172604ab 100644 --- a/web/typo3conf/ext/ep_theme/Resources/Private/Assets/js/_app.js +++ b/web/typo3conf/ext/ep_theme/Resources/Private/Assets/js/_app.js @@ -30,6 +30,8 @@ import EventPricetable from './components/EventPriceTable.vue' import ContactForm from './components/ContactForm.vue' import WatchlistToggle from './components/WatchlistToggle.vue' import Watchlist from './components/Watchlist.vue' +import HotelList from './components/HotelList.vue' +import ReferrerLink from './components/ReferrerLink.vue' // Define global constants const $window = $(window); @@ -59,7 +61,9 @@ new Vue({ EventPricetable, ContactForm, WatchlistToggle, - Watchlist + Watchlist, + HotelList, + ReferrerLink }, data () { return { diff --git a/web/typo3conf/ext/ep_theme/Resources/Private/Assets/js/_filteroptions.js b/web/typo3conf/ext/ep_theme/Resources/Private/Assets/js/_filteroptions.js new file mode 100644 index 00000000..3714a700 --- /dev/null +++ b/web/typo3conf/ext/ep_theme/Resources/Private/Assets/js/_filteroptions.js @@ -0,0 +1,13 @@ +export default { + priceRanges: {}, + destinations: {}, + concepts: {}, + pax: [], + nights: [], + hotelTypes: [], + boardTypes: [], + roomTypes: [], + dateFrom: null, + dateTo: null, + busAvailable: false +} diff --git a/web/typo3conf/ext/ep_theme/Resources/Private/Assets/js/_filtersettings.js b/web/typo3conf/ext/ep_theme/Resources/Private/Assets/js/_filtersettings.js index a188e98d..b6098ffb 100644 --- a/web/typo3conf/ext/ep_theme/Resources/Private/Assets/js/_filtersettings.js +++ b/web/typo3conf/ext/ep_theme/Resources/Private/Assets/js/_filtersettings.js @@ -10,6 +10,7 @@ export default { conceptUids: [], dateFrom: null, dateTo: null, + priceRange: 0, nights: 0, pax: 1, hotelTypes: [], diff --git a/web/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/DaterangeSelect.vue b/web/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/DaterangeSelect.vue index a3a7f77c..1b1213ef 100644 --- a/web/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/DaterangeSelect.vue +++ b/web/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/DaterangeSelect.vue @@ -80,15 +80,21 @@ } } }, - created () { + watch: { + minDate (date) { + this.picker.set('minDate', new Date(date)) + }, + maxDate (date) { + this.picker.set('maxDate', new Date(date)) + } + }, + mounted () { Vue.nextTick(() => { this.picker = $(this.$refs.field).flatpickr({ mode: 'range', dateFormat: 'd.m.Y', locale: German, inline: true, - minDate: new Date(this.minDate), - maxDate: new Date(this.maxDate), onChange: (selectedDates) => { if (selectedDates.length === 2) { this.selectedFrom = selectedDates[0]; diff --git a/web/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/HotelList.vue b/web/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/HotelList.vue new file mode 100644 index 00000000..5a2ddc71 --- /dev/null +++ b/web/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/HotelList.vue @@ -0,0 +1,35 @@ + diff --git a/web/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/PriceRangeSelect.vue b/web/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/PriceRangeSelect.vue index da7f4850..ceaa1460 100644 --- a/web/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/PriceRangeSelect.vue +++ b/web/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/PriceRangeSelect.vue @@ -31,6 +31,7 @@ required: true }, range: { + type: Number, default: 0 }, showLabel: { @@ -40,7 +41,7 @@ }, computed: { rangeLabel () { - if (this.rangeSelected === 0) { + if (this.rangeSelected === 0 || $.isEmptyObject(this.rangeOptions)) { return 'beliebig'; } let range = this.rangeOptions[this.rangeSelected]; @@ -64,8 +65,8 @@ this.$emit('selected', 0); }, optionSelect (value) { - this.rangeSelected = value; - this.$emit('selected', value); + this.rangeSelected = parseInt(value); + this.$emit('selected', parseInt(value)); } }, watch: { diff --git a/web/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/ProductDetail.vue b/web/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/ProductDetail.vue index 320b5953..425fd944 100644 --- a/web/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/ProductDetail.vue +++ b/web/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/ProductDetail.vue @@ -16,6 +16,8 @@ import dayjs from 'dayjs' import 'dayjs/locale/de' + import defaultFilterSettings from '../_filtersettings' + export default { components: { DatesTable, @@ -46,16 +48,12 @@ detailShow: false, loading: true, activeSection: null, - singleDate: false + singleDate: false, + filterSettings: defaultFilterSettings, + referringPage: null } }, props: { - filterSettings: { - type: Object, - default () { - return {} - } - }, argumentPrefix: { type: String, required: true @@ -190,6 +188,13 @@ } }, created () { + if (this.$session.has('filterSettings')) { + this.filterSettings = this.$session.get('filterSettings') + } + if (this.$session.has('referringPage')) { + this.referringPage = this.$session.get('referringPage'); + this.$session.remove('referringPage'); + } EventBus.$on('loadDatesTable', () => { this.loadDatesView(); }); diff --git a/web/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/ReferrerLink.vue b/web/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/ReferrerLink.vue new file mode 100644 index 00000000..bb39305d --- /dev/null +++ b/web/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/ReferrerLink.vue @@ -0,0 +1,28 @@ + + + diff --git a/web/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/SearchResult.vue b/web/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/SearchResult.vue index 32c8d064..b4a618fb 100644 --- a/web/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/SearchResult.vue +++ b/web/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/SearchResult.vue @@ -18,6 +18,7 @@ import 'dayjs/locale/de' import defaultFilterSettings from '../_filtersettings' + import defaultFilterOptions from '../_filteroptions' export default { components: { @@ -39,9 +40,8 @@ loading: false, resultData: {}, resultMeta: null, - defaultFilterSettings: defaultFilterSettings, - filterSettings: this.initialFilterSettings, - filterOptions: this.initialFilterOptions + filterSettings: defaultFilterSettings, + filterOptions: defaultFilterOptions } }, props: { @@ -51,18 +51,11 @@ }, initialFilterSettings: { type: Object, - default () { - return defaultFilterSettings; - } + default: null }, - initialFilterOptions: { - type: Object, - default () { - return defaultFilterSettings; - } - }, - referringPageUid: { - type: Number + referringPageUrl: { + type: String, + default: '' }, argumentPrefix: { type: String, @@ -141,62 +134,81 @@ }); }, resetFilterSettings () { - this.filterSettings = this.defaultFilterSettings; + this.updateFilterSettings(defaultFilterSettings); EventBus.$emit('filterSettingsReset'); this.loadResults(); }, updateDestination (destination) { - this.filterSettings.destinationUid = destination.uid; - this.filterSettings.destinationType = destination.type; - this.filterSettings.destinationName = destination.name; + this.updateFilterSettings({ + destinationUid: destination.uid, + destinationType: destination.type, + destinationName: destination.name + }); this.loadResults(); }, updateDestinations (destinations) { - this.filterSettings.countryUids = destinations.countryUids; - this.filterSettings.regionUids = destinations.regionUids; + this.updateFilterSettings({ + countryUids: destinations.countryUids, + regionUids: destinations.regionUids + }); this.loadResults(); }, updateConcepts (conceptUids) { - this.filterSettings.conceptUids = conceptUids; + this.updateFilterSettings({ conceptUids: conceptUids }); this.loadResults(); }, updateDateRange (range) { - this.filterSettings.dateFrom = (range.from !== null) ? dayjs(range.from).format('YYYY-MM-DD') : null; - this.filterSettings.dateTo = (range.to !== null) ? dayjs(range.to).format('YYYY-MM-DD') : null; + const dateFrom = (range.from !== null) ? dayjs(range.from).format('YYYY-MM-DD') : null; + const dateTo = (range.to !== null) ? dayjs(range.to).format('YYYY-MM-DD') : null; + this.updateFilterSettings({ dateFrom: dateFrom, dateTo: dateTo }); this.loadResults(); }, updateDateSelectMobile () { - if (this.filterSettings.dateFrom === '') { - this.filterSettings.dateFrom = null; + let dateFrom = this.filterSettings.dateFrom; + let dateTo = this.filterSettings.dateTo; + if (dateFrom === '') { + dateFrom = null; } - if (this.filterSettings.dateTo === '') { - this.filterSettings.dateTo = null; + if (dateTo === '') { + dateTo = null; } + this.updateFilterSettings({ dateFrom: dateFrom, dateTo: dateTo }); this.loadResults(); }, updatePriceRange (range) { - this.filterSettings.priceRange = range; + this.updateFilterSettings({ priceRange: range }); this.loadResults(); }, updatePax (pax) { - this.filterSettings.pax = pax; + this.updateFilterSettings({ pax: pax }); this.loadResults(); }, updateHotelTypes (hotelTypes) { - this.filterSettings.hotelTypes = hotelTypes; + this.updateFilterSettings({ hotelTypes: hotelTypes }); this.loadResults(); }, - updateBoardTypes (hotelTypes) { - this.filterSettings.boardTypes = hotelTypes; + updateBoardTypes (boardTypes) { + this.updateFilterSettings({ boardTypes: boardTypes }); this.loadResults(); }, updateRoomTypes (roomTypes) { - this.filterSettings.roomTypes = roomTypes; + this.updateFilterSettings({ roomTypes: roomTypes }); this.loadResults(); }, updateBus (bus) { - this.filterSettings.bus = bus; + this.updateFilterSettings({ bus: bus }); this.loadResults(); + }, + updateFilterSettings (settings) { + this.filterSettings = { ...this.filterSettings, ...settings }; + this.$session.set('filterSettings', this.filterSettings); + } + }, + created () { + if (!$.isEmptyObject(this.initialFilterSettings)) { + this.updateFilterSettings(this.initialFilterSettings) + } else if (this.$session.has('filterSettings')) { + this.updateFilterSettings(this.$session.get('filterSettings')) } }, mounted () { diff --git a/web/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/SearchResultItem.vue b/web/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/SearchResultItem.vue index a3ff98f4..4e2e8750 100644 --- a/web/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/SearchResultItem.vue +++ b/web/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/SearchResultItem.vue @@ -2,7 +2,8 @@
- + @@ -11,7 +12,7 @@ :title="item.hotel.images.resized.s[0].title" :alt="item.hotel.images.resized.s[0].alt"> - +
{{ section.concept.name }}
@@ -44,19 +45,21 @@
{{ item.dates.length > 1 ? 'Zeitraum' : 'Termin' }} {{ dateRange }} - + {{ item.dates.length }} Termin{{ item.dates.length > 1 ? 'e' : '' }} - +
{{ item.daytrip ? 'Tageweise buchbar' : nightsOptions }}
ab {{ item.minPrice }} € - + Details & Buchen - +
@@ -67,10 +70,12 @@ import dayjs from 'dayjs' import 'dayjs/locale/de' import WatchlistToggle from './WatchlistToggle.vue' + import ReferrerLink from './ReferrerLink.vue' export default { components: { - WatchlistToggle + WatchlistToggle, + ReferrerLink }, props: { item: { @@ -86,6 +91,10 @@ default () { return []; } + }, + referringPageUrl: { + type: String, + default: null } }, computed: { diff --git a/web/typo3conf/ext/ep_theme/Resources/Private/Partials/Hotel/TeaserWide.html b/web/typo3conf/ext/ep_theme/Resources/Private/Partials/Hotel/TeaserWide.html index 637104c9..46e19fb3 100644 --- a/web/typo3conf/ext/ep_theme/Resources/Private/Partials/Hotel/TeaserWide.html +++ b/web/typo3conf/ext/ep_theme/Resources/Private/Partials/Hotel/TeaserWide.html @@ -80,48 +80,33 @@ {f:if(condition: '{item.dates -> f:count()} > 1', then: 'Zeitraum', else: 'Termin')} {ep:dateRange(dateFrom: item.minDateStart, dateTo: item.maxDateEnd, includeLabel: 0)} - + {item.dates -> f:count()} Termin{f:if(condition: '{item.dates -> f:count()} > 1', then: 'e')} - +
{ep:nightsOptions(options: item.nights)}
ab {item.minPrice} € - Details & Buchen + + Details & Buchen +
 
ausgebucht - Details + Details
diff --git a/web/typo3conf/ext/ep_theme/Resources/Private/Partials/Product/HeaderDetail.html b/web/typo3conf/ext/ep_theme/Resources/Private/Partials/Product/HeaderDetail.html index 5f60a3be..3ff8f2dd 100644 --- a/web/typo3conf/ext/ep_theme/Resources/Private/Partials/Product/HeaderDetail.html +++ b/web/typo3conf/ext/ep_theme/Resources/Private/Partials/Product/HeaderDetail.html @@ -60,20 +60,8 @@ - - - + {v:render.template(file: 'EXT:ep_theme/Resources/Private/Partials/Breadcrumb.html')} diff --git a/web/typo3conf/ext/ep_theme/Resources/Private/Templates/Product/Detail.html b/web/typo3conf/ext/ep_theme/Resources/Private/Templates/Product/Detail.html index 42785ede..ee034b8a 100644 --- a/web/typo3conf/ext/ep_theme/Resources/Private/Templates/Product/Detail.html +++ b/web/typo3conf/ext/ep_theme/Resources/Private/Templates/Product/Detail.html @@ -7,235 +7,236 @@ - -
- - ", - contingents: "{ep:uri.ajax(action: 'list', controller: 'AjaxContingent', format: 'json', noCacheHash: 1)}", - rooms: "{ep:uri.ajax(action: 'rooms', controller: 'AjaxContingent', format: 'json', noCacheHash: 1)}", - pricetable: "{ep:uri.ajax(action: 'pricetable', controller: 'AjaxTable', arguments: '{product: product, hotel: hotel}', format: 'json', noCacheHash: 1)}" - }' - argument-prefix='' - :hotel-first="{f:if(condition: settings.hotelOnTop, then: 'true', else: 'false')}" - :fb-pixel-data="{ productUid: {product.uid}, nameInternal: '{product.nameInternal}' }" - :watchlist="watchlist" - :daytrip="{product.daytrip -> v:variable.convert(type: 'int')}" - inline-template> -
-
-
- -
-
-
-
-
-
- - - - - - - - -
-
-
-
- - - - - - - - - -
-
- - - - -
-
-

- -

-
-
-
diff --git a/web/typo3conf/ext/ep_theme/Resources/Private/Templates/Product/HotelList.html b/web/typo3conf/ext/ep_theme/Resources/Private/Templates/Product/HotelList.html index 0bde8d31..2626ccc3 100644 --- a/web/typo3conf/ext/ep_theme/Resources/Private/Templates/Product/HotelList.html +++ b/web/typo3conf/ext/ep_theme/Resources/Private/Templates/Product/HotelList.html @@ -5,48 +5,55 @@ - -
-
-
- + +
+ +
+
+
+ +
+
+
+
+ {product.teaserLong -> f:format.html()} +
+
+
+
+
Wähle deine Unterkunft
+
+
-
-
-
- {product.teaserLong -> f:format.html()} +
+
+
+ + + + + + + +
+ Die von dir gewählte Reise ist aktuell nicht buchbar, aber wir helfen dir gerne dabei, + eine andere Reise zu finden. Ruf uns an unter {settings.phoneNumber} + oder schreibe an . +
+
+
+
+
-
-
-
-
Wähle deine Unterkunft
-
-
-
-
-
-
- - - - - - - -
- Die von dir gewählte Reise ist aktuell nicht buchbar, aber wir helfen dir gerne dabei, - eine andere Reise zu finden. Ruf uns an unter {settings.phoneNumber} - oder schreibe an . -
-
-
-
-
-
+ + diff --git a/web/typo3conf/ext/ep_theme/Resources/Private/Templates/Search/Searchresult.html b/web/typo3conf/ext/ep_theme/Resources/Private/Templates/Search/Searchresult.html index ccd9d59d..0ef7b163 100644 --- a/web/typo3conf/ext/ep_theme/Resources/Private/Templates/Search/Searchresult.html +++ b/web/typo3conf/ext/ep_theme/Resources/Private/Templates/Search/Searchresult.html @@ -10,8 +10,7 @@

@@ -150,12 +150,14 @@
@@ -172,12 +174,14 @@
@@ -194,12 +198,14 @@
@@ -214,12 +220,14 @@
@@ -234,12 +242,14 @@
@@ -254,7 +264,8 @@ diff --git a/webpack.config.js b/webpack.config.js index 49487b84..33be796e 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -26,6 +26,9 @@ Encore css: 'css/[name].css', images: 'images/[name].[ext]' }) + .configureBabel(function (babelConfig) { + babelConfig.plugins = [ 'transform-object-rest-spread' ] + }) ; const EpThemeConfig = Encore.getWebpackConfig(); @@ -50,6 +53,9 @@ Encore css: 'css/[name].css', images: 'images/[name].[ext]' }) + .configureBabel(function (babelConfig) { + babelConfig.plugins = [ 'transform-object-rest-spread' ] + }) ; const EpEventsConfig = Encore.getWebpackConfig();