Merge branch 'master' into develop

This commit is contained in:
Björn Fromme
2019-07-17 13:05:05 +02:00
6 changed files with 43 additions and 17 deletions
@@ -35,8 +35,6 @@ use EP\EpProducts\Service\DateService;
use EP\EpProducts\Service\FilterService;
use EP\EpProducts\Service\ResellerDataService;
use EP\EpProducts\Traits\RequestArgumentTypeConversionTrait;
use EP\EpProducts\Utility\DateUtility;
use League\Period\Period;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;
@@ -132,6 +132,7 @@ tx_epproducts_ajax_json {
1 = list
}
}
features.requireCHashArgumentForActionArguments = 0
settings =< plugin.tx_epproducts.settings
persistence =< plugin.tx_epproducts.persistence
view =< plugin.tx_epproducts.view
@@ -66,7 +66,7 @@ class AjaxViewHelper extends ActionViewHelper
}
// Reset argument to keep it out of resulting url
$arguments['format'] = '';
unset($arguments['format']);
// Use root page uid as target unless provided
if ($arguments['pageUid'] === null) {
@@ -74,6 +74,7 @@
<script>
import $ from 'jquery'
import axios from 'axios';
import Vue from 'vue'
import EventBus from '../_bus'
import flatpickr from 'flatpickr'
@@ -163,7 +164,12 @@
query[this.argumentPrefix + '[hotel]'] = this.hotelUid;
query[this.argumentPrefix + '[product]'] = this.productUid;
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;
if (json) {
this.availableDates = json;
@@ -178,7 +184,7 @@
this.picker.set('maxDate', enabledDates[enabledDates.length - 1]);
this.picker.jumpToDate(enabledDates[0]);
}
}, 'json');
});
},
fetchAvailableRooms () {
let query = {};
@@ -187,11 +193,16 @@
query[this.argumentPrefix + '[dateFrom]'] = this.selectedFrom.format('YYYY-MM-DD');
query[this.argumentPrefix + '[dateTo]'] = this.selectedTo.format('YYYY-MM-DD');
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.availableRooms = json;
EventBus.$emit('tableLoaded');
}, 'json');
});
},
calculatePrice (roomCode) {
const room = this.availableRooms.find(obj => {
@@ -1,6 +1,7 @@
<script>
import Vue from 'vue'
import $ from 'jquery'
import axios from 'axios';
import EventBus from '../_bus'
import DatesTable from './DatesTable.vue'
import PriceTable from './PriceTable.vue'
@@ -93,7 +94,12 @@
this.detailShow = false;
let query = {};
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) {
this.singleDate = true;
let dateRow = json.dates[0];
@@ -108,7 +114,7 @@
this.available = json.dates.length > 0;
this.loading = false;
EventBus.$emit('tableLoaded');
}, 'json');
});
},
loadSelectableDates () {
this.loading = true;
@@ -117,7 +123,12 @@
this.detailShow = false;
let query = {};
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) {
this.singleDate = true;
let dateRow = json.dates[0];
@@ -130,7 +141,7 @@
this.altProductLink = json.altProductLink;
this.loading = false;
}
}, 'json');
});
},
loadDatesView (scroll = true) {
if (this.daytrip) {
@@ -152,7 +163,12 @@
let query = {};
query[this.argumentPrefix + '[filterSettings]'] = this.filterSettings;
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.dateStart = dayjs(json.dateStart).format('DD.MM.YYYY');
this.dateEnd = dayjs(json.dateEnd).format('DD.MM.YYYY');
@@ -160,7 +176,7 @@
this.loading = false;
this.trackConversion();
EventBus.$emit('tableLoaded');
}, 'json');
});
},
loadPriceTableView (dateuid) {
this.loadPriceTable(dateuid);
@@ -10,10 +10,10 @@
<noscript><h1>{product.headline}</h1></noscript>
<product-detail
: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>",
contingents: "<f:format.raw>{ep:uri.ajax(action: 'list', 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', 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', 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', 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', pageUid: settings.defaultAjaxUid)}</f:format.raw>"
}'
argument-prefix='<ep:argumentPrefix pluginName="Ajax" />'
:hotel-first="{f:if(condition: settings.hotelOnTop, then: 'true', else: 'false')}"