ublo-lib 1.19.30 → 1.19.32
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/plausible/plausible.js +1 -1
- package/es/common/components/plausible/services/callback.d.ts.map +1 -1
- package/es/common/components/plausible/services/callback.js +12 -3
- package/es/esf/components/loyal-customers/components/customer-form.js +8 -6
- package/es/esf/components/loyal-customers/components/customer-form.module.css +16 -3
- package/es/esf/components/loyal-customers/components/student-form.js +21 -7
- package/es/esf/components/loyal-customers/components/student-form.module.css +9 -2
- package/es/esf/components/loyal-customers/loyal-customers.js +7 -7
- package/es/esf/components/loyal-customers/utils.js +0 -5
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@ import Script from "next/script";
|
|
|
3
3
|
import getConfig from "next/config";
|
|
4
4
|
const { publicRuntimeConfig } = getConfig();
|
|
5
5
|
const { plausibleDomain } = publicRuntimeConfig;
|
|
6
|
-
const DEFAULT_SOURCE = "https://plausible.io/js/script.file-downloads.outbound-links.js";
|
|
6
|
+
const DEFAULT_SOURCE = "https://plausible.io/js/script.revenue.file-downloads.outbound-links.js";
|
|
7
7
|
export default function PlausibleScript({ lang, source = DEFAULT_SOURCE, }) {
|
|
8
8
|
const hasI18n = typeof plausibleDomain === "object";
|
|
9
9
|
if (hasI18n && !lang) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"callback.d.ts","sourceRoot":"","sources":["../../../../../src/common/components/plausible/services/callback.ts"],"names":[],"mappings":"AAEA,KAAK,IAAI,GAAG;IACV,OAAO,EAAE;QACP,SAAS,EAAE,MAAM,CAAC;QAClB,UAAU,EAAE,MAAM,CAAC;QACnB,aAAa,EAAE,MAAM,CAAC;QACtB,cAAc,EAAE,MAAM,CAAC;QACvB,cAAc,EAAE,MAAM,CAAC;QACvB,YAAY,EAAE,MAAM,CAAC;QACrB,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC;CACH,CAAC;AAEF,KAAK,KAAK,GAAG;IACX,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAiBF,wBAAgB,IAAI,CAAC,EACnB,KAAK,EACL,YAAY,EAAE,WAAW,EACzB,QAAQ,EACR,KAAU,EACV,OAAO,EACP,MAAM,EACN,QAAgB,GACjB,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"callback.d.ts","sourceRoot":"","sources":["../../../../../src/common/components/plausible/services/callback.ts"],"names":[],"mappings":"AAEA,KAAK,IAAI,GAAG;IACV,OAAO,EAAE;QACP,SAAS,EAAE,MAAM,CAAC;QAClB,UAAU,EAAE,MAAM,CAAC;QACnB,aAAa,EAAE,MAAM,CAAC;QACtB,cAAc,EAAE,MAAM,CAAC;QACvB,cAAc,EAAE,MAAM,CAAC;QACvB,YAAY,EAAE,MAAM,CAAC;QACrB,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC;CACH,CAAC;AAEF,KAAK,KAAK,GAAG;IACX,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAiBF,wBAAgB,IAAI,CAAC,EACnB,KAAK,EACL,YAAY,EAAE,WAAW,EACzB,QAAQ,EACR,KAAU,EACV,OAAO,EACP,MAAM,EACN,QAAgB,GACjB,EAAE,KAAK,QAiFP"}
|
|
@@ -14,6 +14,7 @@ const EVENT_NAMES = {
|
|
|
14
14
|
};
|
|
15
15
|
export function MseM({ event, payment_type: paymentType, execcode, items = [], orderId, cartId, currency = "EUR", }) {
|
|
16
16
|
const hoteId = getBusinessProvider();
|
|
17
|
+
const stay = getStay();
|
|
17
18
|
const amount = items.reduce((acc, item) => {
|
|
18
19
|
return acc + item.gtmData.price * item.gtmData.quantity;
|
|
19
20
|
}, 0);
|
|
@@ -30,19 +31,19 @@ export function MseM({ event, payment_type: paymentType, execcode, items = [], o
|
|
|
30
31
|
switch (event) {
|
|
31
32
|
case "view_item": {
|
|
32
33
|
const formatedItems = formatPeekPerformancesItem(items);
|
|
33
|
-
const rawData = JSON.stringify({ products: formatedItems, hoteId });
|
|
34
|
+
const rawData = JSON.stringify({ products: formatedItems, hoteId, stay });
|
|
34
35
|
sendGoal(name, { ...firstProductProps, rawData });
|
|
35
36
|
break;
|
|
36
37
|
}
|
|
37
38
|
case "add_to_cart": {
|
|
38
39
|
const formatedItems = formatPeekPerformancesItem(items);
|
|
39
|
-
const rawData = JSON.stringify({ products: formatedItems, hoteId });
|
|
40
|
+
const rawData = JSON.stringify({ products: formatedItems, hoteId, stay });
|
|
40
41
|
sendGoal(name, { ...firstProductProps, rawData }, revenue);
|
|
41
42
|
break;
|
|
42
43
|
}
|
|
43
44
|
case "checkout": {
|
|
44
45
|
const formatedItems = formatPeekPerformancesItem(items);
|
|
45
|
-
const rawData = JSON.stringify({ products: formatedItems, hoteId });
|
|
46
|
+
const rawData = JSON.stringify({ products: formatedItems, hoteId, stay });
|
|
46
47
|
sendGoal(name, { cartId, rawData }, revenue);
|
|
47
48
|
break;
|
|
48
49
|
}
|
|
@@ -51,6 +52,7 @@ export function MseM({ event, payment_type: paymentType, execcode, items = [], o
|
|
|
51
52
|
const rawData = JSON.stringify({
|
|
52
53
|
products: formatedItems,
|
|
53
54
|
hoteId,
|
|
55
|
+
stay,
|
|
54
56
|
paymentMethod: paymentType,
|
|
55
57
|
});
|
|
56
58
|
sendGoal(name, { cartId, "Payment type": paymentType, rawData }, revenue);
|
|
@@ -63,6 +65,7 @@ export function MseM({ event, payment_type: paymentType, execcode, items = [], o
|
|
|
63
65
|
const rawData = JSON.stringify({
|
|
64
66
|
products: formatedItems,
|
|
65
67
|
hoteId,
|
|
68
|
+
stay,
|
|
66
69
|
attempts,
|
|
67
70
|
paymentMethod: paymentType,
|
|
68
71
|
execCode: execcode,
|
|
@@ -107,6 +110,12 @@ function formatPeekPerformancesItem(items) {
|
|
|
107
110
|
};
|
|
108
111
|
});
|
|
109
112
|
}
|
|
113
|
+
function getStay() {
|
|
114
|
+
const stay = window.localStorage.getItem("stay");
|
|
115
|
+
if (stay) {
|
|
116
|
+
return stay;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
110
119
|
function getBusinessProvider() {
|
|
111
120
|
const businessProvider = window.localStorage.getItem("businessProvider");
|
|
112
121
|
if (businessProvider) {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import
|
|
3
|
-
import Popup from "../../../../common/components/popup";
|
|
2
|
+
import Dialog from "dt-design-system/es/dialog";
|
|
4
3
|
import Button from "dt-design-system/es/button";
|
|
5
4
|
import * as DTIcons from "dt-design-system/es/icons";
|
|
6
5
|
import Field from "./field";
|
|
@@ -61,14 +60,17 @@ const CustomerForm = ({
|
|
|
61
60
|
setVoucher("");
|
|
62
61
|
setResponse(RESPONSE.OK);
|
|
63
62
|
};
|
|
64
|
-
|
|
65
|
-
return ReactDOM.createPortal(_jsx(Popup, {
|
|
63
|
+
return _jsx(Dialog, {
|
|
66
64
|
className: styles.popup,
|
|
67
65
|
close: close,
|
|
66
|
+
isOpened: open,
|
|
68
67
|
title: Messages.get(lang, "customer-information"),
|
|
69
68
|
children: _jsxs("div", {
|
|
70
69
|
className: styles.inner,
|
|
71
|
-
children: [_jsx(
|
|
70
|
+
children: [_jsx("div", {
|
|
71
|
+
className: styles.title,
|
|
72
|
+
children: Messages.get(lang, "customer-information")
|
|
73
|
+
}), _jsx(Stay, {
|
|
72
74
|
lang: lang
|
|
73
75
|
}), _jsx("div", {
|
|
74
76
|
className: styles.form,
|
|
@@ -95,6 +97,6 @@ const CustomerForm = ({
|
|
|
95
97
|
})]
|
|
96
98
|
})]
|
|
97
99
|
})
|
|
98
|
-
})
|
|
100
|
+
});
|
|
99
101
|
};
|
|
100
102
|
export default CustomerForm;
|
|
@@ -1,13 +1,26 @@
|
|
|
1
|
-
.popup
|
|
2
|
-
|
|
1
|
+
.popup {
|
|
2
|
+
--ds-secondary: #cc0900;
|
|
3
|
+
--ds-primary: #bb0b02;
|
|
4
|
+
|
|
5
|
+
padding: 10px 16px;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.inner {
|
|
9
|
+
padding: 10px 0;
|
|
3
10
|
}
|
|
4
11
|
|
|
5
12
|
@media (min-width: 992px) {
|
|
6
13
|
.inner {
|
|
7
|
-
padding:
|
|
14
|
+
padding: 10px 30px 10px 30px;
|
|
8
15
|
}
|
|
9
16
|
}
|
|
10
17
|
|
|
18
|
+
.title {
|
|
19
|
+
margin-bottom: 20px;
|
|
20
|
+
font-size: 18px;
|
|
21
|
+
font-weight: 700;
|
|
22
|
+
}
|
|
23
|
+
|
|
11
24
|
.form {
|
|
12
25
|
display: flex;
|
|
13
26
|
flex-direction: column;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import
|
|
3
|
-
import Popup from "../../../../common/components/popup";
|
|
2
|
+
import Dialog from "dt-design-system/es/dialog";
|
|
4
3
|
import Field from "./field";
|
|
5
4
|
import Button from "dt-design-system/es/button";
|
|
6
5
|
import * as DTIcons from "dt-design-system/es/icons";
|
|
@@ -21,7 +20,8 @@ const StudentForm = ({
|
|
|
21
20
|
close,
|
|
22
21
|
studentData,
|
|
23
22
|
levels,
|
|
24
|
-
setRows
|
|
23
|
+
setRows,
|
|
24
|
+
recapFormRef
|
|
25
25
|
}) => {
|
|
26
26
|
const fields = Data.studentFormFields(studentData.productCategory ? levels[studentData.productCategory] : levels);
|
|
27
27
|
const [formData, setFormData] = React.useState(getInitialState(fields));
|
|
@@ -37,21 +37,35 @@ const StudentForm = ({
|
|
|
37
37
|
formData
|
|
38
38
|
}]);
|
|
39
39
|
onClose();
|
|
40
|
+
const recapForm = recapFormRef.current;
|
|
41
|
+
if (recapForm) {
|
|
42
|
+
requestAnimationFrame(() => {
|
|
43
|
+
requestAnimationFrame(() => {
|
|
44
|
+
recapForm.scrollIntoView({
|
|
45
|
+
behavior: "smooth"
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
}
|
|
40
50
|
};
|
|
41
|
-
if (!dataKeys.length) return null;
|
|
42
51
|
const {
|
|
43
52
|
details,
|
|
44
53
|
price,
|
|
45
54
|
selectedOption,
|
|
46
55
|
title
|
|
47
56
|
} = studentData;
|
|
48
|
-
return
|
|
57
|
+
return _jsx(Dialog, {
|
|
49
58
|
className: styles.popup,
|
|
50
59
|
close: onClose,
|
|
60
|
+
isOpened: Boolean(dataKeys.length),
|
|
51
61
|
title: Messages.get(lang, "student-information"),
|
|
62
|
+
showCloseButton: true,
|
|
52
63
|
children: _jsxs("div", {
|
|
53
64
|
className: styles.inner,
|
|
54
|
-
children: [
|
|
65
|
+
children: [_jsx("div", {
|
|
66
|
+
className: styles.title,
|
|
67
|
+
children: Messages.get(lang, "student-information")
|
|
68
|
+
}), _jsxs("div", {
|
|
55
69
|
className: styles.header,
|
|
56
70
|
children: [_jsx("div", {
|
|
57
71
|
className: styles.title,
|
|
@@ -96,6 +110,6 @@ const StudentForm = ({
|
|
|
96
110
|
})
|
|
97
111
|
})]
|
|
98
112
|
})
|
|
99
|
-
})
|
|
113
|
+
});
|
|
100
114
|
};
|
|
101
115
|
export default StudentForm;
|
|
@@ -1,13 +1,20 @@
|
|
|
1
|
-
.popup
|
|
1
|
+
.popup {
|
|
2
2
|
--ds-secondary: #cc0900;
|
|
3
3
|
--ds-primary: #bb0b02;
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
padding: 10px 16px;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
.inner {
|
|
9
9
|
width: 420px;
|
|
10
10
|
max-width: 100%;
|
|
11
|
+
padding: 10px 0;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.title {
|
|
15
|
+
margin-bottom: 20px;
|
|
16
|
+
font-size: 18px;
|
|
17
|
+
font-weight: 700;
|
|
11
18
|
}
|
|
12
19
|
|
|
13
20
|
.header {
|
|
@@ -6,14 +6,13 @@ import StudentForm from "./components/student-form";
|
|
|
6
6
|
import CustomerForm from "./components/customer-form";
|
|
7
7
|
import * as Messages from "./messages";
|
|
8
8
|
import * as Content from "./content";
|
|
9
|
-
import * as Utils from "./utils";
|
|
10
9
|
import Button from "dt-design-system/es/button";
|
|
11
10
|
import * as DTIcons from "dt-design-system/es/icons";
|
|
12
11
|
import useStoredRows from "./hooks/use-stored-rows";
|
|
13
12
|
import styles from "./loyal-customers.module.css";
|
|
14
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
14
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
|
-
|
|
15
|
+
export default function LoyalCustomers({
|
|
17
16
|
lang,
|
|
18
17
|
cmsMode,
|
|
19
18
|
selectors,
|
|
@@ -27,13 +26,13 @@ const LoyalCustomers = ({
|
|
|
27
26
|
resort,
|
|
28
27
|
disableVoucher,
|
|
29
28
|
integration
|
|
30
|
-
})
|
|
29
|
+
}) {
|
|
30
|
+
const ref = React.useRef(null);
|
|
31
31
|
const [rows, setRows] = useStoredRows([]);
|
|
32
32
|
const [openedRow, setOpenedRow] = React.useState();
|
|
33
33
|
const [voucher, setVoucher] = React.useState("");
|
|
34
34
|
const [studentData, setStudentData] = React.useState({});
|
|
35
35
|
const [customerFormOpen, setCustomerFormOpen] = React.useState(false);
|
|
36
|
-
Utils.showHelper();
|
|
37
36
|
const total = rows.reduce((acc, row) => acc + row.price, 0);
|
|
38
37
|
const closeStudentForm = () => setStudentData({});
|
|
39
38
|
const closeCustomerForm = () => setCustomerFormOpen(false);
|
|
@@ -76,6 +75,7 @@ const LoyalCustomers = ({
|
|
|
76
75
|
}, [cleanup, cmsMode, init, selectors]);
|
|
77
76
|
const classes = classNames(styles.index, className);
|
|
78
77
|
return _jsxs("div", {
|
|
78
|
+
ref: ref,
|
|
79
79
|
className: classes,
|
|
80
80
|
children: [_jsx("div", {
|
|
81
81
|
className: styles.title,
|
|
@@ -109,7 +109,8 @@ const LoyalCustomers = ({
|
|
|
109
109
|
close: closeStudentForm,
|
|
110
110
|
studentData: studentData,
|
|
111
111
|
levels: levels,
|
|
112
|
-
setRows: setRows
|
|
112
|
+
setRows: setRows,
|
|
113
|
+
recapFormRef: ref
|
|
113
114
|
}), _jsx(CustomerForm, {
|
|
114
115
|
lang: lang,
|
|
115
116
|
close: closeCustomerForm,
|
|
@@ -126,5 +127,4 @@ const LoyalCustomers = ({
|
|
|
126
127
|
integration: integration
|
|
127
128
|
})]
|
|
128
129
|
});
|
|
129
|
-
}
|
|
130
|
-
export default LoyalCustomers;
|
|
130
|
+
}
|
|
@@ -12,11 +12,6 @@ export const formatDate = (lang, date) => {
|
|
|
12
12
|
year: "numeric"
|
|
13
13
|
});
|
|
14
14
|
};
|
|
15
|
-
export const showHelper = () => {
|
|
16
|
-
if (process.env.NODE_ENV !== "production") {
|
|
17
|
-
console.info("LoyalCustomers: See https://github.com/valraiso-esf/documentation-sites-marchands/tree/master/loyal-customers for more information.");
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
15
|
export const buildPayload = (lang, channel, resort, merchant, voucher, customerData, rows, disableVoucher) => {
|
|
21
16
|
const {
|
|
22
17
|
comment,
|