@qite/tide-booking-component 1.4.78 → 1.4.80
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/build-cjs/index.js +771 -473
- package/build/build-cjs/src/qsm/types.d.ts +2 -0
- package/build/build-cjs/src/search-results/store/search-results-slice.d.ts +10 -1
- package/build/build-cjs/src/search-results/types.d.ts +5 -4
- package/build/build-cjs/src/search-results/utils/search-results-utils.d.ts +9 -2
- package/build/build-esm/index.js +769 -438
- package/build/build-esm/src/qsm/types.d.ts +2 -0
- package/build/build-esm/src/search-results/store/search-results-slice.d.ts +10 -1
- package/build/build-esm/src/search-results/types.d.ts +5 -4
- package/build/build-esm/src/search-results/utils/search-results-utils.d.ts +9 -2
- package/package.json +2 -2
- package/src/booking-wizard/features/price-details/selectors.ts +1 -1
- package/src/content/features/content-page/content-page-self-contained.tsx +4 -4
- package/src/qsm/components/QSMContainer/qsm-container.tsx +9 -0
- package/src/search-results/components/hotel/hotel-accommodation-results.tsx +97 -99
- package/src/search-results/components/hotel/hotel-card.tsx +29 -7
- package/src/search-results/components/search-results-container/flight-search-results.tsx +2 -2
- package/src/search-results/components/search-results-container/search-results-container.tsx +191 -40
- package/src/search-results/features/flights/flight-search-results-self-contained.tsx +21 -2
- package/src/search-results/features/hotels/hotel-flight-search-results-self-contained.tsx +21 -2
- package/src/search-results/features/hotels/hotel-search-results-self-contained.tsx +21 -2
- package/src/search-results/features/roundtrips/roundtrip-search-results-self-contained.tsx +21 -2
- package/src/search-results/store/search-results-slice.ts +19 -1
- package/src/search-results/types.ts +5 -5
- package/src/search-results/utils/search-results-utils.ts +185 -2
- package/build/build-cjs/src/search-results/components/filters/utility.d.ts +0 -3
- package/build/build-esm/src/search-results/components/filters/utility.d.ts +0 -3
- package/src/search-results/components/filters/utility.tsx +0 -79
|
@@ -11,12 +11,14 @@ import {
|
|
|
11
11
|
setBookingPackageDetails,
|
|
12
12
|
setEntry,
|
|
13
13
|
setFlyInIsOpen,
|
|
14
|
-
setFilteredResults
|
|
14
|
+
setFilteredResults,
|
|
15
|
+
setPackagingAccoResults,
|
|
16
|
+
setFilteredPackagingAccoResults
|
|
15
17
|
} from '../../store/search-results-slice';
|
|
16
18
|
import { Filter, SortByType } from '../../types';
|
|
17
19
|
import useMediaQuery from '../../../shared/utils/use-media-query-util';
|
|
18
20
|
import ItemPicker from '../item-picker';
|
|
19
|
-
import { TideClientConfig, details, detailsWL, getEntryLight, search } from '@qite/tide-client';
|
|
21
|
+
import { TideClientConfig, details, detailsWL, getEntryLight, search, searchPackagingAccommodations } from '@qite/tide-client';
|
|
20
22
|
import {
|
|
21
23
|
BookingPackageDestination,
|
|
22
24
|
BookingPackageDetailsRequest,
|
|
@@ -25,7 +27,11 @@ import {
|
|
|
25
27
|
BookingPackageRequestRoom,
|
|
26
28
|
BookingPackageSearchRequest,
|
|
27
29
|
EntryLight,
|
|
28
|
-
EntryRoom
|
|
30
|
+
EntryRoom,
|
|
31
|
+
PackagingAccommodationRequest,
|
|
32
|
+
PackagingDestination,
|
|
33
|
+
PackagingRoom,
|
|
34
|
+
PackagingTraveller
|
|
29
35
|
} from '@qite/tide-client/build/types';
|
|
30
36
|
import { getDateFromParams, getNumberFromParams, getRoomsFromParams, getStringFromParams } from '../../../shared/utils/query-string-util';
|
|
31
37
|
import { range } from 'lodash';
|
|
@@ -36,14 +42,18 @@ import TabViews from '../tab-views';
|
|
|
36
42
|
import FlyIn from '../../../shared/components/flyin/flyin';
|
|
37
43
|
import HotelAccommodationResults from '../hotel/hotel-accommodation-results';
|
|
38
44
|
import RoundTripResults from '../round-trip/round-trip-results';
|
|
39
|
-
import { enrichFiltersWithResults } from '../filters/utility';
|
|
40
45
|
import FlightResults from '../flight/flight-results';
|
|
41
46
|
import { getTranslations } from '../../../shared/utils/localization-util';
|
|
42
47
|
import { FlightSearchProvider } from '../flight/flight-search-context';
|
|
43
48
|
import FlightResultsContainer from './flight-search-results';
|
|
44
49
|
import Filters from '../filters/filters';
|
|
45
50
|
import GroupTourResults from '../group-tour/group-tour-results';
|
|
46
|
-
import {
|
|
51
|
+
import {
|
|
52
|
+
applyFilters,
|
|
53
|
+
applyFiltersToPackageAccoResults,
|
|
54
|
+
enrichFiltersWithPackageAccoResults,
|
|
55
|
+
enrichFiltersWithResults
|
|
56
|
+
} from '../../utils/search-results-utils';
|
|
47
57
|
import { PortalQsmType } from '../../../shared/types';
|
|
48
58
|
|
|
49
59
|
const SearchResultsContainer: React.FC = () => {
|
|
@@ -123,11 +133,11 @@ const SearchResultsContainer: React.FC = () => {
|
|
|
123
133
|
payload: {
|
|
124
134
|
catalogueIds: context!.tideConnection.catalogueIds ?? [],
|
|
125
135
|
serviceType:
|
|
126
|
-
context!.
|
|
136
|
+
context!.searchConfiguration.qsmType === PortalQsmType.Accommodation || context!.searchConfiguration.qsmType === PortalQsmType.AccommodationAndFlight
|
|
127
137
|
? 3
|
|
128
|
-
: context!.
|
|
138
|
+
: context!.searchConfiguration.qsmType === PortalQsmType.Flight
|
|
129
139
|
? 7
|
|
130
|
-
: context!.
|
|
140
|
+
: context!.searchConfiguration.qsmType === PortalQsmType.RoundTrip
|
|
131
141
|
? 1
|
|
132
142
|
: 0,
|
|
133
143
|
searchType: 0,
|
|
@@ -200,14 +210,14 @@ const SearchResultsContainer: React.FC = () => {
|
|
|
200
210
|
payload: {
|
|
201
211
|
catalogueIds: context!.tideConnection.catalogueIds ?? [],
|
|
202
212
|
serviceType:
|
|
203
|
-
context!.
|
|
213
|
+
context!.searchConfiguration.qsmType === PortalQsmType.Accommodation || context!.searchConfiguration.qsmType === PortalQsmType.AccommodationAndFlight
|
|
204
214
|
? 3
|
|
205
|
-
: context!.
|
|
215
|
+
: context!.searchConfiguration.qsmType === PortalQsmType.Flight
|
|
206
216
|
? 7
|
|
207
|
-
: context!.
|
|
217
|
+
: context!.searchConfiguration.qsmType === PortalQsmType.RoundTrip
|
|
208
218
|
? 1
|
|
209
219
|
: undefined,
|
|
210
|
-
searchType: context!.
|
|
220
|
+
searchType: context!.searchConfiguration.qsmType === PortalQsmType.GroupTour ? 1 : 0,
|
|
211
221
|
destination: {
|
|
212
222
|
id: Number(destinationId),
|
|
213
223
|
isCountry: destinationIsCountry,
|
|
@@ -220,7 +230,7 @@ const SearchResultsContainer: React.FC = () => {
|
|
|
220
230
|
toDate: to,
|
|
221
231
|
earliestFromOffset: 0,
|
|
222
232
|
latestToOffset: 0,
|
|
223
|
-
includeFlights: context!.
|
|
233
|
+
includeFlights: context!.searchConfiguration.qsmType === PortalQsmType.AccommodationAndFlight ? true : false,
|
|
224
234
|
// regimeCodes:
|
|
225
235
|
// filters
|
|
226
236
|
// .find((f) => f.property === 'regime')
|
|
@@ -228,7 +238,7 @@ const SearchResultsContainer: React.FC = () => {
|
|
|
228
238
|
// .flatMap((o) => o.value.toString()) || [],
|
|
229
239
|
// minPrice: filters.find((f) => f.property === 'price')?.selectedMin,
|
|
230
240
|
// maxPrice: filters.find((f) => f.property === 'price')?.selectedMax,
|
|
231
|
-
useExactDates: context?.
|
|
241
|
+
useExactDates: context?.searchConfiguration.qsmType === PortalQsmType.GroupTour ? false : true,
|
|
232
242
|
onlyCachedResults: false,
|
|
233
243
|
includeAllAllotments: true,
|
|
234
244
|
productIds: hotel ? [hotel] : [],
|
|
@@ -298,6 +308,103 @@ const SearchResultsContainer: React.FC = () => {
|
|
|
298
308
|
return requestRooms;
|
|
299
309
|
};
|
|
300
310
|
|
|
311
|
+
const buildPackagingAccommodationRequestFromQueryParams = (params: URLSearchParams): PackagingAccommodationRequest | null => {
|
|
312
|
+
let from = getDateFromParams(params, 'fromDate');
|
|
313
|
+
let to = getDateFromParams(params, 'toDate');
|
|
314
|
+
const rooms = getRoomsFromParams(params, 'rooms');
|
|
315
|
+
let country = getNumberFromParams(params, 'country');
|
|
316
|
+
let region = getNumberFromParams(params, 'region');
|
|
317
|
+
let oord = getNumberFromParams(params, 'oord');
|
|
318
|
+
let city = getNumberFromParams(params, 'location');
|
|
319
|
+
let hotel = getNumberFromParams(params, 'hotel');
|
|
320
|
+
let tagId = getNumberFromParams(params, 'tagId');
|
|
321
|
+
let agentId = getNumberFromParams(params, 'agentId');
|
|
322
|
+
|
|
323
|
+
if (!from || !to) {
|
|
324
|
+
console.error('Missing fromDate or toDate in query params, using default values');
|
|
325
|
+
return null;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
if (typeof window !== 'undefined') {
|
|
329
|
+
window.scrollTo(0, 0);
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
let destinationId: number | null = null;
|
|
333
|
+
let destinationIsCountry = false;
|
|
334
|
+
let destinationIsRegion = false;
|
|
335
|
+
let destinationIsOord = false;
|
|
336
|
+
let destinationIsLocation = false;
|
|
337
|
+
|
|
338
|
+
if (country) {
|
|
339
|
+
destinationId = country;
|
|
340
|
+
destinationIsCountry = true;
|
|
341
|
+
} else if (region) {
|
|
342
|
+
destinationId = region;
|
|
343
|
+
destinationIsRegion = true;
|
|
344
|
+
} else if (oord) {
|
|
345
|
+
destinationId = oord;
|
|
346
|
+
destinationIsOord = true;
|
|
347
|
+
} else if (city) {
|
|
348
|
+
destinationId = city;
|
|
349
|
+
destinationIsLocation = true;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
var searchRequest = {
|
|
353
|
+
officeId: 1,
|
|
354
|
+
agentId: agentId ?? null,
|
|
355
|
+
catalogueId: context!.searchConfiguration.defaultCatalogueId ?? 0,
|
|
356
|
+
searchConfigurationId: context!.searchConfiguration.id,
|
|
357
|
+
language: context!.languageCode ?? 'en-GB',
|
|
358
|
+
servicesType: 3, // accommodation
|
|
359
|
+
fromDate: from,
|
|
360
|
+
toDate: to,
|
|
361
|
+
destination: {
|
|
362
|
+
id: Number(destinationId),
|
|
363
|
+
isCountry: destinationIsCountry,
|
|
364
|
+
isRegion: destinationIsRegion,
|
|
365
|
+
isOord: destinationIsOord,
|
|
366
|
+
isLocation: destinationIsLocation
|
|
367
|
+
} as PackagingDestination,
|
|
368
|
+
productCode: hotel ? hotel.toString() : '',
|
|
369
|
+
rooms: getPackagingRequestRooms(rooms),
|
|
370
|
+
tagIds: tagId ? [tagId] : []
|
|
371
|
+
};
|
|
372
|
+
|
|
373
|
+
console.log('Search request for packaging accommodation from query params', searchRequest);
|
|
374
|
+
|
|
375
|
+
return searchRequest;
|
|
376
|
+
};
|
|
377
|
+
|
|
378
|
+
const getPackagingRequestRooms = (rooms: Room[] | null) => {
|
|
379
|
+
if (!rooms) {
|
|
380
|
+
// Fall back to 2 adults
|
|
381
|
+
var room = { index: 0, travellers: [] } as PackagingRoom;
|
|
382
|
+
range(0, 2).forEach(() => {
|
|
383
|
+
room.travellers.push({
|
|
384
|
+
age: 30
|
|
385
|
+
} as PackagingTraveller);
|
|
386
|
+
});
|
|
387
|
+
return [room];
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
const requestRooms = rooms?.map((x, i) => {
|
|
391
|
+
var room = { index: i, travellers: [] } as PackagingRoom;
|
|
392
|
+
range(0, x.adults).forEach(() => {
|
|
393
|
+
room.travellers.push({
|
|
394
|
+
age: 30
|
|
395
|
+
} as PackagingTraveller);
|
|
396
|
+
});
|
|
397
|
+
x.childAges.forEach((x) => {
|
|
398
|
+
room.travellers.push({
|
|
399
|
+
age: x
|
|
400
|
+
} as PackagingTraveller);
|
|
401
|
+
});
|
|
402
|
+
return room;
|
|
403
|
+
});
|
|
404
|
+
|
|
405
|
+
return requestRooms;
|
|
406
|
+
};
|
|
407
|
+
|
|
301
408
|
useEffect(() => {
|
|
302
409
|
if (typeof document !== 'undefined') {
|
|
303
410
|
document.body.classList.toggle('has-overlay', filtersOpen);
|
|
@@ -362,7 +469,7 @@ const SearchResultsContainer: React.FC = () => {
|
|
|
362
469
|
dispatch(setSelectedSearchResult(matching.productId));
|
|
363
470
|
}
|
|
364
471
|
} else {
|
|
365
|
-
if (context.
|
|
472
|
+
if (context.searchConfiguration.qsmType === PortalQsmType.AccommodationAndFlight) {
|
|
366
473
|
dispatch(setSelectedSearchResult(packageSearchResults[0]?.productId));
|
|
367
474
|
}
|
|
368
475
|
}
|
|
@@ -375,14 +482,58 @@ const SearchResultsContainer: React.FC = () => {
|
|
|
375
482
|
}
|
|
376
483
|
};
|
|
377
484
|
|
|
485
|
+
const runHotelSearch = async () => {
|
|
486
|
+
dispatch(setIsLoading(true));
|
|
487
|
+
try {
|
|
488
|
+
if (!context) {
|
|
489
|
+
return;
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
const config: TideClientConfig = {
|
|
493
|
+
host: context.tideConnection.host,
|
|
494
|
+
apiKey: context.tideConnection.apiKey
|
|
495
|
+
};
|
|
496
|
+
|
|
497
|
+
const params = new URLSearchParams(location.search);
|
|
498
|
+
|
|
499
|
+
let searchRequest: PackagingAccommodationRequest;
|
|
500
|
+
|
|
501
|
+
const rq = buildPackagingAccommodationRequestFromQueryParams(params);
|
|
502
|
+
if (!rq) {
|
|
503
|
+
throw new Error('Invalid search parameters');
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
searchRequest = rq;
|
|
507
|
+
|
|
508
|
+
const packageAccoSearchResults = await searchPackagingAccommodations(config, searchRequest);
|
|
509
|
+
|
|
510
|
+
console.log('package Acco SearchResults', packageAccoSearchResults);
|
|
511
|
+
|
|
512
|
+
const enrichedFilters = enrichFiltersWithPackageAccoResults(packageAccoSearchResults, context.filters, context.tags ?? []);
|
|
513
|
+
if (!initialFiltersSet) {
|
|
514
|
+
dispatch(resetFilters(enrichedFilters));
|
|
515
|
+
setInitialFilters(enrichedFilters);
|
|
516
|
+
setInitialFiltersSet(true);
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
dispatch(setPackagingAccoResults(packageAccoSearchResults));
|
|
520
|
+
const initialFilteredResults = applyFiltersToPackageAccoResults(packageAccoSearchResults, filters);
|
|
521
|
+
dispatch(setFilteredPackagingAccoResults(initialFilteredResults));
|
|
522
|
+
|
|
523
|
+
dispatch(setIsLoading(false));
|
|
524
|
+
} catch (err) {
|
|
525
|
+
console.error('Search failed', err);
|
|
526
|
+
dispatch(setIsLoading(false));
|
|
527
|
+
}
|
|
528
|
+
};
|
|
529
|
+
|
|
378
530
|
if (!context?.showMockup) {
|
|
379
|
-
if (
|
|
380
|
-
context?.type === PortalQsmType.AccommodationAndFlight ||
|
|
381
|
-
context?.type === PortalQsmType.Accommodation ||
|
|
382
|
-
context?.type === PortalQsmType.GroupTour
|
|
383
|
-
) {
|
|
531
|
+
if (context?.searchConfiguration.qsmType === PortalQsmType.AccommodationAndFlight || context?.searchConfiguration.qsmType === PortalQsmType.GroupTour) {
|
|
384
532
|
runSearch();
|
|
385
533
|
}
|
|
534
|
+
if (context?.searchConfiguration.qsmType === PortalQsmType.Accommodation) {
|
|
535
|
+
runHotelSearch();
|
|
536
|
+
}
|
|
386
537
|
}
|
|
387
538
|
}, [location.search]);
|
|
388
539
|
|
|
@@ -391,7 +542,7 @@ const SearchResultsContainer: React.FC = () => {
|
|
|
391
542
|
const fetchPackageDetails = async () => {
|
|
392
543
|
if (!selectedSearchResultId || !context) return;
|
|
393
544
|
|
|
394
|
-
if (context?.
|
|
545
|
+
if (context?.searchConfiguration.qsmType === PortalQsmType.Accommodation || context?.searchConfiguration.qsmType === PortalQsmType.GroupTour) {
|
|
395
546
|
handleFlyInToggle(true);
|
|
396
547
|
}
|
|
397
548
|
|
|
@@ -427,7 +578,7 @@ const SearchResultsContainer: React.FC = () => {
|
|
|
427
578
|
productCode: selectedItem.code,
|
|
428
579
|
fromDate: selectedItem.fromDate,
|
|
429
580
|
toDate: selectedItem.toDate,
|
|
430
|
-
includeFlights: context!.
|
|
581
|
+
includeFlights: context!.searchConfiguration.qsmType === PortalQsmType.AccommodationAndFlight ? true : false,
|
|
431
582
|
includeHotels: true,
|
|
432
583
|
includePaxTypes: true,
|
|
433
584
|
checkExternalAvailability: true,
|
|
@@ -467,24 +618,24 @@ const SearchResultsContainer: React.FC = () => {
|
|
|
467
618
|
{context && (
|
|
468
619
|
<div className="search">
|
|
469
620
|
<div className="search__container">
|
|
470
|
-
{context.
|
|
621
|
+
{context.searchConfiguration.qsmType === PortalQsmType.Flight && (
|
|
471
622
|
<FlightSearchProvider tideConnection={context.tideConnection}>
|
|
472
623
|
<FlightResultsContainer isMobile={isMobile} />
|
|
473
624
|
<FlyIn
|
|
474
625
|
title="Select your fare"
|
|
475
|
-
srpType={context.
|
|
626
|
+
srpType={context.searchConfiguration.qsmType}
|
|
476
627
|
isOpen={flyInIsOpen}
|
|
477
628
|
setIsOpen={handleFlyInToggle}
|
|
478
629
|
onPanelRef={(el) => (panelRef.current = el)}
|
|
479
630
|
/>
|
|
480
631
|
</FlightSearchProvider>
|
|
481
632
|
)}
|
|
482
|
-
{(context.
|
|
483
|
-
context.
|
|
484
|
-
context.
|
|
485
|
-
context.
|
|
633
|
+
{(context.searchConfiguration.qsmType === PortalQsmType.AccommodationAndFlight ||
|
|
634
|
+
context.searchConfiguration.qsmType === PortalQsmType.Accommodation ||
|
|
635
|
+
context.searchConfiguration.qsmType === PortalQsmType.GroupTour ||
|
|
636
|
+
context.searchConfiguration.qsmType === PortalQsmType.RoundTrip) && (
|
|
486
637
|
<>
|
|
487
|
-
{context.
|
|
638
|
+
{context.searchConfiguration.qsmType != PortalQsmType.AccommodationAndFlight && context.showFilters && (
|
|
488
639
|
<Filters
|
|
489
640
|
initialFilters={initialFilters}
|
|
490
641
|
filters={filters}
|
|
@@ -494,7 +645,7 @@ const SearchResultsContainer: React.FC = () => {
|
|
|
494
645
|
isLoading={isLoading}
|
|
495
646
|
/>
|
|
496
647
|
)}
|
|
497
|
-
{context.
|
|
648
|
+
{context.searchConfiguration.qsmType === PortalQsmType.AccommodationAndFlight && (
|
|
498
649
|
<Itinerary isOpen={itineraryOpen} handleSetIsOpen={() => setItineraryOpen(!itineraryOpen)} isLoading={isLoading} />
|
|
499
650
|
)}
|
|
500
651
|
{/* ---------------- Results ---------------- */}
|
|
@@ -502,13 +653,13 @@ const SearchResultsContainer: React.FC = () => {
|
|
|
502
653
|
{isMobile && (
|
|
503
654
|
<div className="search__result-row">
|
|
504
655
|
<div className="search__results__actions">
|
|
505
|
-
{context.
|
|
656
|
+
{context.searchConfiguration.qsmType != PortalQsmType.AccommodationAndFlight && context.showFilters && (
|
|
506
657
|
<div className="cta cta--filter" onClick={() => setFiltersOpen(true)}>
|
|
507
658
|
<Icon name="ui-filter" className="mobile-filters-button__icon" height={16} />
|
|
508
659
|
{translations.SRP.FILTERS}
|
|
509
660
|
</div>
|
|
510
661
|
)}
|
|
511
|
-
{context.
|
|
662
|
+
{context.searchConfiguration.qsmType === PortalQsmType.AccommodationAndFlight && (
|
|
512
663
|
<div className="cta cta--filter" onClick={() => setItineraryOpen(true)}>
|
|
513
664
|
<Icon name="ui-calendar" className="mobile-filters-button__icon" height={16} />
|
|
514
665
|
{translations.SRP.SHOW_ITINERARY}
|
|
@@ -554,23 +705,23 @@ const SearchResultsContainer: React.FC = () => {
|
|
|
554
705
|
|
|
555
706
|
{context.showRoundTripResults && context.showMockup && <RoundTripResults />}
|
|
556
707
|
|
|
557
|
-
{context.
|
|
708
|
+
{context.searchConfiguration.qsmType === PortalQsmType.GroupTour && <GroupTourResults isLoading={isLoading} />}
|
|
558
709
|
|
|
559
|
-
{context.
|
|
560
|
-
|
|
561
|
-
|
|
710
|
+
{context.searchConfiguration.qsmType === PortalQsmType.AccommodationAndFlight &&
|
|
711
|
+
context.showFlightResults &&
|
|
712
|
+
bookingPackageDetails?.outwardFlights && <FlightResults flights={bookingPackageDetails?.outwardFlights} isDeparture={true} />}
|
|
562
713
|
|
|
563
714
|
{context.showHotelAccommodationResults && <HotelAccommodationResults isLoading={isLoading} />}
|
|
564
715
|
|
|
565
|
-
{context.
|
|
566
|
-
|
|
567
|
-
|
|
716
|
+
{context.searchConfiguration.qsmType === PortalQsmType.AccommodationAndFlight &&
|
|
717
|
+
context.showFlightResults &&
|
|
718
|
+
bookingPackageDetails?.returnFlights && <FlightResults flights={bookingPackageDetails?.returnFlights} isDeparture={false} />}
|
|
568
719
|
</div>
|
|
569
720
|
</div>
|
|
570
721
|
{/* <button onClick={() => handleFlyInToggle(!flyInIsOpen)}>Toggle FlyIn</button> */}
|
|
571
722
|
<FlyIn
|
|
572
723
|
title={`${translations.SRP.SELECT} ${translations.SRP.ACCOMMODATION}`}
|
|
573
|
-
srpType={context.
|
|
724
|
+
srpType={context.searchConfiguration.qsmType}
|
|
574
725
|
isOpen={flyInIsOpen}
|
|
575
726
|
setIsOpen={handleFlyInToggle}
|
|
576
727
|
onPanelRef={(el) => (panelRef.current = el)}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
2
|
import { Filter, SearchResult, SearchResultsConfiguration } from '../../types';
|
|
3
3
|
import SearchResults from '../..';
|
|
4
|
-
import { Footer, Navbar
|
|
4
|
+
import { Footer, Navbar } from '../../../../src';
|
|
5
5
|
import { TideLogo, language, languages, topLinks, navItems } from '../../../../src/content/navbar/placeholderData';
|
|
6
6
|
import Icon from '../../components/icon';
|
|
7
7
|
|
|
@@ -209,7 +209,26 @@ const FlightSearchResultsSelfContained: React.FC<FlightSearchResultsSelfContaine
|
|
|
209
209
|
};
|
|
210
210
|
|
|
211
211
|
const configuration: SearchResultsConfiguration = {
|
|
212
|
-
|
|
212
|
+
searchConfiguration: {
|
|
213
|
+
id: 6,
|
|
214
|
+
name: 'Search Flights',
|
|
215
|
+
icon: '',
|
|
216
|
+
defaultSearchType: 3,
|
|
217
|
+
serviceTypes: [7],
|
|
218
|
+
defaultCatalogueId: 1,
|
|
219
|
+
defaultDuration: undefined,
|
|
220
|
+
fromDateAmount: 1,
|
|
221
|
+
fromDateAmountType: 1,
|
|
222
|
+
toDateAmount: 7,
|
|
223
|
+
toDateAmountType: 0,
|
|
224
|
+
enableManualPackaging: false,
|
|
225
|
+
allowFlights: false,
|
|
226
|
+
allowAccommodations: false,
|
|
227
|
+
allowCarRentals: false,
|
|
228
|
+
allowTransfers: false,
|
|
229
|
+
allowExcursions: false,
|
|
230
|
+
qsmType: 3
|
|
231
|
+
},
|
|
213
232
|
tideConnection: {
|
|
214
233
|
host: 'https://tide-default3468-acceptance.tidesoftware.be',
|
|
215
234
|
apiKey: 'e9b95d79-de4c-41d6-ab7e-3dd429873058',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
2
|
import { SearchResult, SearchResultsConfiguration } from '../../types';
|
|
3
3
|
import SearchResults from '../..';
|
|
4
|
-
import { Navbar, Footer
|
|
4
|
+
import { Navbar, Footer } from '../../../../src';
|
|
5
5
|
import { TideLogo, language, languages, topLinks, navItems } from '../../../../src/content/navbar/placeholderData';
|
|
6
6
|
import Icon from '../../components/icon';
|
|
7
7
|
|
|
@@ -86,7 +86,26 @@ const HotelFlightSearchResultsSelfContained: React.FC<HotelFlightSearchResultsSe
|
|
|
86
86
|
};
|
|
87
87
|
|
|
88
88
|
const configuration: SearchResultsConfiguration = {
|
|
89
|
-
|
|
89
|
+
searchConfiguration: {
|
|
90
|
+
id: 7,
|
|
91
|
+
name: 'Transport + hotel',
|
|
92
|
+
icon: '',
|
|
93
|
+
defaultSearchType: 0,
|
|
94
|
+
serviceTypes: [0],
|
|
95
|
+
defaultCatalogueId: 1,
|
|
96
|
+
defaultDuration: undefined,
|
|
97
|
+
fromDateAmount: 1,
|
|
98
|
+
fromDateAmountType: 1,
|
|
99
|
+
toDateAmount: 7,
|
|
100
|
+
toDateAmountType: 0,
|
|
101
|
+
enableManualPackaging: true,
|
|
102
|
+
allowFlights: true,
|
|
103
|
+
allowAccommodations: true,
|
|
104
|
+
allowCarRentals: false,
|
|
105
|
+
allowTransfers: false,
|
|
106
|
+
allowExcursions: false,
|
|
107
|
+
qsmType: 2
|
|
108
|
+
},
|
|
90
109
|
showFilters: false,
|
|
91
110
|
tideConnection: {
|
|
92
111
|
host: 'https://tide-default3468-acceptance.tidesoftware.be',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
2
|
import { Filter, SearchResult, SearchResultsConfiguration } from '../../types';
|
|
3
3
|
import SearchResults from '../..';
|
|
4
|
-
import { Navbar, Footer
|
|
4
|
+
import { Navbar, Footer } from '../../../../src';
|
|
5
5
|
import { TideLogo, language, languages, topLinks, navItems } from '../../../../src/content/navbar/placeholderData';
|
|
6
6
|
import Icon from '../../components/icon';
|
|
7
7
|
|
|
@@ -126,7 +126,26 @@ const HotelSearchResultsSelfContained: React.FC<HotelSearchResultsSelfContainedP
|
|
|
126
126
|
};
|
|
127
127
|
|
|
128
128
|
const configuration: SearchResultsConfiguration = {
|
|
129
|
-
|
|
129
|
+
searchConfiguration: {
|
|
130
|
+
id: 5,
|
|
131
|
+
name: 'Search Hotels',
|
|
132
|
+
icon: '',
|
|
133
|
+
defaultSearchType: 0,
|
|
134
|
+
serviceTypes: [3],
|
|
135
|
+
defaultCatalogueId: 1,
|
|
136
|
+
defaultDuration: undefined,
|
|
137
|
+
fromDateAmount: 1,
|
|
138
|
+
fromDateAmountType: 1,
|
|
139
|
+
toDateAmount: 7,
|
|
140
|
+
toDateAmountType: 0,
|
|
141
|
+
enableManualPackaging: false,
|
|
142
|
+
allowFlights: false,
|
|
143
|
+
allowAccommodations: false,
|
|
144
|
+
allowCarRentals: false,
|
|
145
|
+
allowTransfers: false,
|
|
146
|
+
allowExcursions: false,
|
|
147
|
+
qsmType: 1
|
|
148
|
+
},
|
|
130
149
|
tideConnection: {
|
|
131
150
|
host: 'https://tide-default3468-acceptance.tidesoftware.be',
|
|
132
151
|
apiKey: 'e9b95d79-de4c-41d6-ab7e-3dd429873058',
|
|
@@ -1,14 +1,33 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { SearchResultsConfiguration } from '../../types';
|
|
3
3
|
import SearchResults from '../..';
|
|
4
|
-
import { Navbar, Footer
|
|
4
|
+
import { Navbar, Footer } from '../../../../src';
|
|
5
5
|
import { TideLogo, language, languages, topLinks, navItems } from '../../../../src/content/navbar/placeholderData';
|
|
6
6
|
|
|
7
7
|
interface RoundtripSearchResultsSelfContainedProps {}
|
|
8
8
|
|
|
9
9
|
const RoundtripSearchResultsSelfContained: React.FC<RoundtripSearchResultsSelfContainedProps> = () => {
|
|
10
10
|
const configuration: SearchResultsConfiguration = {
|
|
11
|
-
|
|
11
|
+
searchConfiguration: {
|
|
12
|
+
id: 4,
|
|
13
|
+
name: 'Search roundtrip',
|
|
14
|
+
icon: '',
|
|
15
|
+
defaultSearchType: 1,
|
|
16
|
+
serviceTypes: [0],
|
|
17
|
+
defaultCatalogueId: 1,
|
|
18
|
+
defaultDuration: undefined,
|
|
19
|
+
fromDateAmount: 1,
|
|
20
|
+
fromDateAmountType: 1,
|
|
21
|
+
toDateAmount: 7,
|
|
22
|
+
toDateAmountType: 0,
|
|
23
|
+
enableManualPackaging: false,
|
|
24
|
+
allowFlights: false,
|
|
25
|
+
allowAccommodations: false,
|
|
26
|
+
allowCarRentals: false,
|
|
27
|
+
allowTransfers: false,
|
|
28
|
+
allowExcursions: false,
|
|
29
|
+
qsmType: 4
|
|
30
|
+
},
|
|
12
31
|
showFilters: true,
|
|
13
32
|
tideConnection: {
|
|
14
33
|
host: 'https://tide-default3468-acceptance.tidesoftware.be',
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { createSlice, PayloadAction } from '@reduxjs/toolkit';
|
|
2
2
|
import { ExtendedFlightSearchResponseItem, Filter } from '../types';
|
|
3
|
-
import { BookingPackage, BookingPackageItem, EntryLight } from '@qite/tide-client/build/types';
|
|
3
|
+
import { BookingPackage, BookingPackageItem, EntryLight, PackagingAccommodationResponse } from '@qite/tide-client/build/types';
|
|
4
4
|
|
|
5
5
|
export interface SearchResultsState {
|
|
6
6
|
results: BookingPackageItem[];
|
|
7
7
|
filteredResults: BookingPackageItem[];
|
|
8
8
|
selectedSearchResultId: number | null;
|
|
9
|
+
packagingAccoResults: PackagingAccommodationResponse[];
|
|
10
|
+
filteredPackagingAccoResults: PackagingAccommodationResponse[];
|
|
11
|
+
selectedPackagingAccoResultCode: string | null;
|
|
9
12
|
selectedFlight: ExtendedFlightSearchResponseItem | null;
|
|
10
13
|
selectedFlightDetails: ExtendedFlightSearchResponseItem | null;
|
|
11
14
|
bookingPackageDetails: BookingPackage | null;
|
|
@@ -22,6 +25,9 @@ const initialState: SearchResultsState = {
|
|
|
22
25
|
results: [],
|
|
23
26
|
filteredResults: [],
|
|
24
27
|
selectedSearchResultId: null,
|
|
28
|
+
packagingAccoResults: [],
|
|
29
|
+
filteredPackagingAccoResults: [],
|
|
30
|
+
selectedPackagingAccoResultCode: null,
|
|
25
31
|
selectedFlight: null,
|
|
26
32
|
selectedFlightDetails: null,
|
|
27
33
|
bookingPackageDetails: null,
|
|
@@ -47,6 +53,15 @@ const searchResultsSlice = createSlice({
|
|
|
47
53
|
setSelectedSearchResult(state, action: PayloadAction<number | null>) {
|
|
48
54
|
state.selectedSearchResultId = action.payload;
|
|
49
55
|
},
|
|
56
|
+
setPackagingAccoResults(state, action: PayloadAction<PackagingAccommodationResponse[]>) {
|
|
57
|
+
state.packagingAccoResults = action.payload;
|
|
58
|
+
},
|
|
59
|
+
setFilteredPackagingAccoResults(state, action: PayloadAction<PackagingAccommodationResponse[]>) {
|
|
60
|
+
state.filteredPackagingAccoResults = action.payload;
|
|
61
|
+
},
|
|
62
|
+
setSelectedPackagingAccoResult(state, action: PayloadAction<string | null>) {
|
|
63
|
+
state.selectedPackagingAccoResultCode = action.payload;
|
|
64
|
+
},
|
|
50
65
|
setSelectedFlight(state, action: PayloadAction<ExtendedFlightSearchResponseItem | null>) {
|
|
51
66
|
state.selectedFlight = action.payload;
|
|
52
67
|
},
|
|
@@ -116,6 +131,9 @@ export const {
|
|
|
116
131
|
setResults,
|
|
117
132
|
setFilteredResults,
|
|
118
133
|
setSelectedSearchResult,
|
|
134
|
+
setPackagingAccoResults,
|
|
135
|
+
setFilteredPackagingAccoResults,
|
|
136
|
+
setSelectedPackagingAccoResult,
|
|
119
137
|
setSelectedFlight,
|
|
120
138
|
setSelectedFlightDetails,
|
|
121
139
|
setBookingPackageDetails,
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import { FlightSearchResponseItem } from '@qite/tide-client';
|
|
1
|
+
import { FlightSearchResponseItem, WebsiteConfigurationSearchConfiguration } from '@qite/tide-client';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
import { PortalQsmType } from '../shared/types';
|
|
4
3
|
|
|
5
4
|
export type FlightSelectionMode = 'paired' | 'independent';
|
|
6
5
|
|
|
7
6
|
export interface SearchResultsConfiguration {
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
searchConfiguration: WebsiteConfigurationSearchConfiguration;
|
|
10
8
|
// Tide connection
|
|
11
9
|
tideConnection: {
|
|
12
10
|
host: string;
|
|
@@ -87,7 +85,8 @@ export interface PaginationConfig {
|
|
|
87
85
|
export type SearchResult = HotelResult | FlightResult | RoundTripResult;
|
|
88
86
|
|
|
89
87
|
export interface BaseSearchResult {
|
|
90
|
-
id
|
|
88
|
+
id?: number;
|
|
89
|
+
code: string;
|
|
91
90
|
title: string;
|
|
92
91
|
image: string;
|
|
93
92
|
description?: string;
|
|
@@ -103,6 +102,7 @@ export interface BaseSearchResult {
|
|
|
103
102
|
export interface HotelResult extends BaseSearchResult {
|
|
104
103
|
type: 'hotel';
|
|
105
104
|
days: string;
|
|
105
|
+
contents?: string;
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
export interface RoundTripResult extends BaseSearchResult {
|