@qite/tide-booking-component 1.4.13 → 1.4.15
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
CHANGED
|
@@ -14496,11 +14496,9 @@ var Summary = function () {
|
|
|
14496
14496
|
React__default["default"].createElement("h5", { className: "form__region-heading" }, translations.SUMMARY.OPTIONS)))),
|
|
14497
14497
|
React__default["default"].createElement("div", { className: "form__row" },
|
|
14498
14498
|
React__default["default"].createElement("div", { className: "form__group" },
|
|
14499
|
-
React__default["default"].createElement("ul", { className: "list list--booking-summary" }, (activeOption === null || activeOption === void 0 ? void 0 : activeOption.serviceType) == build.ServiceType.flight
|
|
14500
|
-
departureFlightMetaData &&
|
|
14501
|
-
returnFlightMetaData
|
|
14502
|
-
React__default["default"].createElement(SummaryFlight, { flightMetaData: departureFlightMetaData, header: translations.SIDEBAR.DEPARTURE_FLIGHT }),
|
|
14503
|
-
React__default["default"].createElement(SummaryFlight, { flightMetaData: returnFlightMetaData, header: translations.SIDEBAR.ARRIVAL_FLIGHT }))) : (React__default["default"].createElement(React__default["default"].Fragment, null, activeOption === null || activeOption === void 0 ? void 0 : activeOption.rooms.flatMap(function (r) { return r.options; }).filter(function (x) { return x.isSelected; }).map(function (roomOption, roomOptionIndex) { return (React__default["default"].createElement(React__default["default"].Fragment, { key: roomOptionIndex },
|
|
14499
|
+
React__default["default"].createElement("ul", { className: "list list--booking-summary" }, (activeOption === null || activeOption === void 0 ? void 0 : activeOption.serviceType) == build.ServiceType.flight ? (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
14500
|
+
departureFlightMetaData && (React__default["default"].createElement(SummaryFlight, { flightMetaData: departureFlightMetaData, header: translations.SIDEBAR.DEPARTURE_FLIGHT })),
|
|
14501
|
+
returnFlightMetaData && (React__default["default"].createElement(SummaryFlight, { flightMetaData: returnFlightMetaData, header: translations.SIDEBAR.ARRIVAL_FLIGHT })))) : (React__default["default"].createElement(React__default["default"].Fragment, null, activeOption === null || activeOption === void 0 ? void 0 : activeOption.rooms.flatMap(function (r) { return r.options; }).filter(function (x) { return x.isSelected; }).map(function (roomOption, roomOptionIndex) { return (React__default["default"].createElement(React__default["default"].Fragment, { key: roomOptionIndex },
|
|
14504
14502
|
React__default["default"].createElement("li", null,
|
|
14505
14503
|
React__default["default"].createElement("h6", null, roomOption === null || roomOption === void 0 ? void 0 : roomOption.productName),
|
|
14506
14504
|
React__default["default"].createElement("ul", null,
|
|
@@ -15448,6 +15446,14 @@ var Booking = function (_a) {
|
|
|
15448
15446
|
flightRouteId: flightRouteId,
|
|
15449
15447
|
vendorConfigurationId: vendorConfigurationId,
|
|
15450
15448
|
};
|
|
15449
|
+
console.log("Setting booking attributes:", nextBookingAttrs);
|
|
15450
|
+
console.log("Current booking attributes:", bookingAttributes);
|
|
15451
|
+
console.log("Params:", {
|
|
15452
|
+
startDate: startDate,
|
|
15453
|
+
endDate: endDate,
|
|
15454
|
+
catalogueId: catalogueId,
|
|
15455
|
+
rooms: rooms,
|
|
15456
|
+
});
|
|
15451
15457
|
if (!lodash.isNil(startDate) &&
|
|
15452
15458
|
!lodash.isNil(endDate) &&
|
|
15453
15459
|
!lodash.isNil(catalogueId) &&
|
|
@@ -15476,8 +15482,15 @@ var Booking = function (_a) {
|
|
|
15476
15482
|
};
|
|
15477
15483
|
}, [isRetry]);
|
|
15478
15484
|
React.useEffect(function () {
|
|
15479
|
-
var
|
|
15480
|
-
|
|
15485
|
+
var _a, _b;
|
|
15486
|
+
var params = new URLSearchParams(location.search);
|
|
15487
|
+
var foundproductCode = (_a = getStringFromParams(params, "productCode")) !== null && _a !== void 0 ? _a : productCode;
|
|
15488
|
+
var foundproductName = (_b = getStringFromParams(params, "productName")) !== null && _b !== void 0 ? _b : productName;
|
|
15489
|
+
var next = {
|
|
15490
|
+
productCode: foundproductCode,
|
|
15491
|
+
productName: foundproductName,
|
|
15492
|
+
};
|
|
15493
|
+
if (!lodash.isNil(foundproductCode) && !lodash.isNil(foundproductName)) {
|
|
15481
15494
|
if (!lodash.isEqual(productAttributes, next)) {
|
|
15482
15495
|
dispatch(setProductAttributes(next));
|
|
15483
15496
|
}
|
|
@@ -15485,7 +15498,7 @@ var Booking = function (_a) {
|
|
|
15485
15498
|
else {
|
|
15486
15499
|
console.error("Failure when setting product attributes", productCode, productName);
|
|
15487
15500
|
}
|
|
15488
|
-
}, [productCode, productName, setProductAttributes]);
|
|
15501
|
+
}, [location.search, productCode, productName, setProductAttributes]);
|
|
15489
15502
|
var getTranslations = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
15490
15503
|
var translations, _a;
|
|
15491
15504
|
return __generator(this, function (_b) {
|
|
@@ -15548,6 +15561,7 @@ var Booking = function (_a) {
|
|
|
15548
15561
|
]);
|
|
15549
15562
|
React.useEffect(function () {
|
|
15550
15563
|
if (!productAttributes || !bookingAttributes || !(rooms === null || rooms === void 0 ? void 0 : rooms.length)) {
|
|
15564
|
+
console.log("Not all data available yet to fetch package", productAttributes, bookingAttributes, rooms);
|
|
15551
15565
|
return;
|
|
15552
15566
|
}
|
|
15553
15567
|
// Fetch data
|
package/build/build-esm/index.js
CHANGED
|
@@ -14485,11 +14485,9 @@ var Summary = function () {
|
|
|
14485
14485
|
React.createElement("h5", { className: "form__region-heading" }, translations.SUMMARY.OPTIONS)))),
|
|
14486
14486
|
React.createElement("div", { className: "form__row" },
|
|
14487
14487
|
React.createElement("div", { className: "form__group" },
|
|
14488
|
-
React.createElement("ul", { className: "list list--booking-summary" }, (activeOption === null || activeOption === void 0 ? void 0 : activeOption.serviceType) == build.ServiceType.flight
|
|
14489
|
-
departureFlightMetaData &&
|
|
14490
|
-
returnFlightMetaData
|
|
14491
|
-
React.createElement(SummaryFlight, { flightMetaData: departureFlightMetaData, header: translations.SIDEBAR.DEPARTURE_FLIGHT }),
|
|
14492
|
-
React.createElement(SummaryFlight, { flightMetaData: returnFlightMetaData, header: translations.SIDEBAR.ARRIVAL_FLIGHT }))) : (React.createElement(React.Fragment, null, activeOption === null || activeOption === void 0 ? void 0 : activeOption.rooms.flatMap(function (r) { return r.options; }).filter(function (x) { return x.isSelected; }).map(function (roomOption, roomOptionIndex) { return (React.createElement(React.Fragment, { key: roomOptionIndex },
|
|
14488
|
+
React.createElement("ul", { className: "list list--booking-summary" }, (activeOption === null || activeOption === void 0 ? void 0 : activeOption.serviceType) == build.ServiceType.flight ? (React.createElement(React.Fragment, null,
|
|
14489
|
+
departureFlightMetaData && (React.createElement(SummaryFlight, { flightMetaData: departureFlightMetaData, header: translations.SIDEBAR.DEPARTURE_FLIGHT })),
|
|
14490
|
+
returnFlightMetaData && (React.createElement(SummaryFlight, { flightMetaData: returnFlightMetaData, header: translations.SIDEBAR.ARRIVAL_FLIGHT })))) : (React.createElement(React.Fragment, null, activeOption === null || activeOption === void 0 ? void 0 : activeOption.rooms.flatMap(function (r) { return r.options; }).filter(function (x) { return x.isSelected; }).map(function (roomOption, roomOptionIndex) { return (React.createElement(React.Fragment, { key: roomOptionIndex },
|
|
14493
14491
|
React.createElement("li", null,
|
|
14494
14492
|
React.createElement("h6", null, roomOption === null || roomOption === void 0 ? void 0 : roomOption.productName),
|
|
14495
14493
|
React.createElement("ul", null,
|
|
@@ -15437,6 +15435,14 @@ var Booking = function (_a) {
|
|
|
15437
15435
|
flightRouteId: flightRouteId,
|
|
15438
15436
|
vendorConfigurationId: vendorConfigurationId,
|
|
15439
15437
|
};
|
|
15438
|
+
console.log("Setting booking attributes:", nextBookingAttrs);
|
|
15439
|
+
console.log("Current booking attributes:", bookingAttributes);
|
|
15440
|
+
console.log("Params:", {
|
|
15441
|
+
startDate: startDate,
|
|
15442
|
+
endDate: endDate,
|
|
15443
|
+
catalogueId: catalogueId,
|
|
15444
|
+
rooms: rooms,
|
|
15445
|
+
});
|
|
15440
15446
|
if (!isNil(startDate) &&
|
|
15441
15447
|
!isNil(endDate) &&
|
|
15442
15448
|
!isNil(catalogueId) &&
|
|
@@ -15465,8 +15471,15 @@ var Booking = function (_a) {
|
|
|
15465
15471
|
};
|
|
15466
15472
|
}, [isRetry]);
|
|
15467
15473
|
useEffect(function () {
|
|
15468
|
-
var
|
|
15469
|
-
|
|
15474
|
+
var _a, _b;
|
|
15475
|
+
var params = new URLSearchParams(location.search);
|
|
15476
|
+
var foundproductCode = (_a = getStringFromParams(params, "productCode")) !== null && _a !== void 0 ? _a : productCode;
|
|
15477
|
+
var foundproductName = (_b = getStringFromParams(params, "productName")) !== null && _b !== void 0 ? _b : productName;
|
|
15478
|
+
var next = {
|
|
15479
|
+
productCode: foundproductCode,
|
|
15480
|
+
productName: foundproductName,
|
|
15481
|
+
};
|
|
15482
|
+
if (!isNil(foundproductCode) && !isNil(foundproductName)) {
|
|
15470
15483
|
if (!isEqual$1(productAttributes, next)) {
|
|
15471
15484
|
dispatch(setProductAttributes(next));
|
|
15472
15485
|
}
|
|
@@ -15474,7 +15487,7 @@ var Booking = function (_a) {
|
|
|
15474
15487
|
else {
|
|
15475
15488
|
console.error("Failure when setting product attributes", productCode, productName);
|
|
15476
15489
|
}
|
|
15477
|
-
}, [productCode, productName, setProductAttributes]);
|
|
15490
|
+
}, [location.search, productCode, productName, setProductAttributes]);
|
|
15478
15491
|
var getTranslations = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
15479
15492
|
var translations, _a;
|
|
15480
15493
|
return __generator(this, function (_b) {
|
|
@@ -15537,6 +15550,7 @@ var Booking = function (_a) {
|
|
|
15537
15550
|
]);
|
|
15538
15551
|
useEffect(function () {
|
|
15539
15552
|
if (!productAttributes || !bookingAttributes || !(rooms === null || rooms === void 0 ? void 0 : rooms.length)) {
|
|
15553
|
+
console.log("Not all data available yet to fetch package", productAttributes, bookingAttributes, rooms);
|
|
15540
15554
|
return;
|
|
15541
15555
|
}
|
|
15542
15556
|
// Fetch data
|
package/package.json
CHANGED
|
@@ -159,6 +159,14 @@ const Booking: React.FC<BookingProps> = ({
|
|
|
159
159
|
vendorConfigurationId,
|
|
160
160
|
} as BookingAttributes;
|
|
161
161
|
|
|
162
|
+
console.log("Setting booking attributes:", nextBookingAttrs);
|
|
163
|
+
console.log("Current booking attributes:", bookingAttributes);
|
|
164
|
+
console.log("Params:", {
|
|
165
|
+
startDate,
|
|
166
|
+
endDate,
|
|
167
|
+
catalogueId,
|
|
168
|
+
rooms,
|
|
169
|
+
});
|
|
162
170
|
if (
|
|
163
171
|
!isNil(startDate) &&
|
|
164
172
|
!isNil(endDate) &&
|
|
@@ -200,8 +208,16 @@ const Booking: React.FC<BookingProps> = ({
|
|
|
200
208
|
}, [isRetry]);
|
|
201
209
|
|
|
202
210
|
useEffect(() => {
|
|
203
|
-
const
|
|
204
|
-
|
|
211
|
+
const params = new URLSearchParams(location.search);
|
|
212
|
+
const foundproductCode =
|
|
213
|
+
getStringFromParams(params, "productCode") ?? productCode;
|
|
214
|
+
const foundproductName =
|
|
215
|
+
getStringFromParams(params, "productName") ?? productName;
|
|
216
|
+
const next = {
|
|
217
|
+
productCode: foundproductCode,
|
|
218
|
+
productName: foundproductName,
|
|
219
|
+
};
|
|
220
|
+
if (!isNil(foundproductCode) && !isNil(foundproductName)) {
|
|
205
221
|
if (!isEqual(productAttributes, next)) {
|
|
206
222
|
dispatch(setProductAttributes(next));
|
|
207
223
|
}
|
|
@@ -212,7 +228,7 @@ const Booking: React.FC<BookingProps> = ({
|
|
|
212
228
|
productName
|
|
213
229
|
);
|
|
214
230
|
}
|
|
215
|
-
}, [productCode, productName, setProductAttributes]);
|
|
231
|
+
}, [location.search, productCode, productName, setProductAttributes]);
|
|
216
232
|
|
|
217
233
|
const getTranslations = async () => {
|
|
218
234
|
const translations = translationFiles?.map((x) =>
|
|
@@ -260,6 +276,12 @@ const Booking: React.FC<BookingProps> = ({
|
|
|
260
276
|
|
|
261
277
|
useEffect(() => {
|
|
262
278
|
if (!productAttributes || !bookingAttributes || !rooms?.length) {
|
|
279
|
+
console.log(
|
|
280
|
+
"Not all data available yet to fetch package",
|
|
281
|
+
productAttributes,
|
|
282
|
+
bookingAttributes,
|
|
283
|
+
rooms
|
|
284
|
+
);
|
|
263
285
|
return;
|
|
264
286
|
}
|
|
265
287
|
// Fetch data
|