@qite/tide-booking-component 1.4.79 → 1.4.81
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 +826 -395
- package/build/build-cjs/src/booking-wizard/features/booking/api.d.ts +4 -0
- package/build/build-cjs/src/booking-wizard/features/booking/booking-slice.d.ts +16 -0
- package/build/build-cjs/src/booking-wizard/features/booking/selectors.d.ts +1 -0
- package/build/build-cjs/src/booking-wizard/types.d.ts +1 -0
- package/build/build-cjs/src/qsm/store/qsm-slice.d.ts +2 -1
- package/build/build-cjs/src/qsm/types.d.ts +2 -2
- 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-cjs/src/shared/components/flyin/flyin.d.ts +1 -1
- package/build/build-cjs/src/shared/types.d.ts +0 -13
- package/build/build-esm/index.js +828 -393
- package/build/build-esm/src/booking-wizard/features/booking/api.d.ts +4 -0
- package/build/build-esm/src/booking-wizard/features/booking/booking-slice.d.ts +16 -0
- package/build/build-esm/src/booking-wizard/features/booking/selectors.d.ts +1 -0
- package/build/build-esm/src/booking-wizard/types.d.ts +1 -0
- package/build/build-esm/src/qsm/store/qsm-slice.d.ts +2 -1
- package/build/build-esm/src/qsm/types.d.ts +2 -2
- 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/build/build-esm/src/shared/components/flyin/flyin.d.ts +1 -1
- package/build/build-esm/src/shared/types.d.ts +0 -13
- package/package.json +2 -2
- package/src/booking-wizard/features/booking/api.ts +8 -2
- package/src/booking-wizard/features/booking/booking-slice.ts +15 -1
- package/src/booking-wizard/features/booking/selectors.ts +2 -0
- package/src/booking-wizard/features/travelers-form/travelers-form.tsx +46 -23
- package/src/booking-wizard/settings-context.ts +2 -1
- package/src/booking-wizard/types.ts +1 -0
- package/src/content/features/content-page/content-page-self-contained.tsx +6 -6
- package/src/qsm/components/QSMContainer/qsm-container.tsx +10 -2
- package/src/qsm/components/travel-input/index.tsx +1 -1
- package/src/qsm/components/travel-input-group/index.tsx +1 -1
- package/src/qsm/qsm-configuration-context.ts +1 -1
- package/src/qsm/store/qsm-slice.ts +2 -1
- package/src/qsm/types.ts +2 -2
- package/src/search-results/components/hotel/hotel-accommodation-results.tsx +97 -99
- package/src/search-results/components/hotel/hotel-card.tsx +33 -7
- package/src/search-results/components/search-results-container/flight-search-results.tsx +3 -3
- package/src/search-results/components/search-results-container/search-results-container.tsx +198 -42
- 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/src/shared/components/flyin/flyin.tsx +1 -1
- package/src/shared/types.ts +0 -14
- 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
|
@@ -22,5 +22,9 @@ declare const packageApi: {
|
|
|
22
22
|
) => Promise<{
|
|
23
23
|
[key: string]: string;
|
|
24
24
|
}>;
|
|
25
|
+
fetchCountries: (
|
|
26
|
+
signal: AbortSignal,
|
|
27
|
+
apiSettings?: ApiSettingsState
|
|
28
|
+
) => Promise<import('@qite/tide-client').PageResult<import('@qite/tide-client').CountryItem>>;
|
|
25
29
|
};
|
|
26
30
|
export default packageApi;
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
BookingPackage,
|
|
11
11
|
BookingPackageRoom,
|
|
12
12
|
BookingTravelAgent,
|
|
13
|
+
CountryItem,
|
|
13
14
|
PerBookingPackageOption
|
|
14
15
|
} from '@qite/tide-client/build/types';
|
|
15
16
|
import { BookingStep } from './constants';
|
|
@@ -46,6 +47,7 @@ export interface BookingState {
|
|
|
46
47
|
travelersFirstStep: boolean;
|
|
47
48
|
isFetching?: boolean;
|
|
48
49
|
hasMounted: boolean;
|
|
50
|
+
countries?: CountryItem[];
|
|
49
51
|
}
|
|
50
52
|
export declare const fetchPackage: import('@reduxjs/toolkit').AsyncThunk<
|
|
51
53
|
void,
|
|
@@ -61,6 +63,20 @@ export declare const fetchPackage: import('@reduxjs/toolkit').AsyncThunk<
|
|
|
61
63
|
rejectedMeta?: unknown;
|
|
62
64
|
}
|
|
63
65
|
>;
|
|
66
|
+
export declare const fetchCountries: import('@reduxjs/toolkit').AsyncThunk<
|
|
67
|
+
import('@qite/tide-client/build/types').PageResult<CountryItem>,
|
|
68
|
+
void,
|
|
69
|
+
{
|
|
70
|
+
state?: unknown;
|
|
71
|
+
dispatch?: import('@reduxjs/toolkit').ThunkDispatch<unknown, unknown, import('@reduxjs/toolkit').UnknownAction>;
|
|
72
|
+
extra?: unknown;
|
|
73
|
+
rejectValue?: unknown;
|
|
74
|
+
serializedErrorType?: unknown;
|
|
75
|
+
pendingMeta?: unknown;
|
|
76
|
+
fulfilledMeta?: unknown;
|
|
77
|
+
rejectedMeta?: unknown;
|
|
78
|
+
}
|
|
79
|
+
>;
|
|
64
80
|
export declare const setOfficeId: import('@reduxjs/toolkit').ActionCreatorWithPayload<number, 'booking/setOfficeId'>,
|
|
65
81
|
setLanguageCode: import('@reduxjs/toolkit').ActionCreatorWithPayload<string, 'booking/setLanguageCode'>,
|
|
66
82
|
setTranslations: import('@reduxjs/toolkit').ActionCreatorWithPayload<any, 'booking/setTranslations'>,
|
|
@@ -336,6 +336,7 @@ export declare const selectCalculateDeposit: (state: RootState) => boolean;
|
|
|
336
336
|
export declare const selectIsRetry: (state: RootState) => boolean;
|
|
337
337
|
export declare const selectStartDate: (state: RootState) => string | undefined;
|
|
338
338
|
export declare const selectAgents: (state: RootState) => import('@qite/tide-client').BookingTravelAgent[] | undefined;
|
|
339
|
+
export declare const selectCountries: (state: RootState) => import('@qite/tide-client').CountryItem[] | undefined;
|
|
339
340
|
export declare const selectProductCode: (state: RootState) => string | undefined;
|
|
340
341
|
export declare const selectAccommodationCodes: (state: RootState) => string[];
|
|
341
342
|
export declare const selectAccommodationViews: (state: RootState) =>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { MobileFilterType, Room, TravelerType, TypeaheadOption } from '../types';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
import { TravelType, TravelClass
|
|
3
|
+
import { TravelType, TravelClass } from '../../shared/types';
|
|
4
|
+
import { PortalQsmType } from '@qite/tide-client';
|
|
4
5
|
export interface QSMState {
|
|
5
6
|
qsmType?: PortalQsmType;
|
|
6
7
|
selectedOrigin?: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import { WebsiteConfigurationSearchConfiguration } from '@qite/tide-client';
|
|
2
|
+
import { TravelClass, TravelType } from '../shared/types';
|
|
3
|
+
import { WebsiteConfigurationSearchConfiguration, PortalQsmType } from '@qite/tide-client';
|
|
4
4
|
export interface QSMConfiguration {
|
|
5
5
|
type?: PortalQsmType;
|
|
6
6
|
searchConfigurations: WebsiteConfigurationSearchConfiguration[];
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { ExtendedFlightSearchResponseItem, Filter } from '../types';
|
|
2
|
-
import { BookingPackage, BookingPackageItem, EntryLight } from '@qite/tide-client/build/types';
|
|
2
|
+
import { BookingPackage, BookingPackageItem, EntryLight, PackagingAccommodationResponse } from '@qite/tide-client/build/types';
|
|
3
3
|
export interface SearchResultsState {
|
|
4
4
|
results: BookingPackageItem[];
|
|
5
5
|
filteredResults: BookingPackageItem[];
|
|
6
6
|
selectedSearchResultId: number | null;
|
|
7
|
+
packagingAccoResults: PackagingAccommodationResponse[];
|
|
8
|
+
filteredPackagingAccoResults: PackagingAccommodationResponse[];
|
|
9
|
+
selectedPackagingAccoResultCode: string | null;
|
|
7
10
|
selectedFlight: ExtendedFlightSearchResponseItem | null;
|
|
8
11
|
selectedFlightDetails: ExtendedFlightSearchResponseItem | null;
|
|
9
12
|
bookingPackageDetails: BookingPackage | null;
|
|
@@ -18,6 +21,12 @@ export interface SearchResultsState {
|
|
|
18
21
|
export declare const setResults: import('@reduxjs/toolkit').ActionCreatorWithPayload<BookingPackageItem[], 'searchResults/setResults'>,
|
|
19
22
|
setFilteredResults: import('@reduxjs/toolkit').ActionCreatorWithPayload<BookingPackageItem[], 'searchResults/setFilteredResults'>,
|
|
20
23
|
setSelectedSearchResult: import('@reduxjs/toolkit').ActionCreatorWithPayload<number | null, 'searchResults/setSelectedSearchResult'>,
|
|
24
|
+
setPackagingAccoResults: import('@reduxjs/toolkit').ActionCreatorWithPayload<PackagingAccommodationResponse[], 'searchResults/setPackagingAccoResults'>,
|
|
25
|
+
setFilteredPackagingAccoResults: import('@reduxjs/toolkit').ActionCreatorWithPayload<
|
|
26
|
+
PackagingAccommodationResponse[],
|
|
27
|
+
'searchResults/setFilteredPackagingAccoResults'
|
|
28
|
+
>,
|
|
29
|
+
setSelectedPackagingAccoResult: import('@reduxjs/toolkit').ActionCreatorWithPayload<string | null, 'searchResults/setSelectedPackagingAccoResult'>,
|
|
21
30
|
setSelectedFlight: import('@reduxjs/toolkit').ActionCreatorWithPayload<ExtendedFlightSearchResponseItem | null, 'searchResults/setSelectedFlight'>,
|
|
22
31
|
setSelectedFlightDetails: import('@reduxjs/toolkit').ActionCreatorWithPayload<
|
|
23
32
|
ExtendedFlightSearchResponseItem | null,
|
|
@@ -1,9 +1,8 @@
|
|
|
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
|
export type FlightSelectionMode = 'paired' | 'independent';
|
|
5
4
|
export interface SearchResultsConfiguration {
|
|
6
|
-
|
|
5
|
+
searchConfiguration: WebsiteConfigurationSearchConfiguration;
|
|
7
6
|
tideConnection: {
|
|
8
7
|
host: string;
|
|
9
8
|
apiKey: string;
|
|
@@ -61,7 +60,8 @@ export interface PaginationConfig {
|
|
|
61
60
|
}
|
|
62
61
|
export type SearchResult = HotelResult | FlightResult | RoundTripResult;
|
|
63
62
|
export interface BaseSearchResult {
|
|
64
|
-
id
|
|
63
|
+
id?: number;
|
|
64
|
+
code: string;
|
|
65
65
|
title: string;
|
|
66
66
|
image: string;
|
|
67
67
|
description?: string;
|
|
@@ -76,6 +76,7 @@ export interface BaseSearchResult {
|
|
|
76
76
|
export interface HotelResult extends BaseSearchResult {
|
|
77
77
|
type: 'hotel';
|
|
78
78
|
days: string;
|
|
79
|
+
contents?: string;
|
|
79
80
|
}
|
|
80
81
|
export interface RoundTripResult extends BaseSearchResult {
|
|
81
82
|
type: 'roundTrip';
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
-
import { BookingPackageItem } from '@qite/tide-client';
|
|
2
|
-
import { Filter } from '../types';
|
|
1
|
+
import { BookingPackageItem, PackagingAccommodationResponse } from '@qite/tide-client';
|
|
2
|
+
import { Filter, TideTag } from '../types';
|
|
3
|
+
export declare const enrichFiltersWithResults: (results: BookingPackageItem[], filters: Filter[] | undefined, tags: TideTag[]) => Filter[];
|
|
4
|
+
export declare const enrichFiltersWithPackageAccoResults: (
|
|
5
|
+
results: PackagingAccommodationResponse[],
|
|
6
|
+
filters: Filter[] | undefined,
|
|
7
|
+
tags: TideTag[]
|
|
8
|
+
) => Filter[];
|
|
3
9
|
export declare const applyFilters: (results: BookingPackageItem[], filters: Filter[]) => BookingPackageItem[];
|
|
10
|
+
export declare const applyFiltersToPackageAccoResults: (results: PackagingAccommodationResponse[], filters: Filter[]) => PackagingAccommodationResponse[];
|
|
@@ -1,17 +1,4 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
export declare enum PortalQsmType {
|
|
3
|
-
Multidestination = 0,
|
|
4
|
-
Accommodation = 1,
|
|
5
|
-
AccommodationAndFlight = 2,
|
|
6
|
-
Flight = 3,
|
|
7
|
-
RoundTrip = 4,
|
|
8
|
-
GroupTour = 5,
|
|
9
|
-
Package = 6,
|
|
10
|
-
Ticket = 7,
|
|
11
|
-
Car = 8,
|
|
12
|
-
Transfer = 9,
|
|
13
|
-
Cruise = 10
|
|
14
|
-
}
|
|
15
2
|
export interface ApiSettingsState {
|
|
16
3
|
apiUrl: string;
|
|
17
4
|
apiKey: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qite/tide-booking-component",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.81",
|
|
4
4
|
"description": "React Booking wizard & Booking product component for Tide",
|
|
5
5
|
"main": "build/build-cjs/index.js",
|
|
6
6
|
"types": "build/build-cjs/src/index.d.ts",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@jsonurl/jsonurl": "^1.1.4",
|
|
31
31
|
"@popperjs/core": "^2.10.2",
|
|
32
|
-
"@qite/tide-client": "^1.1.
|
|
32
|
+
"@qite/tide-client": "^1.1.148",
|
|
33
33
|
"@reduxjs/toolkit": "^2.8.2",
|
|
34
34
|
"@rollup/plugin-commonjs": "^19.0.1",
|
|
35
35
|
"@rollup/plugin-json": "^4.1.0",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { agents, details, generateBookingAccommodations } from '@qite/tide-client';
|
|
1
|
+
import { agents, details, generateBookingAccommodations, getCountries } from '@qite/tide-client';
|
|
2
2
|
import {
|
|
3
3
|
BookingPackage,
|
|
4
4
|
BookingPackageDetailsRequest,
|
|
@@ -30,9 +30,15 @@ const fetchAccommodationViews = async (request: GenerateBookingAccommodationRequ
|
|
|
30
30
|
return await generateBookingAccommodations(tideClientConfig, request, signal);
|
|
31
31
|
};
|
|
32
32
|
|
|
33
|
+
const fetchCountries = async (signal: AbortSignal, apiSettings?: ApiSettingsState) => {
|
|
34
|
+
const tideClientConfig = buildTideClientConfig(apiSettings);
|
|
35
|
+
return await getCountries(tideClientConfig, signal);
|
|
36
|
+
};
|
|
37
|
+
|
|
33
38
|
const packageApi = {
|
|
34
39
|
fetchDetails,
|
|
35
40
|
fetchAgents,
|
|
36
|
-
fetchAccommodationViews
|
|
41
|
+
fetchAccommodationViews,
|
|
42
|
+
fetchCountries
|
|
37
43
|
};
|
|
38
44
|
export default packageApi;
|
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
BookingPackageRequestRoom,
|
|
18
18
|
BookingPackageRoom,
|
|
19
19
|
BookingTravelAgent,
|
|
20
|
+
CountryItem,
|
|
20
21
|
GenerateBookingAccommodationRequest,
|
|
21
22
|
PerBookingPackageOption,
|
|
22
23
|
SelectedFlight
|
|
@@ -67,6 +68,7 @@ export interface BookingState {
|
|
|
67
68
|
travelersFirstStep: boolean;
|
|
68
69
|
isFetching?: boolean;
|
|
69
70
|
hasMounted: boolean;
|
|
71
|
+
countries?: CountryItem[];
|
|
70
72
|
}
|
|
71
73
|
|
|
72
74
|
const initialState: BookingState = {
|
|
@@ -105,17 +107,24 @@ const initialState: BookingState = {
|
|
|
105
107
|
translations: undefined,
|
|
106
108
|
travelersFirstStep: false,
|
|
107
109
|
isFetching: false,
|
|
108
|
-
hasMounted: false
|
|
110
|
+
hasMounted: false,
|
|
111
|
+
countries: undefined
|
|
109
112
|
};
|
|
110
113
|
|
|
111
114
|
export const fetchPackage = createAsyncThunk('booking/fetchPackage', async (_, { dispatch }) => {
|
|
112
115
|
dispatch(setFetchingPackage(true));
|
|
113
116
|
await dispatch(fetchAgents());
|
|
117
|
+
await dispatch(fetchCountries());
|
|
114
118
|
await dispatch(fetchPackageDetails());
|
|
115
119
|
await dispatch(fetchAccommodationViews());
|
|
116
120
|
dispatch(setFetchingPackage(false));
|
|
117
121
|
});
|
|
118
122
|
|
|
123
|
+
export const fetchCountries = createAsyncThunk('booking/countries', async (_, { dispatch, getState, signal }) => {
|
|
124
|
+
const settings = getState() as RootState;
|
|
125
|
+
return await packageApi.fetchCountries(signal, settings.apiSettings);
|
|
126
|
+
});
|
|
127
|
+
|
|
119
128
|
const fetchAgents = createAsyncThunk('booking/agents', async (_, { dispatch, getState, signal }) => {
|
|
120
129
|
const settings = getState() as RootState;
|
|
121
130
|
return await packageApi.fetchAgents(signal, settings.apiSettings);
|
|
@@ -570,6 +579,11 @@ const bookingSlice = createSlice({
|
|
|
570
579
|
state.accommodationViews = action.payload;
|
|
571
580
|
}
|
|
572
581
|
});
|
|
582
|
+
builder.addCase(fetchCountries.fulfilled, (state, action) => {
|
|
583
|
+
if (action.payload.items) {
|
|
584
|
+
state.countries = action.payload.items;
|
|
585
|
+
}
|
|
586
|
+
});
|
|
573
587
|
}
|
|
574
588
|
});
|
|
575
589
|
|
|
@@ -157,6 +157,8 @@ export const selectStartDate = (state: RootState) => state.booking.package?.opti
|
|
|
157
157
|
|
|
158
158
|
export const selectAgents = (state: RootState) => state.booking.agents;
|
|
159
159
|
|
|
160
|
+
export const selectCountries = (state: RootState) => state.booking.countries;
|
|
161
|
+
|
|
160
162
|
export const selectProductCode = (state: RootState) => state.booking.productAttributes?.productCode;
|
|
161
163
|
|
|
162
164
|
export const selectAccommodationCodes = (state: RootState) => {
|
|
@@ -2,7 +2,14 @@ import { compact, get, sortBy } from 'lodash';
|
|
|
2
2
|
import React, { useContext, useEffect, useState } from 'react';
|
|
3
3
|
import { useSelector } from 'react-redux';
|
|
4
4
|
import { fetchPackage, setCurrentStep, setHasMounted, setIsFetching } from '../booking/booking-slice';
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
selectBookingAttributes,
|
|
7
|
+
selectCountries,
|
|
8
|
+
selectHasMounted,
|
|
9
|
+
selectIsFetching,
|
|
10
|
+
selectIsUnavailable,
|
|
11
|
+
selectTravelersFirstStep
|
|
12
|
+
} from '../booking/selectors';
|
|
6
13
|
import { selectFormRooms, selectTravelersFormValues, setFormValues } from './travelers-form-slice';
|
|
7
14
|
|
|
8
15
|
import { Link, useNavigate } from 'react-router-dom';
|
|
@@ -100,8 +107,10 @@ const TravelersForm: React.FC<TravelersFormProps> = () => {
|
|
|
100
107
|
const bookingAttributes = useSelector(selectBookingAttributes);
|
|
101
108
|
const isFetching = useSelector(selectIsFetching);
|
|
102
109
|
const hasMounted = useSelector(selectHasMounted);
|
|
110
|
+
const countries = useSelector(selectCountries);
|
|
103
111
|
|
|
104
112
|
const useCompactForm = !!settings.travellers.compactForm && !!settings.agentAdressId;
|
|
113
|
+
const showAllCountries = !!settings.travellers.showAllCountries;
|
|
105
114
|
|
|
106
115
|
const initialValues =
|
|
107
116
|
useSelector(selectTravelersFormValues) ?? createInitialValues(formRooms, startDate, agentAdressId, translations.TRAVELERS_FORM.PERSON, useCompactForm);
|
|
@@ -397,11 +406,17 @@ const TravelersForm: React.FC<TravelersFormProps> = () => {
|
|
|
397
406
|
value: undefined,
|
|
398
407
|
label: translations.TRAVELERS_FORM.SELECT_COUNTRY
|
|
399
408
|
},
|
|
400
|
-
...(
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
409
|
+
...(showAllCountries
|
|
410
|
+
? countries?.map((country) => ({
|
|
411
|
+
key: country.iso2,
|
|
412
|
+
value: country.iso2,
|
|
413
|
+
label: country.name
|
|
414
|
+
})) ?? []
|
|
415
|
+
: settings.travellers?.countries?.map((country) => ({
|
|
416
|
+
key: country.iso2,
|
|
417
|
+
value: country.iso2,
|
|
418
|
+
label: country.name
|
|
419
|
+
})) ?? [])
|
|
405
420
|
]}
|
|
406
421
|
/>
|
|
407
422
|
);
|
|
@@ -917,24 +932,32 @@ const TravelersForm: React.FC<TravelersFormProps> = () => {
|
|
|
917
932
|
options={[
|
|
918
933
|
{
|
|
919
934
|
key: 'empty',
|
|
920
|
-
|
|
921
|
-
|
|
935
|
+
value: undefined,
|
|
936
|
+
label: translations.TRAVELERS_FORM.SELECT_COUNTRY
|
|
922
937
|
},
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
+
...(showAllCountries
|
|
939
|
+
? countries?.map((country) => ({
|
|
940
|
+
key: country.iso2,
|
|
941
|
+
value: country.iso2,
|
|
942
|
+
label: country.name
|
|
943
|
+
})) ?? []
|
|
944
|
+
: [
|
|
945
|
+
{
|
|
946
|
+
key: 'be',
|
|
947
|
+
value: 'be',
|
|
948
|
+
label: translations.TRAVELERS_FORM.COUNTRIES.BELGIUM
|
|
949
|
+
},
|
|
950
|
+
{
|
|
951
|
+
key: 'nl',
|
|
952
|
+
value: 'nl',
|
|
953
|
+
label: translations.TRAVELERS_FORM.COUNTRIES.NETHERLANDS
|
|
954
|
+
},
|
|
955
|
+
{
|
|
956
|
+
key: 'fr',
|
|
957
|
+
value: 'fr',
|
|
958
|
+
label: translations.TRAVELERS_FORM.COUNTRIES.FRANCE
|
|
959
|
+
}
|
|
960
|
+
])
|
|
938
961
|
]}
|
|
939
962
|
/>
|
|
940
963
|
</div>
|
|
@@ -27,7 +27,8 @@ const SettingsContext = React.createContext<WizardSettingsContextProps>({
|
|
|
27
27
|
},
|
|
28
28
|
travellers: {
|
|
29
29
|
pathSuffix: '/reizigers',
|
|
30
|
-
travelersFirstStep: false
|
|
30
|
+
travelersFirstStep: false,
|
|
31
|
+
showAllCountries: false
|
|
31
32
|
},
|
|
32
33
|
summary: {
|
|
33
34
|
pathSuffix: '/samenvatting',
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Navbar
|
|
2
|
+
import { Navbar } from '../../../../src';
|
|
3
3
|
import { TideLogo, language, languages, topLinks, navItems } from '../../../../src/content/navbar/placeholderData';
|
|
4
4
|
import Icon from '../../components/icon';
|
|
5
5
|
import ContactForm from '../../components/contact';
|
|
6
6
|
import Slider from '../../components/slider';
|
|
7
7
|
import { Nationality, QSMConfiguration, TypeaheadOption } from '../../../qsm/types';
|
|
8
8
|
import QSM from '../../../qsm';
|
|
9
|
-
import { WebsiteConfigurationSearchConfiguration } from '@qite/tide-client';
|
|
9
|
+
import { PortalQsmType, WebsiteConfigurationSearchConfiguration } from '@qite/tide-client';
|
|
10
10
|
|
|
11
11
|
interface ContentPageSelfContainedProps {
|
|
12
12
|
path: string;
|
|
@@ -60,7 +60,7 @@ const searchConfigurations: WebsiteConfigurationSearchConfiguration[] = [
|
|
|
60
60
|
icon: '',
|
|
61
61
|
defaultSearchType: 1,
|
|
62
62
|
serviceTypes: [0],
|
|
63
|
-
defaultCatalogueId:
|
|
63
|
+
defaultCatalogueId: 1,
|
|
64
64
|
defaultDuration: undefined,
|
|
65
65
|
fromDateAmount: 0,
|
|
66
66
|
fromDateAmountType: 0,
|
|
@@ -80,7 +80,7 @@ const searchConfigurations: WebsiteConfigurationSearchConfiguration[] = [
|
|
|
80
80
|
icon: '',
|
|
81
81
|
defaultSearchType: 0,
|
|
82
82
|
serviceTypes: [3],
|
|
83
|
-
defaultCatalogueId:
|
|
83
|
+
defaultCatalogueId: 1,
|
|
84
84
|
defaultDuration: undefined,
|
|
85
85
|
fromDateAmount: 1,
|
|
86
86
|
fromDateAmountType: 1,
|
|
@@ -100,7 +100,7 @@ const searchConfigurations: WebsiteConfigurationSearchConfiguration[] = [
|
|
|
100
100
|
icon: '',
|
|
101
101
|
defaultSearchType: 3,
|
|
102
102
|
serviceTypes: [7],
|
|
103
|
-
defaultCatalogueId:
|
|
103
|
+
defaultCatalogueId: 1,
|
|
104
104
|
defaultDuration: undefined,
|
|
105
105
|
fromDateAmount: 1,
|
|
106
106
|
fromDateAmountType: 1,
|
|
@@ -120,7 +120,7 @@ const searchConfigurations: WebsiteConfigurationSearchConfiguration[] = [
|
|
|
120
120
|
icon: '',
|
|
121
121
|
defaultSearchType: 0,
|
|
122
122
|
serviceTypes: [0],
|
|
123
|
-
defaultCatalogueId:
|
|
123
|
+
defaultCatalogueId: 1,
|
|
124
124
|
defaultDuration: undefined,
|
|
125
125
|
fromDateAmount: 1,
|
|
126
126
|
fromDateAmountType: 1,
|
|
@@ -17,8 +17,8 @@ import { DateRange } from '../../../booking-product/types';
|
|
|
17
17
|
import { QSMState, setFromDate, setSelectedQsmType, setToDate, setTripType } from '../../store/qsm-slice';
|
|
18
18
|
import { BaseFieldConfig, DoubleFieldConfig } from '../../types';
|
|
19
19
|
import { getTranslations } from '../../../shared/utils/localization-util';
|
|
20
|
-
import { PortalQsmType } from '
|
|
21
|
-
import {
|
|
20
|
+
import { DateAmountType, PortalQsmType } from '@qite/tide-client';
|
|
21
|
+
import { first } from 'lodash';
|
|
22
22
|
|
|
23
23
|
const QSMContainer: React.FC = () => {
|
|
24
24
|
const dispatch = useDispatch();
|
|
@@ -46,6 +46,14 @@ const QSMContainer: React.FC = () => {
|
|
|
46
46
|
} = useContext(QSMConfigurationContext);
|
|
47
47
|
const translations = getTranslations(languageCode ?? 'en-GB');
|
|
48
48
|
|
|
49
|
+
useEffect(() => {
|
|
50
|
+
const defaultQsmType = first(searchConfigurations)?.qsmType;
|
|
51
|
+
console.log('Available search configurations:', searchConfigurations);
|
|
52
|
+
if (!defaultQsmType) return;
|
|
53
|
+
console.log('set default qsmType:', defaultQsmType);
|
|
54
|
+
handleQsmTypeChange(defaultQsmType);
|
|
55
|
+
}, [searchConfigurations]);
|
|
56
|
+
|
|
49
57
|
useEffect(() => {
|
|
50
58
|
if (fromDate || toDate) return;
|
|
51
59
|
|
|
@@ -7,7 +7,7 @@ import { getTranslations } from '../../../shared/utils/localization-util';
|
|
|
7
7
|
import TravelClassPicker from '../travel-class-picker';
|
|
8
8
|
import TravelTypePicker from '../travel-type-picker';
|
|
9
9
|
import Icon from '../icon';
|
|
10
|
-
import { PortalQsmType } from '
|
|
10
|
+
import { PortalQsmType } from '@qite/tide-client';
|
|
11
11
|
|
|
12
12
|
const TravelInput: React.FC = () => {
|
|
13
13
|
const dispatch = useDispatch();
|
|
@@ -7,7 +7,7 @@ import { QSMRootState } from '../../store/qsm-store';
|
|
|
7
7
|
import QSMConfigurationContext from '../../qsm-configuration-context';
|
|
8
8
|
import Icon from '../icon';
|
|
9
9
|
import { getTranslations } from '../../../shared/utils/localization-util';
|
|
10
|
-
import { PortalQsmType } from '
|
|
10
|
+
import { PortalQsmType } from '@qite/tide-client';
|
|
11
11
|
|
|
12
12
|
const selectTravelerSummary = (state: QSMRootState, areTravelersInRooms: boolean | undefined) => {
|
|
13
13
|
const { adults, kids, babies, rooms, selectedTravelType } = state.qsm;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { QSMConfiguration } from './types';
|
|
3
|
-
import { PortalQsmType } from '
|
|
3
|
+
import { PortalQsmType } from '@qite/tide-client';
|
|
4
4
|
|
|
5
5
|
const QSMConfigurationContext = React.createContext<QSMConfiguration>({
|
|
6
6
|
type: PortalQsmType.Accommodation,
|
|
@@ -2,7 +2,8 @@ import { createSlice, PayloadAction } from '@reduxjs/toolkit';
|
|
|
2
2
|
|
|
3
3
|
import { MobileFilterType, Room, TravelerType, TypeaheadOption } from '../types';
|
|
4
4
|
import { ReactNode } from 'react';
|
|
5
|
-
import { TravelType, TravelClass
|
|
5
|
+
import { TravelType, TravelClass } from '../../shared/types';
|
|
6
|
+
import { PortalQsmType } from '@qite/tide-client';
|
|
6
7
|
|
|
7
8
|
export interface QSMState {
|
|
8
9
|
qsmType?: PortalQsmType;
|
package/src/qsm/types.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import { WebsiteConfigurationSearchConfiguration } from '@qite/tide-client';
|
|
2
|
+
import { TravelClass, TravelType } from '../shared/types';
|
|
3
|
+
import { WebsiteConfigurationSearchConfiguration, PortalQsmType } from '@qite/tide-client';
|
|
4
4
|
|
|
5
5
|
export interface QSMConfiguration {
|
|
6
6
|
type?: PortalQsmType;
|