ublo-lib 1.38.42 → 1.38.43
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/esf/components/espace-prive/panier.d.ts.map +1 -1
- package/es/esf/components/espace-prive/panier.js +16 -15
- package/es/esf/components/espace-prive/services/links.d.ts +1 -1
- package/es/esf/components/espace-prive/services/links.d.ts.map +1 -1
- package/es/esf/components/espace-prive/services/links.js +2 -7
- package/es/esf/components/espace-prive/tools.d.ts.map +1 -1
- package/es/esf/components/espace-prive/tools.js +1 -1
- package/es/esf/components/espace-prive/tunnel.d.ts.map +1 -1
- package/es/esf/components/espace-prive/tunnel.js +4 -3
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"panier.d.ts","sourceRoot":"","sources":["../../../../src/esf/components/espace-prive/panier.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"panier.d.ts","sourceRoot":"","sources":["../../../../src/esf/components/espace-prive/panier.js"],"names":[],"mappings":"AASA,0EAwCC"}
|
|
@@ -1,33 +1,34 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
2
3
|
import { renderToString } from "react-dom/server";
|
|
3
|
-
import * as MseM from "
|
|
4
|
+
import * as MseM from "../../../future/components/msem";
|
|
4
5
|
import { useUbloContext } from "ublo/with-ublo";
|
|
5
6
|
import CustomOffers from "./custom-offers";
|
|
6
7
|
import * as Services from "./services/links";
|
|
7
8
|
import { useContext } from "./context";
|
|
8
9
|
export default function Panier() {
|
|
9
10
|
const { lang, config } = useUbloContext();
|
|
10
|
-
const { partnerID, apiURL
|
|
11
|
-
const {
|
|
11
|
+
const { partnerID, apiURL } = useContext();
|
|
12
|
+
const { resort } = config;
|
|
12
13
|
const stringOffers = renderToString(_jsx(CustomOffers, { partnerID: partnerID, lang: lang }));
|
|
14
|
+
const analytics = React.useCallback(async ({ event, execcode }) => {
|
|
15
|
+
if (event === "purchase" && execcode === "0000") {
|
|
16
|
+
try {
|
|
17
|
+
await Services.setLinkUsed(apiURL, getCookie("id"));
|
|
18
|
+
}
|
|
19
|
+
catch {
|
|
20
|
+
console.error("Failed to mark link as used");
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}, [apiURL]);
|
|
13
24
|
return (_jsx("div", { children: _jsx(MseM.Tunnel, { options: {
|
|
14
25
|
lang,
|
|
15
|
-
channel,
|
|
26
|
+
channel: "ESF",
|
|
16
27
|
resort,
|
|
17
28
|
groundedTo: "#msem-tunnel",
|
|
18
29
|
esfUrl: "/",
|
|
19
30
|
customOffers: stringOffers,
|
|
20
|
-
analytics
|
|
21
|
-
const { event, execcode } = data;
|
|
22
|
-
if (event === "purchase" && execcode === "0000") {
|
|
23
|
-
await Services.setLinkUsed(apiURL, getCookie("id"), cmsToken);
|
|
24
|
-
try {
|
|
25
|
-
}
|
|
26
|
-
catch {
|
|
27
|
-
console.error("Failed to mark link as used");
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
+
analytics,
|
|
31
32
|
facet: 0,
|
|
32
33
|
}, children: _jsx("div", { id: "msem-tunnel" }) }) }));
|
|
33
34
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export function getLinks(apiURL: any, partnerID: any, cmsToken: any): Promise<any>;
|
|
2
2
|
export function createLink(apiURL: any, email: any, partnerID: any, site: any, cmsToken: any): Promise<any>;
|
|
3
3
|
export function deleteLink(apiURL: any, id: any, cmsToken: any): Promise<any>;
|
|
4
|
-
export function setLinkUsed(apiURL: any, id: any
|
|
4
|
+
export function setLinkUsed(apiURL: any, id: any): Promise<any>;
|
|
5
5
|
//# sourceMappingURL=links.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"links.d.ts","sourceRoot":"","sources":["../../../../../src/esf/components/espace-prive/services/links.js"],"names":[],"mappings":"AAAO,mFASN;AAEM,4GAeN;AAEM,8EAaN;AAEM
|
|
1
|
+
{"version":3,"file":"links.d.ts","sourceRoot":"","sources":["../../../../../src/esf/components/espace-prive/services/links.js"],"names":[],"mappings":"AAAO,mFASN;AAEM,4GAeN;AAEM,8EAaN;AAEM,gEAIN"}
|
|
@@ -36,13 +36,8 @@ export const deleteLink = async (apiURL, id, cmsToken) => {
|
|
|
36
36
|
const data = await res.json();
|
|
37
37
|
return data;
|
|
38
38
|
};
|
|
39
|
-
export const setLinkUsed = async (apiURL, id
|
|
40
|
-
const res = await fetch(`${apiURL}/
|
|
41
|
-
method: "PATCH",
|
|
42
|
-
headers: {
|
|
43
|
-
Authorization: cmsToken,
|
|
44
|
-
},
|
|
45
|
-
});
|
|
39
|
+
export const setLinkUsed = async (apiURL, id) => {
|
|
40
|
+
const res = await fetch(`${apiURL}/used?clientID=${id}`, { method: "PATCH" });
|
|
46
41
|
const data = await res.json();
|
|
47
42
|
return data?.links || [];
|
|
48
43
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../../../src/esf/components/espace-prive/tools.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../../../src/esf/components/espace-prive/tools.js"],"names":[],"mappings":"AAiBA;;4CAqFC"}
|
|
@@ -3,7 +3,7 @@ import * as React from "react";
|
|
|
3
3
|
import { useUbloContext } from "ublo/with-ublo";
|
|
4
4
|
import Link from "ublo/link";
|
|
5
5
|
import Dialog from "dt-design-system/es/dialog";
|
|
6
|
-
import Levels from "
|
|
6
|
+
import Levels from "../../../esf/components/levels";
|
|
7
7
|
import styles from "./tools.module.css";
|
|
8
8
|
const EXCLUSIONS = ["book-moniteurs"];
|
|
9
9
|
const LEVEL_PAGES = [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tunnel.d.ts","sourceRoot":"","sources":["../../../../src/esf/components/espace-prive/tunnel.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tunnel.d.ts","sourceRoot":"","sources":["../../../../src/esf/components/espace-prive/tunnel.js"],"names":[],"mappings":"AASA,0EAoCC"}
|
|
@@ -8,15 +8,16 @@ import ClientLinks from "./admin/client-links";
|
|
|
8
8
|
import { useContext } from "./context";
|
|
9
9
|
export default function Tunnel() {
|
|
10
10
|
const { lang, config, cmsMode } = useUbloContext();
|
|
11
|
-
const {
|
|
12
|
-
const { intermediary, error } = useContext();
|
|
11
|
+
const { resort } = config;
|
|
12
|
+
const { intermediary, error, partnerID } = useContext();
|
|
13
13
|
const renderLoader = !intermediary && !error;
|
|
14
14
|
const renderError = error && !intermediary;
|
|
15
15
|
return (_jsxs("div", { children: [renderLoader && _jsx(Loader, {}), renderError && (_jsx("div", { style: { textAlign: "center", color: "var(--ds-red-300, #f26464)" }, children: _jsx(Message, { id: "intermediary-error" }) })), !renderLoader && !renderError && (_jsx(MseM.Esf, { options: {
|
|
16
16
|
lang,
|
|
17
|
-
channel,
|
|
17
|
+
channel: "ESF",
|
|
18
18
|
resort,
|
|
19
19
|
cartUrl: `/espace-prive/${partnerID}/panier`,
|
|
20
|
+
skipRecap: true,
|
|
20
21
|
groundedTo: "#msem-esf",
|
|
21
22
|
intermediary,
|
|
22
23
|
facet: 0,
|