Merge branch 'hotfix/fix-cached-ajax-requests'
This commit is contained in:
@@ -35,8 +35,6 @@ use EP\EpProducts\Service\DateService;
|
|||||||
use EP\EpProducts\Service\FilterService;
|
use EP\EpProducts\Service\FilterService;
|
||||||
use EP\EpProducts\Service\ResellerDataService;
|
use EP\EpProducts\Service\ResellerDataService;
|
||||||
use EP\EpProducts\Traits\RequestArgumentTypeConversionTrait;
|
use EP\EpProducts\Traits\RequestArgumentTypeConversionTrait;
|
||||||
use EP\EpProducts\Utility\DateUtility;
|
|
||||||
use League\Period\Period;
|
|
||||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||||
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
|
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
|
||||||
use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;
|
use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;
|
||||||
|
|||||||
@@ -132,6 +132,7 @@ tx_epproducts_ajax_json {
|
|||||||
1 = list
|
1 = list
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
features.requireCHashArgumentForActionArguments = 0
|
||||||
settings =< plugin.tx_epproducts.settings
|
settings =< plugin.tx_epproducts.settings
|
||||||
persistence =< plugin.tx_epproducts.persistence
|
persistence =< plugin.tx_epproducts.persistence
|
||||||
view =< plugin.tx_epproducts.view
|
view =< plugin.tx_epproducts.view
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ class AjaxViewHelper extends ActionViewHelper
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Reset argument to keep it out of resulting url
|
// Reset argument to keep it out of resulting url
|
||||||
$arguments['format'] = '';
|
unset($arguments['format']);
|
||||||
|
|
||||||
// Use root page uid as target unless provided
|
// Use root page uid as target unless provided
|
||||||
if ($arguments['pageUid'] === null) {
|
if ($arguments['pageUid'] === null) {
|
||||||
|
|||||||
+15
-4
@@ -74,6 +74,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import $ from 'jquery'
|
import $ from 'jquery'
|
||||||
|
import axios from 'axios';
|
||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
import EventBus from '../_bus'
|
import EventBus from '../_bus'
|
||||||
import flatpickr from 'flatpickr'
|
import flatpickr from 'flatpickr'
|
||||||
@@ -163,7 +164,12 @@
|
|||||||
query[this.argumentPrefix + '[hotel]'] = this.hotelUid;
|
query[this.argumentPrefix + '[hotel]'] = this.hotelUid;
|
||||||
query[this.argumentPrefix + '[product]'] = this.productUid;
|
query[this.argumentPrefix + '[product]'] = this.productUid;
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
$.post(this.contingentEndpointUri, query, (json) => {
|
axios({
|
||||||
|
url: this.contingentEndpointUri,
|
||||||
|
method: 'post',
|
||||||
|
data: $.param(query)
|
||||||
|
}).then(response => {
|
||||||
|
const json = response.data;
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
if (json) {
|
if (json) {
|
||||||
this.availableDates = json;
|
this.availableDates = json;
|
||||||
@@ -178,7 +184,7 @@
|
|||||||
this.picker.set('maxDate', enabledDates[enabledDates.length - 1]);
|
this.picker.set('maxDate', enabledDates[enabledDates.length - 1]);
|
||||||
this.picker.jumpToDate(enabledDates[0]);
|
this.picker.jumpToDate(enabledDates[0]);
|
||||||
}
|
}
|
||||||
}, 'json');
|
});
|
||||||
},
|
},
|
||||||
fetchAvailableRooms () {
|
fetchAvailableRooms () {
|
||||||
let query = {};
|
let query = {};
|
||||||
@@ -187,11 +193,16 @@
|
|||||||
query[this.argumentPrefix + '[dateFrom]'] = this.selectedFrom.format('YYYY-MM-DD');
|
query[this.argumentPrefix + '[dateFrom]'] = this.selectedFrom.format('YYYY-MM-DD');
|
||||||
query[this.argumentPrefix + '[dateTo]'] = this.selectedTo.format('YYYY-MM-DD');
|
query[this.argumentPrefix + '[dateTo]'] = this.selectedTo.format('YYYY-MM-DD');
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
$.post(this.roomsEndpointUri, query, (json) => {
|
axios({
|
||||||
|
url: this.roomsEndpointUri,
|
||||||
|
method: 'post',
|
||||||
|
data: $.param(query)
|
||||||
|
}).then(response => {
|
||||||
|
const json = response.data;
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.availableRooms = json;
|
this.availableRooms = json;
|
||||||
EventBus.$emit('tableLoaded');
|
EventBus.$emit('tableLoaded');
|
||||||
}, 'json');
|
});
|
||||||
},
|
},
|
||||||
calculatePrice (roomCode) {
|
calculatePrice (roomCode) {
|
||||||
const room = this.availableRooms.find(obj => {
|
const room = this.availableRooms.find(obj => {
|
||||||
|
|||||||
+22
-6
@@ -1,6 +1,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
import $ from 'jquery'
|
import $ from 'jquery'
|
||||||
|
import axios from 'axios';
|
||||||
import EventBus from '../_bus'
|
import EventBus from '../_bus'
|
||||||
import DatesTable from './DatesTable.vue'
|
import DatesTable from './DatesTable.vue'
|
||||||
import PriceTable from './PriceTable.vue'
|
import PriceTable from './PriceTable.vue'
|
||||||
@@ -93,7 +94,12 @@
|
|||||||
this.detailShow = false;
|
this.detailShow = false;
|
||||||
let query = {};
|
let query = {};
|
||||||
query[this.argumentPrefix + '[filterSettings]'] = this.filterSettings;
|
query[this.argumentPrefix + '[filterSettings]'] = this.filterSettings;
|
||||||
$.post(this.uris['dates'], query, json => {
|
axios({
|
||||||
|
url: this.uris['dates'],
|
||||||
|
method: 'post',
|
||||||
|
data: $.param(query)
|
||||||
|
}).then(response => {
|
||||||
|
const json = response.data;
|
||||||
if (json.dates.length === 1) {
|
if (json.dates.length === 1) {
|
||||||
this.singleDate = true;
|
this.singleDate = true;
|
||||||
let dateRow = json.dates[0];
|
let dateRow = json.dates[0];
|
||||||
@@ -108,7 +114,7 @@
|
|||||||
this.available = json.dates.length > 0;
|
this.available = json.dates.length > 0;
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
EventBus.$emit('tableLoaded');
|
EventBus.$emit('tableLoaded');
|
||||||
}, 'json');
|
});
|
||||||
},
|
},
|
||||||
loadSelectableDates () {
|
loadSelectableDates () {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
@@ -117,7 +123,12 @@
|
|||||||
this.detailShow = false;
|
this.detailShow = false;
|
||||||
let query = {};
|
let query = {};
|
||||||
query[this.argumentPrefix + '[product]'] = this.filterSettings;
|
query[this.argumentPrefix + '[product]'] = this.filterSettings;
|
||||||
$.post(this.uris['dateslist'], query, json => {
|
axios({
|
||||||
|
url: this.uris['dateslist'],
|
||||||
|
method: 'post',
|
||||||
|
data: $.param(query)
|
||||||
|
}).then(response => {
|
||||||
|
const json = response.data;
|
||||||
if (json.dates.length === 1) {
|
if (json.dates.length === 1) {
|
||||||
this.singleDate = true;
|
this.singleDate = true;
|
||||||
let dateRow = json.dates[0];
|
let dateRow = json.dates[0];
|
||||||
@@ -130,7 +141,7 @@
|
|||||||
this.altProductLink = json.altProductLink;
|
this.altProductLink = json.altProductLink;
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
}
|
}
|
||||||
}, 'json');
|
});
|
||||||
},
|
},
|
||||||
loadDatesView (scroll = true) {
|
loadDatesView (scroll = true) {
|
||||||
if (this.daytrip) {
|
if (this.daytrip) {
|
||||||
@@ -152,7 +163,12 @@
|
|||||||
let query = {};
|
let query = {};
|
||||||
query[this.argumentPrefix + '[filterSettings]'] = this.filterSettings;
|
query[this.argumentPrefix + '[filterSettings]'] = this.filterSettings;
|
||||||
query[this.argumentPrefix + '[date]'] = dateUid;
|
query[this.argumentPrefix + '[date]'] = dateUid;
|
||||||
$.post(this.uris['pricetable'], query, json => {
|
axios({
|
||||||
|
url: this.uris['pricetable'],
|
||||||
|
method: 'post',
|
||||||
|
data: $.param(query)
|
||||||
|
}).then(response => {
|
||||||
|
const json = response.data;
|
||||||
this.priceTableRows = json.priceTable;
|
this.priceTableRows = json.priceTable;
|
||||||
this.dateStart = dayjs(json.dateStart).format('DD.MM.YYYY');
|
this.dateStart = dayjs(json.dateStart).format('DD.MM.YYYY');
|
||||||
this.dateEnd = dayjs(json.dateEnd).format('DD.MM.YYYY');
|
this.dateEnd = dayjs(json.dateEnd).format('DD.MM.YYYY');
|
||||||
@@ -160,7 +176,7 @@
|
|||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.trackConversion();
|
this.trackConversion();
|
||||||
EventBus.$emit('tableLoaded');
|
EventBus.$emit('tableLoaded');
|
||||||
}, 'json');
|
});
|
||||||
},
|
},
|
||||||
loadPriceTableView (dateuid) {
|
loadPriceTableView (dateuid) {
|
||||||
this.loadPriceTable(dateuid);
|
this.loadPriceTable(dateuid);
|
||||||
|
|||||||
@@ -10,10 +10,10 @@
|
|||||||
<noscript><h1>{product.headline}</h1></noscript>
|
<noscript><h1>{product.headline}</h1></noscript>
|
||||||
<product-detail
|
<product-detail
|
||||||
:uris='{
|
:uris='{
|
||||||
dates: "<f:format.raw>{ep:uri.ajax(action: 'dates', controller: 'AjaxDate', arguments: '{product: product, hotel: hotel}', format: 'json', noCacheHash: 1, pageUid: settings.defaultAjaxUid)}</f:format.raw>",
|
dates: "<f:format.raw>{ep:uri.ajax(action: 'dates', controller: 'AjaxDate', arguments: '{product: product, hotel: hotel}', format: 'json', pageUid: settings.defaultAjaxUid)}</f:format.raw>",
|
||||||
contingents: "<f:format.raw>{ep:uri.ajax(action: 'list', controller: 'AjaxContingent', format: 'json', noCacheHash: 1, pageUid: settings.defaultAjaxUid)}</f:format.raw>",
|
contingents: "<f:format.raw>{ep:uri.ajax(action: 'list', controller: 'AjaxContingent', format: 'json', pageUid: settings.defaultAjaxUid)}</f:format.raw>",
|
||||||
rooms: "<f:format.raw>{ep:uri.ajax(action: 'rooms', controller: 'AjaxContingent', format: 'json', noCacheHash: 1, pageUid: settings.defaultAjaxUid)}</f:format.raw>",
|
rooms: "<f:format.raw>{ep:uri.ajax(action: 'rooms', controller: 'AjaxContingent', format: 'json', pageUid: settings.defaultAjaxUid)}</f:format.raw>",
|
||||||
pricetable: "<f:format.raw>{ep:uri.ajax(action: 'pricetable', controller: 'AjaxTable', arguments: '{product: product, hotel: hotel}', format: 'json', noCacheHash: 1, pageUid: settings.defaultAjaxUid)}</f:format.raw>"
|
pricetable: "<f:format.raw>{ep:uri.ajax(action: 'pricetable', controller: 'AjaxTable', arguments: '{product: product, hotel: hotel}', format: 'json', pageUid: settings.defaultAjaxUid)}</f:format.raw>"
|
||||||
}'
|
}'
|
||||||
argument-prefix='<ep:argumentPrefix pluginName="Ajax" />'
|
argument-prefix='<ep:argumentPrefix pluginName="Ajax" />'
|
||||||
:hotel-first="{f:if(condition: settings.hotelOnTop, then: 'true', else: 'false')}"
|
:hotel-first="{f:if(condition: settings.hotelOnTop, then: 'true', else: 'false')}"
|
||||||
|
|||||||
Reference in New Issue
Block a user