@qite/tide-booking-component 1.2.4 → 1.3.0
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/booking-wizard/components/print-offer-button.d.ts +17 -0
- package/build/build-cjs/booking-wizard/features/flight-options/flight-option-flight.d.ts +1 -1
- package/build/build-cjs/booking-wizard/features/flight-options/flight-option.d.ts +1 -1
- package/build/build-cjs/booking-wizard/types.d.ts +13 -0
- package/build/build-cjs/booking-wizard/use-offer-printer.d.ts +13 -0
- package/build/build-cjs/index.js +1392 -754
- package/build/build-cjs/shared/utils/localization-util.d.ts +6 -0
- package/build/build-cjs/shared/utils/tide-api-utils.d.ts +1 -0
- package/build/build-esm/booking-wizard/components/print-offer-button.d.ts +17 -0
- package/build/build-esm/booking-wizard/features/flight-options/flight-option-flight.d.ts +1 -1
- package/build/build-esm/booking-wizard/features/flight-options/flight-option.d.ts +1 -1
- package/build/build-esm/booking-wizard/types.d.ts +13 -0
- package/build/build-esm/booking-wizard/use-offer-printer.d.ts +13 -0
- package/build/build-esm/index.js +1394 -756
- package/build/build-esm/shared/utils/localization-util.d.ts +6 -0
- package/build/build-esm/shared/utils/tide-api-utils.d.ts +1 -0
- package/package.json +4 -6
- package/src/booking-product/components/age-select.tsx +2 -8
- package/src/booking-product/components/amount-input.tsx +36 -22
- package/src/booking-product/components/date-range-picker/calendar-day.tsx +5 -1
- package/src/booking-product/components/date-range-picker/calendar.tsx +9 -7
- package/src/booking-product/components/date-range-picker/index.tsx +20 -5
- package/src/booking-product/components/dates.tsx +22 -18
- package/src/booking-product/components/footer.tsx +40 -41
- package/src/booking-product/components/header.tsx +44 -33
- package/src/booking-product/components/icon.tsx +188 -145
- package/src/booking-product/components/product.tsx +66 -33
- package/src/booking-product/components/rooms.tsx +70 -55
- package/src/booking-product/index.tsx +9 -9
- package/src/booking-product/settings-context.ts +3 -3
- package/src/booking-product/types.ts +3 -3
- package/src/booking-product/utils/api.ts +4 -4
- package/src/booking-product/utils/price.ts +5 -3
- package/src/booking-wizard/components/icon.tsx +428 -229
- package/src/booking-wizard/components/multi-range-filter.tsx +15 -15
- package/src/booking-wizard/components/print-offer-button.tsx +66 -0
- package/src/booking-wizard/components/step-indicator.tsx +1 -1
- package/src/booking-wizard/declarations.d.ts +2 -2
- package/src/booking-wizard/features/booking/api.ts +9 -5
- package/src/booking-wizard/features/booking/booking-self-contained.tsx +46 -19
- package/src/booking-wizard/features/booking/booking-slice.ts +108 -49
- package/src/booking-wizard/features/booking/booking.tsx +64 -57
- package/src/booking-wizard/features/booking/selectors.ts +45 -22
- package/src/booking-wizard/features/confirmation/confirmation.tsx +8 -5
- package/src/booking-wizard/features/error/error.tsx +6 -3
- package/src/booking-wizard/features/flight-options/flight-filter.tsx +147 -72
- package/src/booking-wizard/features/flight-options/flight-option-flight.tsx +53 -21
- package/src/booking-wizard/features/flight-options/flight-option-modal.tsx +34 -19
- package/src/booking-wizard/features/flight-options/flight-option.tsx +37 -22
- package/src/booking-wizard/features/flight-options/flight-utils.ts +220 -105
- package/src/booking-wizard/features/flight-options/index.tsx +62 -43
- package/src/booking-wizard/features/price-details/price-details-slice.ts +11 -4
- package/src/booking-wizard/features/product-options/no-options.tsx +1 -1
- package/src/booking-wizard/features/product-options/option-booking-airline-group.tsx +48 -50
- package/src/booking-wizard/features/product-options/option-booking-group.tsx +9 -3
- package/src/booking-wizard/features/product-options/option-item.tsx +1 -2
- package/src/booking-wizard/features/product-options/option-pax-card.tsx +39 -26
- package/src/booking-wizard/features/product-options/option-pax-group.tsx +9 -3
- package/src/booking-wizard/features/product-options/option-room.tsx +23 -16
- package/src/booking-wizard/features/product-options/option-unit-group.tsx +9 -3
- package/src/booking-wizard/features/product-options/option-units-card.tsx +68 -57
- package/src/booking-wizard/features/product-options/options-form.tsx +250 -124
- package/src/booking-wizard/features/room-options/index.tsx +27 -12
- package/src/booking-wizard/features/room-options/room-utils.ts +97 -50
- package/src/booking-wizard/features/room-options/room.tsx +56 -20
- package/src/booking-wizard/features/room-options/traveler-rooms.tsx +34 -22
- package/src/booking-wizard/features/sidebar/sidebar-flight.tsx +1 -1
- package/src/booking-wizard/features/sidebar/sidebar-util.ts +1 -1
- package/src/booking-wizard/features/sidebar/sidebar.tsx +173 -155
- package/src/booking-wizard/features/summary/summary-flight.tsx +1 -1
- package/src/booking-wizard/features/summary/summary-per-booking-option-group.tsx +45 -33
- package/src/booking-wizard/features/summary/summary-per-pax-option-group.tsx +41 -29
- package/src/booking-wizard/features/summary/summary-per-unit-option-group.tsx +43 -31
- package/src/booking-wizard/features/summary/summary.tsx +325 -294
- package/src/booking-wizard/features/travelers-form/travelers-form.tsx +421 -422
- package/src/booking-wizard/features/travelers-form/type-ahead-input.tsx +1 -1
- package/src/booking-wizard/features/travelers-form/validate-form.ts +1 -1
- package/src/booking-wizard/settings-context.ts +7 -0
- package/src/booking-wizard/types.ts +19 -7
- package/src/booking-wizard/use-offer-printer.ts +136 -0
- package/src/index.ts +0 -1
- package/src/shared/translations/en-GB.json +237 -0
- package/src/shared/translations/fr-BE.json +7 -2
- package/src/shared/translations/nl-BE.json +5 -0
- package/src/shared/types.ts +1 -1
- package/src/shared/utils/localization-util.ts +9 -3
- package/src/shared/utils/query-string-util.ts +6 -3
- package/src/shared/utils/tide-api-utils.ts +1 -1
- package/styles/booking-product-variables.scss +174 -68
- package/styles/booking-product.scss +294 -288
- package/styles/booking-wizard-variables.scss +872 -529
- package/styles/booking-wizard.scss +35 -2
- package/styles/components/_base.scss +3 -2
- package/styles/components/_booking.scss +149 -679
- package/styles/components/_button.scss +55 -2
- package/styles/components/_checkbox.scss +7 -3
- package/styles/components/_cta.scss +86 -11
- package/styles/components/_date-list.scss +41 -0
- package/styles/components/_date-range-picker.scss +3 -3
- package/styles/components/_decrement-increment.scss +1 -3
- package/styles/components/_dropdown.scss +2 -4
- package/styles/components/_flight-option.scss +454 -414
- package/styles/components/_form.scss +1266 -77
- package/styles/components/_info-message.scss +71 -0
- package/styles/components/_input.scss +25 -0
- package/styles/components/_list.scss +111 -6
- package/styles/components/_loader.scss +4 -3
- package/styles/components/_mixins.scss +30 -10
- package/styles/components/_placeholders.scss +11 -11
- package/styles/components/_pricing-summary.scss +40 -2
- package/styles/components/_qsm.scss +1 -4
- package/styles/components/_radiobutton.scss +170 -0
- package/styles/components/_select-wrapper.scss +18 -4
- package/styles/components/_spinner.scss +29 -0
- package/styles/components/_step-indicators.scss +14 -6
- package/styles/components/_table.scss +9 -9
- package/styles/components/_tree.scss +31 -41
- package/styles/components/_typeahead.scss +281 -0
- package/styles/components/_variables.scss +15 -15
|
@@ -38,7 +38,7 @@ const TypeAheadInput: React.FC<TypeAheadInputProps> = ({
|
|
|
38
38
|
return (
|
|
39
39
|
<div className="typeahead">
|
|
40
40
|
<div className="typeahead__trigger typeahead__trigger--icon">
|
|
41
|
-
<Icon name="qsm-location" />
|
|
41
|
+
<Icon name="ui-qsm-location" />
|
|
42
42
|
<input
|
|
43
43
|
type="text"
|
|
44
44
|
className="form__input"
|
|
@@ -5,6 +5,7 @@ interface WizardSettingsContextProps extends Settings {}
|
|
|
5
5
|
|
|
6
6
|
const SettingsContext = React.createContext<WizardSettingsContextProps>({
|
|
7
7
|
language: "nl-BE",
|
|
8
|
+
token: "",
|
|
8
9
|
generatePaymentUrl: false,
|
|
9
10
|
currency: "EUR",
|
|
10
11
|
officeId: 1,
|
|
@@ -16,22 +17,28 @@ const SettingsContext = React.createContext<WizardSettingsContextProps>({
|
|
|
16
17
|
basePath: "/boeken",
|
|
17
18
|
roomOptions: {
|
|
18
19
|
pathSuffix: "/",
|
|
20
|
+
reportPrintActionId: null,
|
|
19
21
|
},
|
|
20
22
|
flightOptions: {
|
|
21
23
|
pathSuffix: "/vluchten",
|
|
24
|
+
reportPrintActionId: null,
|
|
22
25
|
},
|
|
23
26
|
options: {
|
|
24
27
|
pathSuffix: "/opties",
|
|
28
|
+
reportPrintActionId: null,
|
|
25
29
|
},
|
|
26
30
|
travellers: {
|
|
27
31
|
pathSuffix: "/reizigers",
|
|
32
|
+
reportPrintActionId: null,
|
|
28
33
|
},
|
|
29
34
|
summary: {
|
|
30
35
|
pathSuffix: "/samenvatting",
|
|
31
36
|
checkboxes: null,
|
|
37
|
+
reportPrintActionId: null,
|
|
32
38
|
},
|
|
33
39
|
confirmation: {
|
|
34
40
|
pathSuffix: "/bevestiging",
|
|
41
|
+
reportPrintActionId: null,
|
|
35
42
|
},
|
|
36
43
|
error: {
|
|
37
44
|
pathSuffix: "/mislukt",
|
|
@@ -2,29 +2,36 @@ import { BookingPackageFlight } from "@qite/tide-client/build/types";
|
|
|
2
2
|
|
|
3
3
|
export interface Settings {
|
|
4
4
|
officeId: number;
|
|
5
|
+
token?: string ;
|
|
5
6
|
bookingOptions: BookingOptions;
|
|
6
7
|
productPath: string;
|
|
7
8
|
basePath: string;
|
|
8
9
|
roomOptions: {
|
|
9
10
|
isHidden?: boolean | null;
|
|
10
11
|
pathSuffix?: string | null;
|
|
11
|
-
|
|
12
|
+
reportPrintActionId?: number | null;
|
|
13
|
+
};
|
|
12
14
|
flightOptions: {
|
|
13
15
|
isHidden?: boolean | null;
|
|
14
16
|
pathSuffix?: string | null;
|
|
15
|
-
|
|
17
|
+
reportPrintActionId?: number | null;
|
|
18
|
+
};
|
|
16
19
|
options: {
|
|
17
20
|
pathSuffix: string;
|
|
21
|
+
reportPrintActionId?: number | null;
|
|
18
22
|
};
|
|
19
23
|
travellers: {
|
|
20
24
|
pathSuffix: string;
|
|
25
|
+
reportPrintActionId?: number | null;
|
|
21
26
|
};
|
|
22
27
|
summary: {
|
|
23
28
|
pathSuffix: string;
|
|
24
29
|
checkboxes?: SummaryCheckbox[] | null;
|
|
30
|
+
reportPrintActionId?: number | null;
|
|
25
31
|
};
|
|
26
32
|
confirmation: {
|
|
27
33
|
pathSuffix: string;
|
|
34
|
+
reportPrintActionId?: number | null;
|
|
28
35
|
};
|
|
29
36
|
error: {
|
|
30
37
|
pathSuffix: string;
|
|
@@ -53,7 +60,7 @@ export interface Settings {
|
|
|
53
60
|
apiKey?: string;
|
|
54
61
|
hideTags?: boolean;
|
|
55
62
|
translationFiles?: {
|
|
56
|
-
language: string
|
|
63
|
+
language: string;
|
|
57
64
|
path: string;
|
|
58
65
|
}[];
|
|
59
66
|
accommodations?: AccommodationContent[];
|
|
@@ -100,9 +107,13 @@ export interface FlightInfo {
|
|
|
100
107
|
outwardCode: string;
|
|
101
108
|
outwardNumbers: string[];
|
|
102
109
|
outwardClass: string;
|
|
110
|
+
outwardDepartureDate: string | null;
|
|
111
|
+
outwardArrivalDate: string | null;
|
|
103
112
|
returnCode: string;
|
|
104
113
|
returnNumbers: string[];
|
|
105
114
|
returnClass: string;
|
|
115
|
+
returnDepartureDate: string | null;
|
|
116
|
+
returnArrivalDate: string | null;
|
|
106
117
|
}
|
|
107
118
|
|
|
108
119
|
export interface TravelersFormValues {
|
|
@@ -142,6 +153,7 @@ export interface BookingAttributes {
|
|
|
142
153
|
allotmentName: string | null;
|
|
143
154
|
allotmentIds: number[];
|
|
144
155
|
includeFlights?: boolean;
|
|
156
|
+
flightRouteId?: string | null;
|
|
145
157
|
}
|
|
146
158
|
|
|
147
159
|
export interface FlightLine {
|
|
@@ -174,7 +186,7 @@ export interface RegimeContent {
|
|
|
174
186
|
|
|
175
187
|
export interface SelectableRoom {
|
|
176
188
|
index: number;
|
|
177
|
-
selected: SelectableRoomAccommodation
|
|
189
|
+
selected: SelectableRoomAccommodation;
|
|
178
190
|
alternatives: SelectableRoomAccommodation[];
|
|
179
191
|
}
|
|
180
192
|
|
|
@@ -189,7 +201,7 @@ export interface SelectableRoomAccommodation {
|
|
|
189
201
|
image: string | undefined;
|
|
190
202
|
usps: string[];
|
|
191
203
|
description: string | undefined;
|
|
192
|
-
viewHtml: string | undefined
|
|
204
|
+
viewHtml: string | undefined;
|
|
193
205
|
}
|
|
194
206
|
|
|
195
207
|
export interface SelectableRoomRegime {
|
|
@@ -265,7 +277,7 @@ export interface FlightDirectionFilter {
|
|
|
265
277
|
export interface TimeRangeFilter {
|
|
266
278
|
min: number;
|
|
267
279
|
max: number;
|
|
268
|
-
|
|
280
|
+
|
|
269
281
|
selectedMin: number;
|
|
270
282
|
selectedMax: number;
|
|
271
|
-
}
|
|
283
|
+
}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { useCallback, useContext, useState } from "react";
|
|
2
|
+
import SettingsContext from "./settings-context";
|
|
3
|
+
import { buildTideClientConfig } from "../shared/utils/tide-api-utils";
|
|
4
|
+
import { book, print } from "@qite/tide-client";
|
|
5
|
+
|
|
6
|
+
import type {
|
|
7
|
+
BookingPackage,
|
|
8
|
+
BookingPackageBookRequest,
|
|
9
|
+
BookingPackageDossier,
|
|
10
|
+
BookingPackageRequest,
|
|
11
|
+
AgentPrintActionRequest,
|
|
12
|
+
Pax,
|
|
13
|
+
BookingPackagePax,
|
|
14
|
+
} from "@qite/tide-client/build/types";
|
|
15
|
+
|
|
16
|
+
export interface UseOfferPrinterArgs {
|
|
17
|
+
bookingPackage?: BookingPackage;
|
|
18
|
+
getPax: () => Pax[] | undefined;
|
|
19
|
+
tagIds?: number[];
|
|
20
|
+
printActionId?: number | null;
|
|
21
|
+
onPrinted?: (pdfUrl: string) => void;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function useOfferPrinter({
|
|
25
|
+
bookingPackage,
|
|
26
|
+
getPax,
|
|
27
|
+
tagIds = [],
|
|
28
|
+
printActionId = null,
|
|
29
|
+
onPrinted,
|
|
30
|
+
}: UseOfferPrinterArgs) {
|
|
31
|
+
const settings = useContext(SettingsContext);
|
|
32
|
+
if (!settings)
|
|
33
|
+
throw new Error(
|
|
34
|
+
"useOfferPrinter must be used inside <BookingWizard>"
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
const { language, officeId } = settings;
|
|
38
|
+
const agentId = (settings as any).agentAdressId;
|
|
39
|
+
|
|
40
|
+
if (typeof agentId !== "number" || agentId <= 0) {
|
|
41
|
+
throw new Error(
|
|
42
|
+
"Missing agentAdressId in wizard settings"
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const [stage, setStage] = useState<
|
|
47
|
+
"idle" | "creating" | "printing"
|
|
48
|
+
>("idle");
|
|
49
|
+
const loading = stage !== "idle";
|
|
50
|
+
|
|
51
|
+
const createOffer =
|
|
52
|
+
useCallback(async (): Promise<BookingPackageDossier> => {
|
|
53
|
+
const paxRaw = getPax();
|
|
54
|
+
if (!bookingPackage || !paxRaw?.length) {
|
|
55
|
+
throw new Error("Missing booking package or pax");
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const pax = paxRaw as unknown as BookingPackagePax[];
|
|
59
|
+
|
|
60
|
+
const request: BookingPackageRequest<BookingPackageBookRequest> =
|
|
61
|
+
{
|
|
62
|
+
officeId,
|
|
63
|
+
agentId,
|
|
64
|
+
payload: {
|
|
65
|
+
package: bookingPackage,
|
|
66
|
+
status: 0,
|
|
67
|
+
pax,
|
|
68
|
+
nonTravelPax: [],
|
|
69
|
+
notifications: [],
|
|
70
|
+
tagIds,
|
|
71
|
+
customerRequests: [],
|
|
72
|
+
},
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
const cfg = buildTideClientConfig();
|
|
76
|
+
return book(cfg, request, undefined, language);
|
|
77
|
+
}, [
|
|
78
|
+
agentId,
|
|
79
|
+
bookingPackage,
|
|
80
|
+
getPax,
|
|
81
|
+
language,
|
|
82
|
+
officeId,
|
|
83
|
+
tagIds,
|
|
84
|
+
]);
|
|
85
|
+
|
|
86
|
+
const languageData = [
|
|
87
|
+
{ code: "nl-BE", tideId: 1 },
|
|
88
|
+
{ code: "fr-BE", tideId: 2 },
|
|
89
|
+
{ code: "en-GB", tideId: 3 },
|
|
90
|
+
];
|
|
91
|
+
|
|
92
|
+
function getTideLanguageId(code: string) {
|
|
93
|
+
return (
|
|
94
|
+
languageData.find((l) => l.code === code)?.tideId || 1
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
const printOffer = useCallback(
|
|
99
|
+
async (offer: BookingPackageDossier) => {
|
|
100
|
+
const cfg = buildTideClientConfig();
|
|
101
|
+
|
|
102
|
+
const req: AgentPrintActionRequest = {
|
|
103
|
+
id: printActionId ?? 0,
|
|
104
|
+
dossierNumber:
|
|
105
|
+
(offer as any).dossierNumber ??
|
|
106
|
+
(offer as any).number,
|
|
107
|
+
languageId: getTideLanguageId(language),
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
const res = await print(cfg, req);
|
|
111
|
+
const buf = await res.arrayBuffer();
|
|
112
|
+
const url = URL.createObjectURL(
|
|
113
|
+
new Blob([buf], { type: "application/pdf" })
|
|
114
|
+
);
|
|
115
|
+
onPrinted?.(url);
|
|
116
|
+
window.open(url);
|
|
117
|
+
},
|
|
118
|
+
[language, onPrinted]
|
|
119
|
+
);
|
|
120
|
+
|
|
121
|
+
const handlePrint = useCallback(async () => {
|
|
122
|
+
try {
|
|
123
|
+
setStage("creating");
|
|
124
|
+
const offer = await createOffer();
|
|
125
|
+
setStage("printing");
|
|
126
|
+
await printOffer(offer);
|
|
127
|
+
} catch (err) {
|
|
128
|
+
console.error("Offer print failed:", err);
|
|
129
|
+
throw err;
|
|
130
|
+
} finally {
|
|
131
|
+
setStage("idle");
|
|
132
|
+
}
|
|
133
|
+
}, [createOffer, printOffer]);
|
|
134
|
+
|
|
135
|
+
return { handlePrint, loading, stage };
|
|
136
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
{
|
|
2
|
+
"STEPS": {
|
|
3
|
+
"PERSONAL_DETAILS": "Personal details",
|
|
4
|
+
"EXTRA_OPTIONS": "Extra options",
|
|
5
|
+
"SUMMARY": "Summary",
|
|
6
|
+
"CONFIRMATION": "Confirmation",
|
|
7
|
+
"ERROR": "Booking failed",
|
|
8
|
+
"PREVIOUS": "Previous step",
|
|
9
|
+
"NEXT": "Next step",
|
|
10
|
+
"SUBMIT_BOOKING": "Confirm booking",
|
|
11
|
+
"SUBMIT_OFFER": "Request quote",
|
|
12
|
+
"COMPOSE": "Compose",
|
|
13
|
+
"ROOM_OPTIONS": "Room options",
|
|
14
|
+
"FLIGHT_OPTIONS": "Flight options"
|
|
15
|
+
},
|
|
16
|
+
"INPUT": {
|
|
17
|
+
"INCREASE": "Increase",
|
|
18
|
+
"DECREASE": "Decrease"
|
|
19
|
+
},
|
|
20
|
+
"FLIGHTS_FORM": {
|
|
21
|
+
"OUTWARD_FLIGHTS": "Outbound flights",
|
|
22
|
+
"OUTWARD_FLIGHT": "Outbound flight",
|
|
23
|
+
"RETURN_FLIGHTS": "Return flights",
|
|
24
|
+
"RETURN_FLIGHT": "Return flight",
|
|
25
|
+
"DIRECT_FLIGHT": "Direct flight",
|
|
26
|
+
"STOP": "stop",
|
|
27
|
+
"STOPS": "stops",
|
|
28
|
+
"FLIGHT_STOPS": "stop(s)",
|
|
29
|
+
"DIFFERENT_OPTION_WARNING": "Warning: This flight changes the duration of the stay.",
|
|
30
|
+
"FILTER_OPTIONS": "Filter options",
|
|
31
|
+
"AIRLINES": "Airlines",
|
|
32
|
+
"AIRPORTS": "Airports",
|
|
33
|
+
"NUMBER_OF_STOPS": "Number of stops",
|
|
34
|
+
"FLIGHT_OUTWARD": "Outbound flight",
|
|
35
|
+
"DEPARTURE_TIME": "Departure time",
|
|
36
|
+
"TRAVEL_DURATION": "Travel duration",
|
|
37
|
+
"CHANGE_TIME": "Change time",
|
|
38
|
+
"FLIGHT_RETURN": "Return flight",
|
|
39
|
+
"NO_FLIGHTS_FOUND": "No flights found.",
|
|
40
|
+
"STARTING": "Starting from",
|
|
41
|
+
"LOWEST_PRICE": "Lowest price",
|
|
42
|
+
"CHOOSE_YOUR_CLASS": "Choose your class:",
|
|
43
|
+
"PLUS_ONE_DAY": "+1 day",
|
|
44
|
+
"STOP_TIME": "Change time",
|
|
45
|
+
"NIGHT_DEPARTURE": "Night (00:00 - 05:00)",
|
|
46
|
+
"MORNING_DEPARTURE": "Morning (05:00 - 12:00)",
|
|
47
|
+
"AFTERNOON_DEPARTURE": "Afternoon (12:00 - 18:00)",
|
|
48
|
+
"EVENING_DEPARTURE": "Evening (18:00 - 00:00)",
|
|
49
|
+
"FLIGHTS_FOUND_1": "",
|
|
50
|
+
"FLIGHTS_FOUND_2": "flights",
|
|
51
|
+
"FLIGHTS_FOUND_3": "found"
|
|
52
|
+
},
|
|
53
|
+
"PRODUCT": {
|
|
54
|
+
"STAY_INCLUDED": "Stay included",
|
|
55
|
+
"FLIGHT_INCLUDED": "Flight included",
|
|
56
|
+
"TRANSFER_INCLUDED": "Transfer included",
|
|
57
|
+
"LOADING_PRICE": "Your price is being composed.",
|
|
58
|
+
"PER_PERSON": "Per person",
|
|
59
|
+
"PER_NIGHT": "Per night",
|
|
60
|
+
"PER_PERSON_PER_NIGHT": "Per person / per night",
|
|
61
|
+
"BOOK_NOW": "Book now",
|
|
62
|
+
"TO_YOUR_OFFER": "To your quote",
|
|
63
|
+
"NOT_AVAILABLE": "Not available",
|
|
64
|
+
"NUMBER_OF_ROOMS": "Number of rooms",
|
|
65
|
+
"AGE_BY_DEPARTURE_DATE": "Age of children on departure date",
|
|
66
|
+
"YEAR": "Year",
|
|
67
|
+
"APPLY": "Apply",
|
|
68
|
+
"EDIT": "Edit",
|
|
69
|
+
"DEPARTURE": "Departure",
|
|
70
|
+
"DEPARTURE_DATE": "Departure date",
|
|
71
|
+
"RETURN": "Return",
|
|
72
|
+
"RETURN_DATE": "Return date",
|
|
73
|
+
"WHO_YOU_TRAVELING_WITH": "Who are you traveling with?",
|
|
74
|
+
"TRAVEL_PERIOD": "Travel period",
|
|
75
|
+
"CLOSE": "Close"
|
|
76
|
+
},
|
|
77
|
+
"MAIN": {
|
|
78
|
+
"PREPARING_BOOKING": "Please wait, we are preparing your booking",
|
|
79
|
+
"PREPARING_OFFER": "Please wait, we are preparing your quote",
|
|
80
|
+
"PRODUCT_UNAVAILABLE": "Product not available"
|
|
81
|
+
},
|
|
82
|
+
"SHARED": {
|
|
83
|
+
"ROOM": "Room",
|
|
84
|
+
"ROOMS": "Rooms",
|
|
85
|
+
"TOTAL_PRICE": "Total price",
|
|
86
|
+
"ADULTS": "Adults",
|
|
87
|
+
"CHILDREN": "Children",
|
|
88
|
+
"SELECT": "Select",
|
|
89
|
+
"SELECTED": "Selected"
|
|
90
|
+
},
|
|
91
|
+
"SIDEBAR": {
|
|
92
|
+
"OVERVIEW": "Summary",
|
|
93
|
+
"SLIDE_TOTAL_PRICE": "Total amount: ",
|
|
94
|
+
"SLIDE_DEPOSIT": "Deposit to be paid: ",
|
|
95
|
+
"TRAVEL_INFO": "Travel information",
|
|
96
|
+
"TRAVELERS": "Travelers",
|
|
97
|
+
"TRAVELERS_ADULTS": "adults",
|
|
98
|
+
"TRAVELERS_ADULT": "adult",
|
|
99
|
+
"TRAVELERS_CHILDREN": "children",
|
|
100
|
+
"TRAVELERS_CHILD": "child",
|
|
101
|
+
"DEPARTURE": "Outbound",
|
|
102
|
+
"DEPARTURE_SINGLE": "Date",
|
|
103
|
+
"ARRIVAL": "Return",
|
|
104
|
+
"FLIGHT": "Flight",
|
|
105
|
+
"ACCOMMODATION": "Accommodation booked",
|
|
106
|
+
"BASE_PRICE": "Base price",
|
|
107
|
+
"OPTIONS": "Options",
|
|
108
|
+
"INCLUDED_COSTS": "Included costs",
|
|
109
|
+
"EXTRA_COSTS": "Additional costs",
|
|
110
|
+
"DEPOSIT": "Deposit to be paid",
|
|
111
|
+
"DEPOSIT_TEXT1": "The steps for the ",
|
|
112
|
+
"DEPOSIT_TEXT2": "remaining balance",
|
|
113
|
+
"DEPOSIT_TEXT3": " of ",
|
|
114
|
+
"DEPOSIT_TEXT4": " are described in ",
|
|
115
|
+
"DEPOSIT_TEXT5": "step 3 (\"summary\")",
|
|
116
|
+
"DEPOSIT_TEXT6": " of the booking process.",
|
|
117
|
+
"LUGGAGE_INCLUDED": "Luggage included",
|
|
118
|
+
"DEPARTURE_FLIGHT": "Outbound flight",
|
|
119
|
+
"ARRIVAL_FLIGHT": "Return flight",
|
|
120
|
+
"FLIGHT_DEPARTURE": "Departure",
|
|
121
|
+
"FLIGHT_ARRIVAL": "Arrival",
|
|
122
|
+
"ON_REQUEST": "On request",
|
|
123
|
+
"CHANGES": "transfers"
|
|
124
|
+
},
|
|
125
|
+
"TRAVELERS_FORM": {
|
|
126
|
+
"TRAVELER": "Traveler",
|
|
127
|
+
"ADULT": "adult",
|
|
128
|
+
"ADULTS": "adults",
|
|
129
|
+
"CHILD": "child",
|
|
130
|
+
"CHILDREN": "children",
|
|
131
|
+
"GENDER": "Salutation",
|
|
132
|
+
"MALE": "Mr.",
|
|
133
|
+
"FEMALE": "Mrs.",
|
|
134
|
+
"OTHER": "Other",
|
|
135
|
+
"MAIN_BOOKER": "Main booker",
|
|
136
|
+
"FIRST_NAME": "First name",
|
|
137
|
+
"LAST_NAME": "Last name",
|
|
138
|
+
"BIRTHDATE": "Date of birth",
|
|
139
|
+
"STREET": "Street",
|
|
140
|
+
"STREET_PLACEHOLDER": "Your street",
|
|
141
|
+
"HOUSE_NUMBER": "House number",
|
|
142
|
+
"POST_BOX": "Box",
|
|
143
|
+
"ZIPCODE": "Postal code",
|
|
144
|
+
"CITY": "City",
|
|
145
|
+
"CITY_PLACEHOLDER": "City",
|
|
146
|
+
"COUNTRY": "Country",
|
|
147
|
+
"SELECT_COUNTRY": "Select country",
|
|
148
|
+
"PHONE": "Phone number",
|
|
149
|
+
"EMAIL": "Email",
|
|
150
|
+
"REPEAT_EMAIL": "Repeat email",
|
|
151
|
+
"VALIDATION_MESSAGE": "Please check the fields below and fill them in correctly.",
|
|
152
|
+
"BOOK_WITH_AGENT": "I want to book through my local travel agent",
|
|
153
|
+
"CHOOSE_OFFICE": "I choose an office",
|
|
154
|
+
"COUNTRIES": {
|
|
155
|
+
"BELGIUM": "Belgium",
|
|
156
|
+
"NETHERLANDS": "Netherlands",
|
|
157
|
+
"FRANCE": "France"
|
|
158
|
+
},
|
|
159
|
+
"CHOOSE_AGENT_PLACEHOLDER": "Choose your travel agent",
|
|
160
|
+
"VALIDATION": {
|
|
161
|
+
"TRAVELER_X_FIELD": "Room {0} - Traveler {1}: {2}",
|
|
162
|
+
"TRAVELER_X_IS_NO_ADULT": "Room {0} - Traveler {1}: is not an adult",
|
|
163
|
+
"TRAVELER_X_IS_NO_CHILD": "Room {0} - Traveler {1}: is not a child",
|
|
164
|
+
"NO_MAIN_BOOKER_SELECTED": "No main booker has been selected",
|
|
165
|
+
"MAIN_BOOKER_FIELD": "Main booker: {0}",
|
|
166
|
+
"MAIN_BOOKER_EMAIL_IS_INVALID": "Main booker: email is invalid",
|
|
167
|
+
"MAIN_BOOKER_EMAIL_DOES_NOT_MATCH": "Main booker: email does not match",
|
|
168
|
+
"AGENT_IS_REQUIRED": "Travel agent is required"
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
"OPTIONS_FORM": {
|
|
172
|
+
"NO_OPTIONS_TITLE": "No options",
|
|
173
|
+
"NO_OPTIONS_MESSAGE": "This trip has no additional options.",
|
|
174
|
+
"UNIT_TITLE": "Party",
|
|
175
|
+
"PACKAGE": "Package",
|
|
176
|
+
"DAY": "day",
|
|
177
|
+
"DAYS": "days",
|
|
178
|
+
"NIGHT": "night",
|
|
179
|
+
"NIGHTS": "nights",
|
|
180
|
+
"PER_PAX_TITLE": "Select options per traveler",
|
|
181
|
+
"PER_BOOKING_TITLE": "Select options per booking",
|
|
182
|
+
"PER_UNIT_TITLE": "Select options per party",
|
|
183
|
+
"NONE": "None"
|
|
184
|
+
},
|
|
185
|
+
"ROOM_OPTIONS_FORM": {
|
|
186
|
+
"TRAVELER_GROUP": "Travel party",
|
|
187
|
+
"ALTERNATIVES_TRAVELER_GROUP": "Alternative room options for travel party",
|
|
188
|
+
"SHOW_ALTERNATIVES": "Show alternative room options"
|
|
189
|
+
},
|
|
190
|
+
"SUMMARY": {
|
|
191
|
+
"PERSONAL_DETAILS": "Personal details",
|
|
192
|
+
"TRAVELERS": "travelers",
|
|
193
|
+
"TRAVELER": "traveler",
|
|
194
|
+
"ADULTS": "adults",
|
|
195
|
+
"ADULT": "adult",
|
|
196
|
+
"CHILDREN": "children",
|
|
197
|
+
"CHILD": "child",
|
|
198
|
+
"MAIN_BOOKER": "Main booker",
|
|
199
|
+
"NOTIFICATIONS_TITLE": "Attention",
|
|
200
|
+
"VALIDATE_TITLE": "Check your information",
|
|
201
|
+
"VALIDATE_TEXT_BOOKING": "You are about to confirm your booking. Please check that all information is correct and that names are exactly as shown on your ID or passport. This information is final and cannot be changed.",
|
|
202
|
+
"VALIDATE_TEXT_OFFER": "You are about to request a quote. Please check that all information is correct and that names are exactly as shown on your ID or passport. This helps us avoid problems if you book later.",
|
|
203
|
+
"OPTIONS": "Options",
|
|
204
|
+
"REMARKS": "Remarks",
|
|
205
|
+
"VOUCHERS": "Vouchers",
|
|
206
|
+
"VOUCHER_VALIDATE": "Validate voucher",
|
|
207
|
+
"ADD_VOUCHER": "Add voucher",
|
|
208
|
+
"VOUCHER_VALID": "Voucher is valid",
|
|
209
|
+
"VOUCHER_INVALID": "Voucher is not valid"
|
|
210
|
+
},
|
|
211
|
+
"CONFIRMATION": {
|
|
212
|
+
"TITLE_TEXT_OFFER": "Your quote with number {0} has been requested",
|
|
213
|
+
"TITLE_TEXT_BOOKING": "Your booking with number {0} has been confirmed",
|
|
214
|
+
"MESSAGE_TEXT1": "Your dream trip is now very close.",
|
|
215
|
+
"MESSAGE_TEXT2_OFFER": "Our travel specialists are processing your request and will contact you within 48 hours.",
|
|
216
|
+
"MESSAGE_TEXT2_BOOKING": "Our travel specialists are processing your booking and will contact you within 48 hours.",
|
|
217
|
+
"QUESTIONS_TEXT1": "Do you have any questions? ",
|
|
218
|
+
"QUESTIONS_TEXT2": "Let us know",
|
|
219
|
+
"QUESTIONS_TEXT3": ".",
|
|
220
|
+
"QUESTIONS_ALT": "Contact us",
|
|
221
|
+
"MAIL_SUBJECT": "Booking info"
|
|
222
|
+
},
|
|
223
|
+
"ERROR": {
|
|
224
|
+
"TRY_AGAIN": "Try booking again",
|
|
225
|
+
"MESSAGE_TEXT1": "Something went wrong while confirming your trip.",
|
|
226
|
+
"MESSAGE_TEXT2": "Click below to try again.",
|
|
227
|
+
"ERROR_TEXT1": "Still not working? ",
|
|
228
|
+
"ERROR_TEXT2": "Be sure to let us know",
|
|
229
|
+
"ERROR_TEXT3": ".",
|
|
230
|
+
"ERROR_ALT": "Contact us"
|
|
231
|
+
},
|
|
232
|
+
"PRINT_OFFER_BUTTON": {
|
|
233
|
+
"LABEL_IDLE": "Print offer",
|
|
234
|
+
"LABEL_CREATING": "Generating offer…",
|
|
235
|
+
"LABEL_PRINTING": "Generating PDF…"
|
|
236
|
+
}
|
|
237
|
+
}
|
|
@@ -151,13 +151,13 @@
|
|
|
151
151
|
"VALIDATION_MESSAGE": "Veuillez vérifier les champs du formulaire ci-dessous et remplissez-les correctement.",
|
|
152
152
|
"BOOK_WITH_AGENT": "Je souhaite réserver auprès de mon agent de voyage local",
|
|
153
153
|
"CHOOSE_OFFICE": "Je choisis une agence",
|
|
154
|
-
|
|
154
|
+
|
|
155
155
|
"COUNTRIES": {
|
|
156
156
|
"BELGIUM": "Belgique",
|
|
157
157
|
"NETHERLANDS": "Pays-Bas",
|
|
158
158
|
"FRANCE": "France"
|
|
159
159
|
},
|
|
160
|
-
"CHOOSE_AGENT_PLACEHOLDER": "Choisissez votre agent de voyage",
|
|
160
|
+
"CHOOSE_AGENT_PLACEHOLDER": "Choisissez votre agent de voyage",
|
|
161
161
|
"VALIDATION": {
|
|
162
162
|
"TRAVELER_X_FIELD": "Chambre {0} - Voyageur {1} : {2}",
|
|
163
163
|
"TRAVELER_X_IS_NO_ADULT": "Chambre {0} - Voyageur {1} : n'est pas un adulte",
|
|
@@ -229,5 +229,10 @@
|
|
|
229
229
|
"ERROR_TEXT2": "faites-le nous savoir",
|
|
230
230
|
"ERROR_TEXT3": ".",
|
|
231
231
|
"ERROR_ALT": "Contactez-nous"
|
|
232
|
+
},
|
|
233
|
+
"PRINT_OFFER_BUTTON": {
|
|
234
|
+
"LABEL_IDLE": "Imprimer le devis",
|
|
235
|
+
"LABEL_CREATING": "Génération du devis…",
|
|
236
|
+
"LABEL_PRINTING": "Génération du PDF…"
|
|
232
237
|
}
|
|
233
238
|
}
|
|
@@ -228,5 +228,10 @@
|
|
|
228
228
|
"ERROR_TEXT2": "Laat het ons dan zeker weten",
|
|
229
229
|
"ERROR_TEXT3": ".",
|
|
230
230
|
"ERROR_ALT": "Contacteer ons"
|
|
231
|
+
},
|
|
232
|
+
"PRINT_OFFER_BUTTON": {
|
|
233
|
+
"LABEL_IDLE": "Print offerte",
|
|
234
|
+
"LABEL_CREATING": "Offerte genereren...",
|
|
235
|
+
"LABEL_PRINTING": "PDF genereren..."
|
|
231
236
|
}
|
|
232
237
|
}
|
package/src/shared/types.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { fr, nlBE } from "date-fns/locale";
|
|
1
|
+
import { enGB, fr, nlBE } from "date-fns/locale";
|
|
2
2
|
|
|
3
|
-
export const languages = ["nl-BE", "fr-BE"];
|
|
3
|
+
export const languages = ["nl-BE", "fr-BE", "en-GB"];
|
|
4
4
|
export const defaultLanguage = "nl-BE";
|
|
5
5
|
|
|
6
6
|
export const formatPrice = (price: number, locale: string = "nl-BE") => {
|
|
@@ -15,6 +15,7 @@ export const formatPrice = (price: number, locale: string = "nl-BE") => {
|
|
|
15
15
|
|
|
16
16
|
import frJson from "../translations/fr-BE.json";
|
|
17
17
|
import nlJson from "../translations/nl-BE.json";
|
|
18
|
+
import enJson from "../translations/en-GB.json";
|
|
18
19
|
|
|
19
20
|
export const getTranslations = (language: string) => {
|
|
20
21
|
switch (language) {
|
|
@@ -22,6 +23,8 @@ export const getTranslations = (language: string) => {
|
|
|
22
23
|
return nlJson;
|
|
23
24
|
case "fr-BE":
|
|
24
25
|
return frJson;
|
|
26
|
+
case "en-GB":
|
|
27
|
+
return enJson;
|
|
25
28
|
default:
|
|
26
29
|
throw new Error(`The language '${language}' is not yet supported.`);
|
|
27
30
|
}
|
|
@@ -30,6 +33,7 @@ export const getTranslations = (language: string) => {
|
|
|
30
33
|
export const locales = {
|
|
31
34
|
"nl-BE": nlBE,
|
|
32
35
|
"fr-BE": fr,
|
|
36
|
+
"en-GB": enGB,
|
|
33
37
|
};
|
|
34
38
|
|
|
35
39
|
export function getLocale(code: string) {
|
|
@@ -38,6 +42,8 @@ export function getLocale(code: string) {
|
|
|
38
42
|
return locales[code];
|
|
39
43
|
case "fr-BE":
|
|
40
44
|
return locales[code];
|
|
45
|
+
case "en-GB":
|
|
46
|
+
return locales[code];
|
|
41
47
|
default:
|
|
42
48
|
return locales["nl-BE"];
|
|
43
49
|
}
|
|
@@ -53,4 +59,4 @@ export function format(text: string, args: any[]) {
|
|
|
53
59
|
return text.replace(/{([0-9]+)}/g, function (match, index) {
|
|
54
60
|
return typeof args[index] == "undefined" ? match : args[index];
|
|
55
61
|
});
|
|
56
|
-
}
|
|
62
|
+
}
|
|
@@ -60,9 +60,12 @@ export const getRoomsFromParams = (
|
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
// Encode the accommodation code in the room string because (external) acco codes can contain special characters like '='. eg: 'ACNYNEgUzMDc4NBoKMTAzODcwMjk4NQ=='
|
|
63
|
-
const safeRoomsString = roomString.replace(
|
|
64
|
-
|
|
65
|
-
|
|
63
|
+
const safeRoomsString = roomString.replace(
|
|
64
|
+
/accommodationCode:([^,]*)/,
|
|
65
|
+
(match, code) => {
|
|
66
|
+
return `accommodationCode:${encodeURIComponent(code)}`;
|
|
67
|
+
}
|
|
68
|
+
);
|
|
66
69
|
|
|
67
70
|
const rooms = JsonURL.parse(safeRoomsString) as Room[] | undefined;
|
|
68
71
|
|
|
@@ -24,7 +24,7 @@ export function buildTideClientConfig(
|
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
const selectAgentToken = (): string | undefined => {
|
|
27
|
+
export const selectAgentToken = (): string | undefined => {
|
|
28
28
|
let token: string | null = null;
|
|
29
29
|
if (typeof sessionStorage !== "undefined") {
|
|
30
30
|
token = sessionStorage.getItem("token");
|