ublo-lib 1.39.21 → 1.39.23
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/loyal-customers/loyal-customers.d.ts.map +1 -1
- package/es/esf/components/loyal-customers/loyal-customers.js +5 -3
- package/es/future/components/msem-preset-editor/editors/esf.d.ts.map +1 -1
- package/es/future/components/msem-preset-editor/editors/esf.js +8 -4
- package/es/future/components/msem-preset-editor/services/api.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loyal-customers.d.ts","sourceRoot":"","sources":["../../../../src/esf/components/loyal-customers/loyal-customers.js"],"names":[],"mappings":"AAaA;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"loyal-customers.d.ts","sourceRoot":"","sources":["../../../../src/esf/components/loyal-customers/loyal-customers.js"],"names":[],"mappings":"AAaA;;;;;;;;;;;;;;;4CAyIC"}
|
|
@@ -30,12 +30,14 @@ export default function LoyalCustomers({ lang, cmsMode, selectors, levels, class
|
|
|
30
30
|
}, [convertTableToSelect, handleVariants, levels, selectors]);
|
|
31
31
|
const init = React.useCallback((product) => {
|
|
32
32
|
const { options, button, wrapper } = Content.getElements(product, selectors);
|
|
33
|
-
if (
|
|
33
|
+
if (button) {
|
|
34
|
+
button.callback = openStudentForm(product);
|
|
35
|
+
button.addEventListener("click", button.callback);
|
|
36
|
+
}
|
|
37
|
+
if (!options || wrapper)
|
|
34
38
|
return;
|
|
35
39
|
if (convertTableToSelect)
|
|
36
40
|
Content.createSelect(options);
|
|
37
|
-
button.callback = openStudentForm(product);
|
|
38
|
-
button.addEventListener("click", button.callback);
|
|
39
41
|
}, [openStudentForm, selectors, convertTableToSelect]);
|
|
40
42
|
const cleanup = React.useCallback((product) => {
|
|
41
43
|
const { options, button, wrapper } = Content.getElements(product, selectors);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"esf.d.ts","sourceRoot":"","sources":["../../../../../src/future/components/msem-preset-editor/editors/esf.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,KAAK,KAAK,GAAG;IACX,eAAe,EAAE,MAAM,CAAC;IACxB,IAAI,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC;IACnC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC;IACnC,SAAS,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC;IAC5E,mBAAmB,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;IACnE,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,KAAK,IAAI,CAAC;IACxD,UAAU,EAAE,MAAM,IAAI,CAAC;CACxB,CAAC;AAeF,MAAM,CAAC,OAAO,UAAU,GAAG,CAAC,EAC1B,eAAe,EACf,MAAM,EACN,SAAS,EACT,mBAAmB,EACnB,QAAQ,EACR,UAAU,GACX,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"esf.d.ts","sourceRoot":"","sources":["../../../../../src/future/components/msem-preset-editor/editors/esf.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,KAAK,KAAK,GAAG;IACX,eAAe,EAAE,MAAM,CAAC;IACxB,IAAI,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC;IACnC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC;IACnC,SAAS,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC;IAC5E,mBAAmB,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;IACnE,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,KAAK,IAAI,CAAC;IACxD,UAAU,EAAE,MAAM,IAAI,CAAC;CACxB,CAAC;AAeF,MAAM,CAAC,OAAO,UAAU,GAAG,CAAC,EAC1B,eAAe,EACf,MAAM,EACN,SAAS,EACT,mBAAmB,EACnB,QAAQ,EACR,UAAU,GACX,EAAE,KAAK,2CA4IP"}
|
|
@@ -13,6 +13,7 @@ export default function Esf({ msemServicesUrl, preset, setPreset, setShowPresetD
|
|
|
13
13
|
const [loading, setLoading] = React.useState(false);
|
|
14
14
|
const [data, setData] = React.useState(getDefaultData(preset));
|
|
15
15
|
const [kindList, setKindList] = React.useState([]);
|
|
16
|
+
const [error, setError] = React.useState();
|
|
16
17
|
const formattedKindList = kindList.map((k) => {
|
|
17
18
|
const isEngagement = k.engagement;
|
|
18
19
|
const label = isEngagement
|
|
@@ -28,7 +29,8 @@ export default function Esf({ msemServicesUrl, preset, setPreset, setShowPresetD
|
|
|
28
29
|
}
|
|
29
30
|
return !k.engagement && k.code === code;
|
|
30
31
|
});
|
|
31
|
-
const { channel,
|
|
32
|
+
const { channel, merchant, lang } = preset?.options || {};
|
|
33
|
+
const resort = Number(merchant.replace("ESF-", ""));
|
|
32
34
|
const year = getYear();
|
|
33
35
|
const stay = buildStay(year);
|
|
34
36
|
const season = getSeason(year);
|
|
@@ -43,12 +45,13 @@ export default function Esf({ msemServicesUrl, preset, setPreset, setShowPresetD
|
|
|
43
45
|
setShowPresetDialog(false);
|
|
44
46
|
};
|
|
45
47
|
React.useEffect(() => {
|
|
46
|
-
if (year && stay && !kindList.length) {
|
|
48
|
+
if (year && stay && !kindList.length && !error) {
|
|
47
49
|
const runEffect = async () => {
|
|
48
50
|
try {
|
|
49
51
|
setLoading(true);
|
|
50
52
|
const result = await API.getEsfKinds(msemServicesUrl, channel, resort, stay.from, stay.to, season, lang);
|
|
51
|
-
|
|
53
|
+
console.log(result.choices);
|
|
54
|
+
if (result.choices?.length > 0) {
|
|
52
55
|
setKindList(result.choices);
|
|
53
56
|
}
|
|
54
57
|
else {
|
|
@@ -57,6 +60,7 @@ export default function Esf({ msemServicesUrl, preset, setPreset, setShowPresetD
|
|
|
57
60
|
}
|
|
58
61
|
catch (e) {
|
|
59
62
|
console.error(e);
|
|
63
|
+
setError("Erreur lors de la récupération des types de cours");
|
|
60
64
|
}
|
|
61
65
|
finally {
|
|
62
66
|
setLoading(false);
|
|
@@ -98,7 +102,7 @@ export default function Esf({ msemServicesUrl, preset, setPreset, setShowPresetD
|
|
|
98
102
|
testPreset,
|
|
99
103
|
cancelPreset,
|
|
100
104
|
confirmPreset: data.intermediary || data.kind ? confirmPreset : undefined,
|
|
101
|
-
}, children: [_jsx(Input, { label: "Code interm\u00E9diaire", value: data.intermediary, onValueChange: updateField("intermediary") }), (loading || formattedKindList.length > 0) && (_jsx(Select, { label: "Type de cours", placeholder: "S\u00E9lectionnez un type de cours", value: data.kind, options: formattedKindList, onValueChange: updateField("kind"), loading: loading }))] }));
|
|
105
|
+
}, children: [_jsx(Input, { label: "Code interm\u00E9diaire", value: data.intermediary, onValueChange: updateField("intermediary") }), (loading || formattedKindList.length > 0 || error) && (_jsx(Select, { label: "Type de cours", placeholder: "S\u00E9lectionnez un type de cours", value: data.kind, options: formattedKindList, onValueChange: updateField("kind"), loading: loading, disabled: Boolean(error), error: error }))] }));
|
|
102
106
|
}
|
|
103
107
|
function getDefaultData(preset) {
|
|
104
108
|
if (!preset?.presets && !preset?.options)
|
|
@@ -13,5 +13,5 @@ export declare function getVakarioCategories(msemServicesUrl: string, channel: s
|
|
|
13
13
|
export declare function getVakarioLevels(msemServicesUrl: string, channel: string, merchant: string, kind: string, age: string, category: string, language?: string): Promise<any>;
|
|
14
14
|
export declare function getOtherProductsCategories(msemServicesUrl: string, facet: string, merchant: string, lang?: string): Promise<any>;
|
|
15
15
|
export declare function getRenterList(msemServicesUrl: string, channel: string, resort: number | string, date?: string): Promise<any>;
|
|
16
|
-
export declare function getEsfKinds(msemServicesUrl: string, channel: string, resort:
|
|
16
|
+
export declare function getEsfKinds(msemServicesUrl: string, channel: string, resort: number, stayFrom: string, stayTo: string, season: string, lang?: string): Promise<any>;
|
|
17
17
|
//# sourceMappingURL=api.d.ts.map
|