@qite/tide-booking-component 1.4.85 → 1.4.87
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 +596 -316
- package/build/build-cjs/src/qsm/components/item-picker/index.d.ts +4 -4
- package/build/build-cjs/src/qsm/store/qsm-slice.d.ts +5 -5
- package/build/build-cjs/src/qsm/types.d.ts +4 -9
- package/build/build-cjs/src/search-results/components/item-picker/index.d.ts +2 -2
- package/build/build-cjs/src/search-results/store/search-results-slice.d.ts +5 -0
- package/build/build-cjs/src/search-results/types.d.ts +2 -1
- package/build/build-cjs/src/shared/types.d.ts +2 -7
- package/build/build-esm/index.js +596 -316
- package/build/build-esm/src/qsm/components/item-picker/index.d.ts +4 -4
- package/build/build-esm/src/qsm/store/qsm-slice.d.ts +5 -5
- package/build/build-esm/src/qsm/types.d.ts +4 -9
- package/build/build-esm/src/search-results/components/item-picker/index.d.ts +2 -2
- package/build/build-esm/src/search-results/store/search-results-slice.d.ts +5 -0
- package/build/build-esm/src/search-results/types.d.ts +2 -1
- package/build/build-esm/src/shared/types.d.ts +2 -7
- package/package.json +2 -2
- package/src/content/features/content-page/content-page-self-contained.tsx +17 -17
- package/src/qsm/components/item-picker/index.tsx +10 -13
- package/src/qsm/components/travel-class-picker/index.tsx +3 -2
- package/src/qsm/components/travel-nationality-picker/index.tsx +3 -2
- package/src/qsm/components/travel-type-picker/index.tsx +3 -2
- package/src/qsm/store/qsm-slice.ts +5 -5
- package/src/qsm/types.ts +5 -10
- package/src/search-results/components/group-tour/group-tour-card.tsx +10 -2
- package/src/search-results/components/item-picker/index.tsx +2 -2
- package/src/search-results/components/search-results-container/flight-search-results.tsx +5 -5
- package/src/search-results/components/search-results-container/search-results-container.tsx +104 -9
- package/src/search-results/store/search-results-slice.ts +6 -0
- package/src/search-results/types.ts +2 -1
- package/src/shared/components/flyin/accommodation-flyin.tsx +373 -157
- package/src/shared/types.ts +13 -7
- package/styles/components/_flyin.scss +187 -158
|
@@ -13,7 +13,8 @@ import {
|
|
|
13
13
|
setFlyInIsOpen,
|
|
14
14
|
setFilteredResults,
|
|
15
15
|
setPackagingAccoResults,
|
|
16
|
-
setFilteredPackagingAccoResults
|
|
16
|
+
setFilteredPackagingAccoResults,
|
|
17
|
+
setPackagingAccoSearchDetails
|
|
17
18
|
} from '../../store/search-results-slice';
|
|
18
19
|
import { Filter, SortByType } from '../../types';
|
|
19
20
|
import useMediaQuery from '../../../shared/utils/use-media-query-util';
|
|
@@ -575,9 +576,9 @@ const SearchResultsContainer: React.FC = () => {
|
|
|
575
576
|
|
|
576
577
|
// Seperate detailsCall
|
|
577
578
|
useEffect(() => {
|
|
578
|
-
const
|
|
579
|
-
|
|
580
|
-
|
|
579
|
+
const fetchDetails = async () => {
|
|
580
|
+
console.log('Fetching details for selected search result', selectedSearchResultId);
|
|
581
|
+
if (!selectedSearchResultId || !context) return;
|
|
581
582
|
if (context?.searchConfiguration.qsmType === PortalQsmType.Accommodation || context?.searchConfiguration.qsmType === PortalQsmType.GroupTour) {
|
|
582
583
|
handleFlyInToggle(true);
|
|
583
584
|
}
|
|
@@ -631,17 +632,111 @@ const SearchResultsContainer: React.FC = () => {
|
|
|
631
632
|
console.log('Details:', detailsResponse);
|
|
632
633
|
dispatch(setBookingPackageDetails({ details: detailsResponse?.payload }));
|
|
633
634
|
} else {
|
|
634
|
-
const detailsWLResponse = await detailsWL(config, detailsRequest);
|
|
635
|
-
console.log('Details with entryLight:', detailsWLResponse);
|
|
636
|
-
dispatch(setBookingPackageDetails({ details: detailsWLResponse?.payload?.bookingPackage }));
|
|
637
|
-
dispatch(setEntry({ entry: detailsWLResponse?.payload?.entry }));
|
|
635
|
+
// const detailsWLResponse = await detailsWL(config, detailsRequest);
|
|
636
|
+
// console.log('Details with entryLight:', detailsWLResponse);
|
|
637
|
+
// dispatch(setBookingPackageDetails({ details: detailsWLResponse?.payload?.bookingPackage }));
|
|
638
|
+
// dispatch(setEntry({ entry: detailsWLResponse?.payload?.entry }));
|
|
639
|
+
|
|
640
|
+
const detailsResponse = await details(config, detailsRequest);
|
|
641
|
+
dispatch(setBookingPackageDetails({ details: detailsResponse?.payload }));
|
|
638
642
|
}
|
|
639
643
|
} catch (err) {
|
|
640
644
|
console.error('Failed to fetch package details', err);
|
|
641
645
|
}
|
|
642
646
|
};
|
|
643
647
|
|
|
644
|
-
|
|
648
|
+
const fetchPackagingAccoSearchDetails = async () => {
|
|
649
|
+
if (!selectedPackagingAccoResultCode || !context) return;
|
|
650
|
+
|
|
651
|
+
if (context?.searchConfiguration.qsmType === PortalQsmType.Accommodation || context?.searchConfiguration.qsmType === PortalQsmType.GroupTour) {
|
|
652
|
+
handleFlyInToggle(true);
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
try {
|
|
656
|
+
const config: TideClientConfig = {
|
|
657
|
+
host: context.tideConnection.host,
|
|
658
|
+
apiKey: context.tideConnection.apiKey
|
|
659
|
+
};
|
|
660
|
+
|
|
661
|
+
console.log('selectedPackagingAccoResultCode', selectedPackagingAccoResultCode);
|
|
662
|
+
const selectedItem = packagingAccoResults.find((r) => r.code === selectedPackagingAccoResultCode);
|
|
663
|
+
console.log('Selected packaging acco item', selectedItem);
|
|
664
|
+
if (!selectedItem) {
|
|
665
|
+
// TODO: handle this case better, show an error message to the user
|
|
666
|
+
return;
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
const params = new URLSearchParams(location.search);
|
|
670
|
+
const rooms = getRoomsFromParams(params, 'rooms');
|
|
671
|
+
let tagId = getNumberFromParams(params, 'tagId');
|
|
672
|
+
let agentId = getNumberFromParams(params, 'agentId');
|
|
673
|
+
|
|
674
|
+
let destinationAirport = getStringFromParams(params, 'destinationAirport');
|
|
675
|
+
|
|
676
|
+
let destinationId: number | null = null;
|
|
677
|
+
let destinationIsCountry = false;
|
|
678
|
+
let destinationIsRegion = false;
|
|
679
|
+
let destinationIsOord = false;
|
|
680
|
+
let destinationIsLocation = false;
|
|
681
|
+
let destinationCode: string | null = null;
|
|
682
|
+
let destinationIsAirport = false;
|
|
683
|
+
|
|
684
|
+
if (selectedItem.countryId) {
|
|
685
|
+
destinationId = selectedItem.countryId;
|
|
686
|
+
destinationIsCountry = true;
|
|
687
|
+
} else if (selectedItem.regionId) {
|
|
688
|
+
destinationId = selectedItem.regionId;
|
|
689
|
+
destinationIsRegion = true;
|
|
690
|
+
} else if (selectedItem.oordId) {
|
|
691
|
+
destinationId = selectedItem.oordId;
|
|
692
|
+
destinationIsOord = true;
|
|
693
|
+
} else if (selectedItem.locationId) {
|
|
694
|
+
destinationId = selectedItem.locationId;
|
|
695
|
+
destinationIsLocation = true;
|
|
696
|
+
} else if (destinationAirport) {
|
|
697
|
+
destinationCode = destinationAirport;
|
|
698
|
+
destinationIsAirport = true;
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
const detailSearchRequest: PackagingAccommodationRequest = {
|
|
702
|
+
officeId: 1,
|
|
703
|
+
portalId: context.portalId,
|
|
704
|
+
agentId: agentId ?? null,
|
|
705
|
+
catalogueId: context!.searchConfiguration.defaultCatalogueId ?? 0,
|
|
706
|
+
searchConfigurationId: context!.searchConfiguration.id,
|
|
707
|
+
vendorConfigurationId: selectedItem.vendorId,
|
|
708
|
+
language: context!.languageCode ?? 'en-GB',
|
|
709
|
+
serviceType: 3,
|
|
710
|
+
fromDate: selectedItem.fromDate,
|
|
711
|
+
toDate: selectedItem.toDate,
|
|
712
|
+
destination: {
|
|
713
|
+
id: Number(destinationId),
|
|
714
|
+
isCountry: destinationIsCountry,
|
|
715
|
+
isRegion: destinationIsRegion,
|
|
716
|
+
isOord: destinationIsOord,
|
|
717
|
+
isLocation: destinationIsLocation,
|
|
718
|
+
isAirport: destinationIsAirport,
|
|
719
|
+
code: destinationCode
|
|
720
|
+
} as PackagingDestination,
|
|
721
|
+
productCode: selectedItem.code ? selectedItem.code : '',
|
|
722
|
+
rooms: getPackagingRequestRooms(rooms),
|
|
723
|
+
tagIds: tagId ? [tagId] : []
|
|
724
|
+
};
|
|
725
|
+
|
|
726
|
+
const packageAccoSearchDetails = await searchPackagingAccommodations(config, detailSearchRequest);
|
|
727
|
+
console.log('Packaging Acco Search details', packageAccoSearchDetails);
|
|
728
|
+
dispatch(setPackagingAccoSearchDetails(packageAccoSearchDetails));
|
|
729
|
+
} catch (err) {
|
|
730
|
+
console.error('Failed to fetch package details', err);
|
|
731
|
+
}
|
|
732
|
+
};
|
|
733
|
+
|
|
734
|
+
if (selectedSearchResultId) {
|
|
735
|
+
fetchDetails();
|
|
736
|
+
}
|
|
737
|
+
if (selectedPackagingAccoResultCode) {
|
|
738
|
+
fetchPackagingAccoSearchDetails();
|
|
739
|
+
}
|
|
645
740
|
}, [selectedSearchResultId, selectedPackagingAccoResultCode]);
|
|
646
741
|
|
|
647
742
|
useEffect(() => {
|
|
@@ -8,6 +8,7 @@ export interface SearchResultsState {
|
|
|
8
8
|
selectedSearchResultId: number | null;
|
|
9
9
|
packagingAccoResults: PackagingAccommodationResponse[];
|
|
10
10
|
filteredPackagingAccoResults: PackagingAccommodationResponse[];
|
|
11
|
+
packagingAccoSearchDetails: PackagingAccommodationResponse[];
|
|
11
12
|
selectedPackagingAccoResultCode: string | null;
|
|
12
13
|
selectedFlight: ExtendedFlightSearchResponseItem | null;
|
|
13
14
|
selectedFlightDetails: ExtendedFlightSearchResponseItem | null;
|
|
@@ -27,6 +28,7 @@ const initialState: SearchResultsState = {
|
|
|
27
28
|
selectedSearchResultId: null,
|
|
28
29
|
packagingAccoResults: [],
|
|
29
30
|
filteredPackagingAccoResults: [],
|
|
31
|
+
packagingAccoSearchDetails: [],
|
|
30
32
|
selectedPackagingAccoResultCode: null,
|
|
31
33
|
selectedFlight: null,
|
|
32
34
|
selectedFlightDetails: null,
|
|
@@ -59,6 +61,9 @@ const searchResultsSlice = createSlice({
|
|
|
59
61
|
setFilteredPackagingAccoResults(state, action: PayloadAction<PackagingAccommodationResponse[]>) {
|
|
60
62
|
state.filteredPackagingAccoResults = action.payload;
|
|
61
63
|
},
|
|
64
|
+
setPackagingAccoSearchDetails(state, action: PayloadAction<PackagingAccommodationResponse[]>) {
|
|
65
|
+
state.packagingAccoSearchDetails = action.payload;
|
|
66
|
+
},
|
|
62
67
|
setSelectedPackagingAccoResult(state, action: PayloadAction<string | null>) {
|
|
63
68
|
state.selectedPackagingAccoResultCode = action.payload;
|
|
64
69
|
},
|
|
@@ -133,6 +138,7 @@ export const {
|
|
|
133
138
|
setSelectedSearchResult,
|
|
134
139
|
setPackagingAccoResults,
|
|
135
140
|
setFilteredPackagingAccoResults,
|
|
141
|
+
setPackagingAccoSearchDetails,
|
|
136
142
|
setSelectedPackagingAccoResult,
|
|
137
143
|
setSelectedFlight,
|
|
138
144
|
setSelectedFlightDetails,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FlightSearchResponseItem, WebsiteConfigurationSearchConfiguration } from '@qite/tide-client';
|
|
1
|
+
import { BookingPackageItem, FlightSearchResponseItem, WebsiteConfigurationSearchConfiguration } from '@qite/tide-client';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
|
|
4
4
|
export type FlightSelectionMode = 'paired' | 'independent';
|
|
@@ -51,6 +51,7 @@ export interface SearchResultsConfiguration {
|
|
|
51
51
|
languageCode?: string;
|
|
52
52
|
|
|
53
53
|
destinationImage?: { url: string; alt: string };
|
|
54
|
+
onBook?: (result: BookingPackageItem) => void;
|
|
54
55
|
}
|
|
55
56
|
|
|
56
57
|
export type FilterType = 'checkbox' | 'toggle' | 'slider' | 'star-rating';
|