ublo-lib 1.49.5 → 1.49.6
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/es/common/components/cart-dialog/cart-dialog.d.ts.map +1 -1
- package/es/common/components/cart-dialog/cart-dialog.js +3 -1
- package/es/common/components/cart-dialog/lodging.d.ts +2 -1
- package/es/common/components/cart-dialog/lodging.d.ts.map +1 -1
- package/es/common/components/cart-dialog/lodging.js +7 -4
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cart-dialog.d.ts","sourceRoot":"","sources":["../../../../src/common/components/cart-dialog/cart-dialog.js"],"names":[],"mappings":";AAuBA;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"cart-dialog.d.ts","sourceRoot":"","sources":["../../../../src/common/components/cart-dialog/cart-dialog.js"],"names":[],"mappings":";AAuBA;;;;;;;;;;;4CA8EC"}
|
|
@@ -34,6 +34,8 @@ const CartDialog = ({ cart, setCart, shortcuts, paxPlan, facet, zoneId, zonePath
|
|
|
34
34
|
? `/${lang}${shortcuts.cartItem.path}`
|
|
35
35
|
: shortcuts.cartItem.path;
|
|
36
36
|
const orders = cartContent.cart.orders[convertedKind];
|
|
37
|
+
const stayTaxes = cartContent.cart.orders["STAY_TAX"];
|
|
38
|
+
const stayTax = stayTaxes[stayTaxes.length - 1];
|
|
37
39
|
const { inscriptions } = orders[orders.length - 1];
|
|
38
40
|
const newItem = inscriptions[inscriptions.length - 1];
|
|
39
41
|
const closeDialog = () => {
|
|
@@ -49,6 +51,6 @@ const CartDialog = ({ cart, setCart, shortcuts, paxPlan, facet, zoneId, zonePath
|
|
|
49
51
|
window.location.href = cartUrl;
|
|
50
52
|
};
|
|
51
53
|
const Component = isSupported ? products[kind] : products.DEFAULT;
|
|
52
|
-
return (_jsx(Dialog, { className: styles.cartDialog, isOpened: Boolean(cart), close: closeDialogAndReload, closeButtonVariant: "link", children: _jsx(Component, { kind: kind, item: newItem, data: data, closeDialog: closeDialog, goToCart: goToCart, cart: cart, paxPlan: paxPlan, facet: facet, zoneId: zoneId, zonePath: zonePath, hasImage: hasImage, hideSkiPassesStay: hideSkiPassesStay, customContinue: customContinue }) }));
|
|
54
|
+
return (_jsx(Dialog, { className: styles.cartDialog, isOpened: Boolean(cart), close: closeDialogAndReload, closeButtonVariant: "link", children: _jsx(Component, { kind: kind, item: newItem, data: data, closeDialog: closeDialog, goToCart: goToCart, cart: cart, paxPlan: paxPlan, facet: facet, zoneId: zoneId, zonePath: zonePath, hasImage: hasImage, stayTax: stayTax, hideSkiPassesStay: hideSkiPassesStay, customContinue: customContinue }) }));
|
|
53
55
|
};
|
|
54
56
|
export default CartDialog;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export default Lodging;
|
|
2
|
-
declare function Lodging({ item, data, closeDialog, goToCart, cart, facet, paxPlan, zoneId, zonePath, hasImage, customContinue, }: {
|
|
2
|
+
declare function Lodging({ item, data, closeDialog, goToCart, cart, facet, paxPlan, zoneId, zonePath, hasImage, customContinue, stayTax, }: {
|
|
3
3
|
item: any;
|
|
4
4
|
data: any;
|
|
5
5
|
closeDialog: any;
|
|
@@ -11,5 +11,6 @@ declare function Lodging({ item, data, closeDialog, goToCart, cart, facet, paxPl
|
|
|
11
11
|
zonePath: any;
|
|
12
12
|
hasImage: any;
|
|
13
13
|
customContinue: any;
|
|
14
|
+
stayTax?: {};
|
|
14
15
|
}): import("react/jsx-runtime").JSX.Element;
|
|
15
16
|
//# sourceMappingURL=lodging.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lodging.d.ts","sourceRoot":"","sources":["../../../../src/common/components/cart-dialog/lodging.js"],"names":[],"mappings":";AAiCA
|
|
1
|
+
{"version":3,"file":"lodging.d.ts","sourceRoot":"","sources":["../../../../src/common/components/cart-dialog/lodging.js"],"names":[],"mappings":";AAiCA;;;;;;;;;;;;;4CAiEC"}
|
|
@@ -26,10 +26,13 @@ const getPaxPlanLabel = (lang, paxPlan) => {
|
|
|
26
26
|
}
|
|
27
27
|
return "";
|
|
28
28
|
};
|
|
29
|
-
const Lodging = ({ item, data, closeDialog, goToCart, cart, facet, paxPlan, zoneId, zonePath, hasImage, customContinue, }) => {
|
|
29
|
+
const Lodging = ({ item, data, closeDialog, goToCart, cart, facet, paxPlan, zoneId, zonePath, hasImage, customContinue, stayTax = {}, }) => {
|
|
30
30
|
const { lang } = useUbloContext();
|
|
31
|
-
const {
|
|
32
|
-
const {
|
|
31
|
+
const { inscriptions = [] } = stayTax;
|
|
32
|
+
const { description, stayTaxCartId, conciergeries = {} } = item;
|
|
33
|
+
const stayStaxPrice = inscriptions?.find((item) => item?.id === stayTaxCartId)?.price || 0;
|
|
34
|
+
const { hotel, room, total } = description;
|
|
35
|
+
const { options = [] } = conciergeries;
|
|
33
36
|
const kind = "lodging";
|
|
34
37
|
const optionsTotal = options.reduce((acc, option) => acc + option.price, 0);
|
|
35
38
|
let image, thumbnail = undefined;
|
|
@@ -39,7 +42,7 @@ const Lodging = ({ item, data, closeDialog, goToCart, cart, facet, paxPlan, zone
|
|
|
39
42
|
thumbnail = bareImage.replace("huge", "medium");
|
|
40
43
|
}
|
|
41
44
|
const formattedPaxPlan = getPaxPlanLabel(lang, paxPlan);
|
|
42
|
-
const price = total + optionsTotal;
|
|
45
|
+
const price = total + optionsTotal + stayStaxPrice;
|
|
43
46
|
const Title = () => {
|
|
44
47
|
return (_jsxs(_Fragment, { children: [_jsxs("b", { children: [message(lang, "cart-dialog-lodging-title"), " "] }), message(lang, "cart-dialog-title-suffix-singular")] }));
|
|
45
48
|
};
|