@qite/tide-booking-component 1.4.100 → 1.4.102
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 +990 -423
- package/build/build-cjs/src/index.d.ts +3 -1
- package/build/build-cjs/src/search-results/components/itinerary/full-itinerary.d.ts +6 -0
- package/build/build-cjs/src/search-results/store/search-results-slice.d.ts +18 -2
- package/build/build-cjs/src/search-results/types.d.ts +3 -1
- package/build/build-cjs/src/search-results/utils/flight-utils.d.ts +1 -0
- package/build/build-esm/index.js +990 -417
- package/build/build-esm/src/index.d.ts +3 -1
- package/build/build-esm/src/search-results/components/itinerary/full-itinerary.d.ts +6 -0
- package/build/build-esm/src/search-results/store/search-results-slice.d.ts +18 -2
- package/build/build-esm/src/search-results/types.d.ts +3 -1
- package/build/build-esm/src/search-results/utils/flight-utils.d.ts +1 -0
- package/package.json +2 -2
- package/src/index.ts +3 -1
- package/src/search-results/components/flight/flight-selection/independent-flight-option.tsx +1 -7
- package/src/search-results/components/flight/flight-selection/independent-flight-selection.tsx +2 -6
- package/src/search-results/components/itinerary/full-itinerary.tsx +266 -0
- package/src/search-results/components/itinerary/index.tsx +0 -2
- package/src/search-results/components/search-results-container/search-results-container.tsx +668 -78
- package/src/search-results/store/search-results-slice.ts +35 -3
- package/src/search-results/types.ts +3 -1
- package/src/search-results/utils/flight-utils.ts +5 -0
- package/src/shared/components/flyin/accommodation-flyin.tsx +4 -2
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import { createSlice, PayloadAction } from '@reduxjs/toolkit';
|
|
2
2
|
import { AccommodationFlyInStep, ExtendedFlightSearchResponseItem, Filter, SortByType } from '../types';
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
BookingPackage,
|
|
5
|
+
BookingPackageItem,
|
|
6
|
+
BookingPriceDetails,
|
|
7
|
+
ClientPortalItinerary,
|
|
8
|
+
PackagingAccommodationResponse,
|
|
9
|
+
PackagingEntry,
|
|
10
|
+
PackagingFlightResponse
|
|
11
|
+
} from '@qite/tide-client/build/types';
|
|
4
12
|
|
|
5
13
|
export interface SearchResultsState {
|
|
6
14
|
results: BookingPackageItem[];
|
|
@@ -10,10 +18,13 @@ export interface SearchResultsState {
|
|
|
10
18
|
filteredPackagingAccoResults: PackagingAccommodationResponse[];
|
|
11
19
|
packagingAccoSearchDetails: PackagingAccommodationResponse[];
|
|
12
20
|
selectedPackagingAccoResultCode: string | null;
|
|
21
|
+
packagingFlightResults: PackagingFlightResponse[];
|
|
22
|
+
selectedPackagingFlight: PackagingFlightResponse | null;
|
|
13
23
|
selectedFlight: ExtendedFlightSearchResponseItem | null;
|
|
14
24
|
selectedFlightDetails: ExtendedFlightSearchResponseItem | null;
|
|
15
25
|
bookingPackageDetails: BookingPackage | null;
|
|
16
26
|
isLoading: boolean;
|
|
27
|
+
flightsLoading: boolean;
|
|
17
28
|
filters: Filter[];
|
|
18
29
|
selectedSortType: SortByType | null;
|
|
19
30
|
activeTab: string | null;
|
|
@@ -23,6 +34,7 @@ export interface SearchResultsState {
|
|
|
23
34
|
transactionId: string | null;
|
|
24
35
|
accommodationFlyInStep: AccommodationFlyInStep;
|
|
25
36
|
priceDetails: BookingPriceDetails | null;
|
|
37
|
+
itinerary: ClientPortalItinerary | null;
|
|
26
38
|
}
|
|
27
39
|
|
|
28
40
|
const initialState: SearchResultsState = {
|
|
@@ -33,10 +45,13 @@ const initialState: SearchResultsState = {
|
|
|
33
45
|
filteredPackagingAccoResults: [],
|
|
34
46
|
packagingAccoSearchDetails: [],
|
|
35
47
|
selectedPackagingAccoResultCode: null,
|
|
48
|
+
packagingFlightResults: [],
|
|
49
|
+
selectedPackagingFlight: null,
|
|
36
50
|
selectedFlight: null,
|
|
37
51
|
selectedFlightDetails: null,
|
|
38
52
|
bookingPackageDetails: null,
|
|
39
53
|
isLoading: false,
|
|
54
|
+
flightsLoading: false,
|
|
40
55
|
filters: [],
|
|
41
56
|
selectedSortType: null,
|
|
42
57
|
activeTab: 'compact',
|
|
@@ -45,7 +60,8 @@ const initialState: SearchResultsState = {
|
|
|
45
60
|
editablePackagingEntry: null,
|
|
46
61
|
transactionId: null,
|
|
47
62
|
accommodationFlyInStep: 'details',
|
|
48
|
-
priceDetails: null
|
|
63
|
+
priceDetails: null,
|
|
64
|
+
itinerary: null
|
|
49
65
|
};
|
|
50
66
|
|
|
51
67
|
const searchResultsSlice = createSlice({
|
|
@@ -73,6 +89,12 @@ const searchResultsSlice = createSlice({
|
|
|
73
89
|
setSelectedPackagingAccoResult(state, action: PayloadAction<string | null>) {
|
|
74
90
|
state.selectedPackagingAccoResultCode = action.payload;
|
|
75
91
|
},
|
|
92
|
+
setPackagingFlightResults(state, action: PayloadAction<PackagingFlightResponse[]>) {
|
|
93
|
+
state.packagingFlightResults = action.payload;
|
|
94
|
+
},
|
|
95
|
+
setSelectedPackagingFlight(state, action: PayloadAction<PackagingFlightResponse | null>) {
|
|
96
|
+
state.selectedPackagingFlight = action.payload;
|
|
97
|
+
},
|
|
76
98
|
setSelectedFlight(state, action: PayloadAction<ExtendedFlightSearchResponseItem | null>) {
|
|
77
99
|
state.selectedFlight = action.payload;
|
|
78
100
|
},
|
|
@@ -97,6 +119,9 @@ const searchResultsSlice = createSlice({
|
|
|
97
119
|
setIsLoading(state, action: PayloadAction<boolean>) {
|
|
98
120
|
state.isLoading = action.payload;
|
|
99
121
|
},
|
|
122
|
+
setFlightsLoading(state, action: PayloadAction<boolean>) {
|
|
123
|
+
state.flightsLoading = action.payload;
|
|
124
|
+
},
|
|
100
125
|
setFilters(state, action: PayloadAction<Filter[]>) {
|
|
101
126
|
const updatedFilters = action.payload;
|
|
102
127
|
|
|
@@ -143,6 +168,9 @@ const searchResultsSlice = createSlice({
|
|
|
143
168
|
},
|
|
144
169
|
setPriceDetails(state, action: PayloadAction<BookingPriceDetails | null>) {
|
|
145
170
|
state.priceDetails = action.payload;
|
|
171
|
+
},
|
|
172
|
+
setItinerary(state, action: PayloadAction<ClientPortalItinerary | null>) {
|
|
173
|
+
state.itinerary = action.payload;
|
|
146
174
|
}
|
|
147
175
|
}
|
|
148
176
|
});
|
|
@@ -155,11 +183,14 @@ export const {
|
|
|
155
183
|
setFilteredPackagingAccoResults,
|
|
156
184
|
setPackagingAccoSearchDetails,
|
|
157
185
|
setSelectedPackagingAccoResult,
|
|
186
|
+
setPackagingFlightResults,
|
|
187
|
+
setSelectedPackagingFlight,
|
|
158
188
|
setSelectedFlight,
|
|
159
189
|
setSelectedFlightDetails,
|
|
160
190
|
setBookingPackageDetails,
|
|
161
191
|
selectFlight,
|
|
162
192
|
setIsLoading,
|
|
193
|
+
setFlightsLoading,
|
|
163
194
|
setFilters,
|
|
164
195
|
resetFilters,
|
|
165
196
|
setSortType,
|
|
@@ -170,7 +201,8 @@ export const {
|
|
|
170
201
|
setEditablePackagingEntry,
|
|
171
202
|
setTransactionId,
|
|
172
203
|
setAccommodationFlyInStep,
|
|
173
|
-
setPriceDetails
|
|
204
|
+
setPriceDetails,
|
|
205
|
+
setItinerary
|
|
174
206
|
} = searchResultsSlice.actions;
|
|
175
207
|
|
|
176
208
|
export default searchResultsSlice.reducer;
|
|
@@ -59,7 +59,7 @@ export interface SearchResultsConfiguration {
|
|
|
59
59
|
|
|
60
60
|
destinationImage?: { url: string; alt: string };
|
|
61
61
|
onBook?: (result: BookingPackage) => void;
|
|
62
|
-
packagingEntry?: PackagingEntry;
|
|
62
|
+
packagingEntry?: PackagingEntry | null;
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
export type FilterType = 'checkbox' | 'toggle' | 'slider' | 'star-rating';
|
|
@@ -199,6 +199,8 @@ export type SearchSeed = {
|
|
|
199
199
|
tagId?: number | null;
|
|
200
200
|
departureAirport?: string | null;
|
|
201
201
|
returnAirport?: string | null;
|
|
202
|
+
travelClass?: string | null;
|
|
203
|
+
nationality?: string | null;
|
|
202
204
|
destinationAirport?: string | null;
|
|
203
205
|
rooms: BookingPackageRequestRoom[];
|
|
204
206
|
};
|
|
@@ -3,6 +3,11 @@ import { FlightSearchResponseFlight, FlightSearchResponseFlightSegment, VendorTy
|
|
|
3
3
|
import { ExtendedFlightSearchResponseItem, SortByType } from '../types';
|
|
4
4
|
import { DepartureRange } from '../../shared/types';
|
|
5
5
|
|
|
6
|
+
export const getFlightKey = (segments: FlightSearchResponseFlightSegment[]) => {
|
|
7
|
+
if (!segments || segments.length === 0) return '';
|
|
8
|
+
return segments.map((s) => `${s.marketingAirlineCode}${s.flightNumber}_${s.departureDateTime}`).join('_');
|
|
9
|
+
};
|
|
10
|
+
|
|
6
11
|
export const getOutwardFlight = (flightResult: ExtendedFlightSearchResponseItem): FlightSearchResponseFlight | undefined => {
|
|
7
12
|
return flightResult?.outward;
|
|
8
13
|
};
|
|
@@ -29,12 +29,14 @@ type GroupedAccommodation = {
|
|
|
29
29
|
regimes: PickerItem[];
|
|
30
30
|
};
|
|
31
31
|
|
|
32
|
-
const formatPrice = (price?: number, currencyCode
|
|
32
|
+
const formatPrice = (price?: number, currencyCode?: string | null) => {
|
|
33
33
|
if (typeof price !== 'number') return '';
|
|
34
34
|
|
|
35
|
+
const safeCurrency = currencyCode ?? 'EUR';
|
|
36
|
+
|
|
35
37
|
return new Intl.NumberFormat('nl-BE', {
|
|
36
38
|
style: 'currency',
|
|
37
|
-
currency:
|
|
39
|
+
currency: safeCurrency
|
|
38
40
|
}).format(price);
|
|
39
41
|
};
|
|
40
42
|
|