Merge branch 'hotfix/remove-dates-filtering'

This commit is contained in:
Björn Fromme
2019-08-21 11:36:54 +02:00
4 changed files with 9 additions and 54 deletions
@@ -94,11 +94,10 @@ class AjaxDateController extends ActionController
/** /**
* @param Product $product * @param Product $product
* @param Hotel $hotel * @param Hotel $hotel
* @param FilterSettings $filterSettings
* *
* @return string * @return string
*/ */
public function datesAction(Product $product, Hotel $hotel = null, FilterSettings $filterSettings = null) public function datesAction(Product $product, Hotel $hotel = null)
{ {
if ($hotel === null) { if ($hotel === null) {
return json_encode([ return json_encode([
@@ -108,10 +107,10 @@ class AjaxDateController extends ActionController
'altLabel' => null, 'altLabel' => null,
]); ]);
} }
if ($filterSettings === null) {
$forcedConceptUids = GeneralUtility::trimExplode(',', $this->settings['forcedConceptUids'], true); $forcedConceptUids = GeneralUtility::trimExplode(',', $this->settings['forcedConceptUids'], true);
$filterSettings = $this->filterService->getDefaultFilterSettings($forcedConceptUids, false); $filterSettings = $this->filterService->getDefaultFilterSettings($forcedConceptUids, false);
}
$altProductLink = null; $altProductLink = null;
$altLabel = null; $altLabel = null;
if ($product->getAltProduct()) { if ($product->getAltProduct()) {
@@ -28,7 +28,6 @@ namespace EP\EpProducts\Controller;
***************************************************************/ ***************************************************************/
use EP\EpProducts\Domain\Model\Date; use EP\EpProducts\Domain\Model\Date;
use EP\EpProducts\Domain\Model\FilterSettings;
use EP\EpProducts\Domain\Model\Hotel; use EP\EpProducts\Domain\Model\Hotel;
use EP\EpProducts\Domain\Model\Product; use EP\EpProducts\Domain\Model\Product;
use EP\EpProducts\Service\DateService; use EP\EpProducts\Service\DateService;
@@ -85,7 +84,6 @@ class AjaxTableController extends ActionController
/** /**
* @param Product $product * @param Product $product
* @param Hotel $hotel * @param Hotel $hotel
* @param FilterSettings $filterSettings
* @param Date $date * @param Date $date
* *
* @return string * @return string
@@ -95,14 +93,12 @@ class AjaxTableController extends ActionController
( (
Product $product, Product $product,
Hotel $hotel, Hotel $hotel,
FilterSettings $filterSettings = null,
Date $date = null Date $date = null
) )
{ {
if ($filterSettings === null) { $forcedConceptUids = GeneralUtility::trimExplode(',', $this->settings['forcedConceptUids'], true);
$forcedConceptUids = GeneralUtility::trimExplode(',', $this->settings['forcedConceptUids'], true); $filterSettings = $this->filterService->getDefaultFilterSettings($forcedConceptUids, false);
$filterSettings = $this->filterService->getDefaultFilterSettings($forcedConceptUids, false);
}
if ($reseller = $this->resellerDataService->getResellerForCurrentDomain()) { if ($reseller = $this->resellerDataService->getResellerForCurrentDomain()) {
$paCode = $reseller['paCode']; $paCode = $reseller['paCode'];
} else { } else {
@@ -79,9 +79,6 @@ class AjaxViewHelper extends ActionViewHelper
// Force absolute urls // Force absolute urls
$arguments['absolute'] = true; $arguments['absolute'] = true;
// Add timestamp as additional argument to prevent caching
$arguments['additionalParams'] = ['t' => time()];
return parent::renderStatic( return parent::renderStatic(
$arguments, $arguments,
$renderChildrenClosure, $renderChildrenClosure,
@@ -17,8 +17,6 @@
import dayjs from 'dayjs' import dayjs from 'dayjs'
import 'dayjs/locale/de' import 'dayjs/locale/de'
import defaultFilterSettings from '../_filtersettings'
export default { export default {
components: { components: {
DatesTable, DatesTable,
@@ -51,7 +49,6 @@
loading: false, loading: false,
activeSection: null, activeSection: null,
singleDate: false, singleDate: false,
filterSettings: defaultFilterSettings,
referringPage: null referringPage: null
} }
}, },
@@ -92,12 +89,9 @@
this.datesShow = true; this.datesShow = true;
this.priceTableShow = false; this.priceTableShow = false;
this.detailShow = false; this.detailShow = false;
let query = {};
query[this.argumentPrefix + '[filterSettings]'] = this.filterSettings;
axios({ axios({
url: this.uris['dates'], url: this.uris['dates'],
method: 'post', method: 'post'
data: $.param(query)
}).then(response => { }).then(response => {
const json = response.data; const json = response.data;
if (json.dates.length === 1) { if (json.dates.length === 1) {
@@ -116,33 +110,6 @@
EventBus.$emit('tableLoaded'); EventBus.$emit('tableLoaded');
}); });
}, },
loadSelectableDates () {
this.loading = true;
this.datesShow = true;
this.priceTableShow = false;
this.detailShow = false;
let query = {};
query[this.argumentPrefix + '[product]'] = this.filterSettings;
axios({
url: this.uris['dateslist'],
method: 'post',
data: $.param(query)
}).then(response => {
const json = response.data;
if (json.dates.length === 1) {
this.singleDate = true;
let dateRow = json.dates[0];
this.loadPriceTableView(dateRow.dateUid);
} else {
this.singleDate = false;
this.datesRows = json.dates;
this.bookable = json.bookable;
this.altLabel = json.altLabel;
this.altProductLink = json.altProductLink;
this.loading = false;
}
});
},
loadDatesView (scroll = true) { loadDatesView (scroll = true) {
if (this.daytrip) { if (this.daytrip) {
this.loading = false; this.loading = false;
@@ -161,7 +128,6 @@
this.priceTableShow = true; this.priceTableShow = true;
this.detailShow = false; this.detailShow = false;
let query = {}; let query = {};
query[this.argumentPrefix + '[filterSettings]'] = this.filterSettings;
query[this.argumentPrefix + '[date]'] = dateUid; query[this.argumentPrefix + '[date]'] = dateUid;
axios({ axios({
url: this.uris['pricetable'], url: this.uris['pricetable'],
@@ -225,9 +191,6 @@
} }
}, },
created () { created () {
if (sessionStorage.getItem('filterSettings')) {
this.filterSettings = JSON.parse(sessionStorage.getItem('filterSettings'));
}
if (sessionStorage.getItem('referringPage')) { if (sessionStorage.getItem('referringPage')) {
this.referringPage = JSON.parse(sessionStorage.getItem('referringPage')); this.referringPage = JSON.parse(sessionStorage.getItem('referringPage'));
sessionStorage.removeItem('referringPage'); sessionStorage.removeItem('referringPage');