ublo-lib 1.25.18 → 1.25.20
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/cross-selling-editor/cross-selling-editor.js +2 -2
- package/es/common/components/cross-selling-editor/hooks/use-custom-offers.js +7 -5
- package/es/common/components/msem-preset-editor/editors/standard-products.js +1 -1
- package/es/esf/components/magic-box/booking.js +4 -3
- package/es/esf/components/magic-box/magic-box.js +3 -1
- package/es/esf/components/magic-box/services/widgets.js +2 -2
- package/package.json +1 -1
|
@@ -42,14 +42,14 @@ export default function CrossSellingEditor({
|
|
|
42
42
|
section: titleZoneProps.section,
|
|
43
43
|
maxSections: 1,
|
|
44
44
|
tooltip: "Zone d'edition : Titre des offres",
|
|
45
|
-
"data-title-zone": ""
|
|
45
|
+
"data-title-zone": titleZoneProps.dataAttributeValue || ""
|
|
46
46
|
}), contentZoneProps.enabled && _jsx(Zone, {
|
|
47
47
|
ref: ref,
|
|
48
48
|
id: contentZoneProps.id || "tunnel-offers",
|
|
49
49
|
className: classNames(styles.contentZone, contentZoneProps.className),
|
|
50
50
|
section: contentZoneProps.section,
|
|
51
51
|
tooltip: "Zone d'edition : Offres",
|
|
52
|
-
"data-content-zone": ""
|
|
52
|
+
"data-content-zone": contentZoneProps.dataAttributeValue || ""
|
|
53
53
|
})]
|
|
54
54
|
});
|
|
55
55
|
}
|
|
@@ -2,15 +2,18 @@ import * as React from "react";
|
|
|
2
2
|
import { useUbloContext } from "ublo/with-ublo";
|
|
3
3
|
import * as API from "../services/api";
|
|
4
4
|
import * as Utils from "../services/utils";
|
|
5
|
-
export default function useCustomOffers(
|
|
5
|
+
export default function useCustomOffers({
|
|
6
|
+
titleSelector,
|
|
7
|
+
contentSelector
|
|
8
|
+
} = {}) {
|
|
6
9
|
const {
|
|
7
10
|
lang,
|
|
8
11
|
path
|
|
9
12
|
} = useUbloContext();
|
|
10
13
|
const [offers, setOffers] = React.useState();
|
|
11
14
|
React.useEffect(() => {
|
|
12
|
-
const titleZone = document.querySelector("[data-title-zone]");
|
|
13
|
-
const contentZone = document.querySelector("[data-content-zone]");
|
|
15
|
+
const titleZone = document.querySelector(titleSelector || "[data-title-zone]");
|
|
16
|
+
const contentZone = document.querySelector(contentSelector || "[data-content-zone]");
|
|
14
17
|
const getOffers = async () => {
|
|
15
18
|
const cartId = window.sessionStorage.getItem("cartId");
|
|
16
19
|
let items = {};
|
|
@@ -26,8 +29,7 @@ export default function useCustomOffers() {
|
|
|
26
29
|
items = Utils.formatCartContent(cart);
|
|
27
30
|
merchants = Utils.getMerchantsFromCart(cart);
|
|
28
31
|
stay = Utils.getStayFromCart(cart);
|
|
29
|
-
skiPassDurations = await Utils.getSkiPassDurationFromCart(cart);
|
|
30
|
-
durationTags = await Utils.getDurationTagsFromCart(cart);
|
|
32
|
+
[skiPassDurations, durationTags] = await Promise.all([Utils.getSkiPassDurationFromCart(cart), Utils.getDurationTagsFromCart(cart)]);
|
|
31
33
|
} catch (e) {}
|
|
32
34
|
}
|
|
33
35
|
const content = {
|
|
@@ -67,7 +67,7 @@ export default function StandardProducts({
|
|
|
67
67
|
});
|
|
68
68
|
}, [onChange, selectedProductCategory, setPreset]);
|
|
69
69
|
return _jsx(Form, {
|
|
70
|
-
title: "Presets activit\xE9s
|
|
70
|
+
title: "Presets activit\xE9s autres produits",
|
|
71
71
|
width: 420,
|
|
72
72
|
preset: preset,
|
|
73
73
|
buttonsActions: {
|
|
@@ -14,7 +14,8 @@ const Booking = ({
|
|
|
14
14
|
channel,
|
|
15
15
|
values,
|
|
16
16
|
maxCPDuration,
|
|
17
|
-
setCurrentStep
|
|
17
|
+
setCurrentStep,
|
|
18
|
+
msemWidgetHost
|
|
18
19
|
}) => {
|
|
19
20
|
const {
|
|
20
21
|
lang,
|
|
@@ -59,7 +60,7 @@ const Booking = ({
|
|
|
59
60
|
}, [cartPage, categoryCode]);
|
|
60
61
|
React.useEffect(() => {
|
|
61
62
|
const init = async () => {
|
|
62
|
-
await loadWigetMseM();
|
|
63
|
+
await loadWigetMseM(msemWidgetHost);
|
|
63
64
|
window.MseM?.onLoad(() => {
|
|
64
65
|
const options = {
|
|
65
66
|
resort,
|
|
@@ -85,7 +86,7 @@ const Booking = ({
|
|
|
85
86
|
});
|
|
86
87
|
};
|
|
87
88
|
init();
|
|
88
|
-
}, [cartUrl, categoryCode, channel, cmsMode, engagement, engagementPresets, goToCart, lang, resort, stay.from, stay.to]);
|
|
89
|
+
}, [cartUrl, categoryCode, channel, cmsMode, engagement, engagementPresets, goToCart, lang, msemWidgetHost, resort, stay.from, stay.to]);
|
|
89
90
|
return _jsxs("div", {
|
|
90
91
|
className: css.root,
|
|
91
92
|
children: [_jsxs(Button, {
|
|
@@ -23,6 +23,7 @@ function MagicBox({
|
|
|
23
23
|
maxDays = Infinity,
|
|
24
24
|
allowedActivities,
|
|
25
25
|
categories,
|
|
26
|
+
msemWidgetHost = "https://widget.msem.tech",
|
|
26
27
|
msemApiHost = "https://services.msem.tech/api/esf",
|
|
27
28
|
msemAdminHost = "https://admin.mon-sejour-en-montagne.com/api/gesco",
|
|
28
29
|
children
|
|
@@ -163,7 +164,8 @@ function MagicBox({
|
|
|
163
164
|
channel: channel,
|
|
164
165
|
values: values,
|
|
165
166
|
maxCPDuration: maxCPDuration,
|
|
166
|
-
setCurrentStep: setCurrentStep
|
|
167
|
+
setCurrentStep: setCurrentStep,
|
|
168
|
+
msemWidgetHost: msemWidgetHost
|
|
167
169
|
})]
|
|
168
170
|
})
|
|
169
171
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { loadJS } from "../../../../common/utils/load-js";
|
|
2
|
-
export async function loadWigetMseM() {
|
|
3
|
-
await loadJS(
|
|
2
|
+
export async function loadWigetMseM(msemWidgetHost) {
|
|
3
|
+
await loadJS(`${msemWidgetHost}/static/js/widget-msem.js`, "widget-msem");
|
|
4
4
|
}
|