ublo-lib 1.49.10 → 1.49.12
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/instant-search/services/api.d.ts.map +1 -1
- package/es/esf/components/instant-search/services/api.js +3 -1
- package/es/esf/components/instructors-book/api.d.ts.map +1 -1
- package/es/esf/components/instructors-book/api.js +2 -1
- package/es/future/components/msem-package/components/config.d.ts.map +1 -1
- package/es/future/components/msem-package/components/config.js +2 -3
- package/es/future/components/msem-package/components/filters.js +3 -3
- package/es/future/components/msem-package/components/widget-dialog.js +2 -2
- package/es/future/components/msem-package/components/widget.d.ts.map +1 -1
- package/es/future/components/msem-package/components/widget.js +4 -4
- package/es/future/components/msem-package/components/widgets-zones.d.ts.map +1 -1
- package/es/future/components/msem-package/components/widgets-zones.js +2 -1
- package/es/future/components/msem-package/components/widgets.d.ts.map +1 -1
- package/es/future/components/msem-package/components/widgets.js +3 -4
- package/es/future/components/msem-package/context.d.ts +17 -0
- package/es/future/components/msem-package/context.d.ts.map +1 -0
- package/es/future/components/msem-package/context.js +9 -0
- package/es/future/components/msem-package/{msem-package.d.ts → core.d.ts} +4 -2
- package/es/future/components/msem-package/core.d.ts.map +1 -0
- package/es/future/components/msem-package/core.js +17 -0
- package/es/future/components/msem-package/i18n/translations.js +2 -2
- package/es/future/components/msem-package/index.d.ts +9 -2
- package/es/future/components/msem-package/index.d.ts.map +1 -1
- package/es/future/components/msem-package/index.js +25 -2
- package/es/future/components/msem-package/utils/api.d.ts +1 -1
- package/es/future/components/msem-package/utils/api.d.ts.map +1 -1
- package/es/future/components/msem-package/utils/api.js +1 -4
- package/es/future/components/msem-preset-editor/components/widget-list-item.d.ts.map +1 -1
- package/es/future/components/msem-preset-editor/components/widget-list-item.js +1 -0
- package/es/future/components/msem-preset-editor/components/widget-list.js +1 -1
- package/es/future/components/msem-preset-editor/editors/easyrent-rental.d.ts +18 -0
- package/es/future/components/msem-preset-editor/editors/easyrent-rental.d.ts.map +1 -0
- package/es/future/components/msem-preset-editor/editors/easyrent-rental.js +235 -0
- package/es/future/components/msem-preset-editor/editors/index.d.ts +2 -0
- package/es/future/components/msem-preset-editor/editors/index.d.ts.map +1 -1
- package/es/future/components/msem-preset-editor/editors/index.js +2 -0
- package/es/future/components/msem-preset-editor/editors/ski-rental.d.ts.map +1 -1
- package/es/future/components/msem-preset-editor/editors/ski-rental.js +4 -2
- package/es/future/components/msem-preset-editor/msem-preset-editor.d.ts.map +1 -1
- package/es/future/components/msem-preset-editor/msem-preset-editor.js +1 -3
- package/es/future/components/msem-preset-editor/services/api.d.ts +4 -2
- package/es/future/components/msem-preset-editor/services/api.d.ts.map +1 -1
- package/es/future/components/msem-preset-editor/services/api.js +15 -7
- package/es/future/components/msem-preset-editor/services/offers.d.ts.map +1 -1
- package/es/future/components/msem-preset-editor/services/offers.js +13 -0
- package/es/future/components/msem-preset-editor/services/preset.d.ts.map +1 -1
- package/es/future/components/msem-preset-editor/services/preset.js +9 -3
- package/es/market-place/components/instant-search/services/api.d.ts.map +1 -1
- package/es/market-place/components/instant-search/services/api.js +1 -1
- package/package.json +1 -1
- package/es/future/components/msem-package/msem-package.d.ts.map +0 -1
- package/es/future/components/msem-package/msem-package.js +0 -17
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../../../src/esf/components/instant-search/services/api.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../../../src/esf/components/instant-search/services/api.ts"],"names":[],"mappings":"AAOA,wBAAgB,YAAY,CAC1B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,OAAO,GAAE,MAA+F,EACxG,cAAc,CAAC,EAAE,MAAM,gBAaxB"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import * as Fetcher from "../../../../common/utils/fetcher";
|
|
2
|
-
|
|
2
|
+
import getConfig from "next/config";
|
|
3
|
+
const { publicRuntimeConfig } = getConfig();
|
|
4
|
+
const { searchApi: api = "https://search.ublo.app/api" } = publicRuntimeConfig;
|
|
3
5
|
export function fetchResults(site, lang, query, queryBy = "title,subtitle,text,pageTitle,seoKeywords,parentTitle,seoTitle,meetingPoint,imageAlt", queryByWeights) {
|
|
4
6
|
const endpoint = `${api}/ublo-search/search/esf/v2`;
|
|
5
7
|
return Fetcher.post(endpoint, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../../src/esf/components/instructors-book/api.js"],"names":[],"mappings":"AAgCA,qEAYC;AAED,
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../../src/esf/components/instructors-book/api.js"],"names":[],"mappings":"AAgCA,qEAYC;AAED,mEAUC;AAEM,8FAYN"}
|
|
@@ -40,7 +40,8 @@ export async function fetchInstructors(lang, body = {}) {
|
|
|
40
40
|
export async function fetchInstructor(lang, uri) {
|
|
41
41
|
try {
|
|
42
42
|
const url = `${carnetRougeApi}/annuaire/public/moniteur/${resort}/${lang}/${uri}`;
|
|
43
|
-
|
|
43
|
+
const { email, telephone, ...moniteur } = (await fetcher(url)) || {};
|
|
44
|
+
return moniteur;
|
|
44
45
|
}
|
|
45
46
|
catch (e) {
|
|
46
47
|
console.warn(e);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../../src/future/components/msem-package/components/config.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../../src/future/components/msem-package/components/config.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,KAAK,KAAK,MAAM,UAAU,CAAC;AAIvC,KAAK,KAAK,GAAG;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC;IACrB,SAAS,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;CAC/D,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,KAAK,2CAsDpE"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
import {
|
|
4
|
-
import Zone from "ublo/zone";
|
|
3
|
+
import { useMsemRuntime } from "../context";
|
|
5
4
|
import styles from "./config.module.css";
|
|
6
5
|
export default function Config({ idPrefix, config, setConfig }) {
|
|
7
6
|
const ref = React.useRef(null);
|
|
8
|
-
const { menuPath, lang, path } =
|
|
7
|
+
const { menuPath, lang, path, Zone } = useMsemRuntime();
|
|
9
8
|
const initializedRef = React.useRef(false);
|
|
10
9
|
const prevRouteRef = React.useRef(`/${lang}${path}`);
|
|
11
10
|
React.useEffect(() => {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { useMsemRuntime } from "../context";
|
|
4
4
|
import Input from "dt-design-system/es/input";
|
|
5
5
|
import Dropdown from "dt-design-system/es/dropdown";
|
|
6
|
-
import
|
|
6
|
+
import * as Utils from "../../../../common/components/date-picker/utils";
|
|
7
7
|
import T, { t } from "../i18n/translations";
|
|
8
8
|
import styles from "./filters.module.css";
|
|
9
9
|
export default function Filters({ config, stay, setStay }) {
|
|
10
10
|
const ref = React.useRef(null);
|
|
11
|
-
const { lang } =
|
|
11
|
+
const { lang, DatePicker } = useMsemRuntime();
|
|
12
12
|
const [stayDates, setStayDates] = React.useState([]);
|
|
13
13
|
const [datePickerOpen, setDatePickerOpen] = React.useState(false);
|
|
14
14
|
const [datePickerOptions, setDatePickerOptions] = React.useState();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { useMsemRuntime } from "../context";
|
|
4
4
|
import Button from "dt-design-system/es/button";
|
|
5
5
|
import Input from "dt-design-system/es/input";
|
|
6
6
|
import Dialog from "dt-design-system/es/dialog";
|
|
@@ -9,7 +9,7 @@ import MseMPresetEditor from "../../msem-preset-editor";
|
|
|
9
9
|
import * as Icons from "dt-design-system/es/icons";
|
|
10
10
|
import styles from "./widget-dialog.module.css";
|
|
11
11
|
export default function WidgetDialog({ config, setConfig, editorOptions, widget, closeWidgetDialog, }) {
|
|
12
|
-
const { lang } =
|
|
12
|
+
const { lang } = useMsemRuntime();
|
|
13
13
|
const { facet } = config;
|
|
14
14
|
const editorLang = lang === "fr" ? "fr" : "en";
|
|
15
15
|
const { channel, resort, msemServicesUrl } = editorOptions;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"widget.d.ts","sourceRoot":"","sources":["../../../../../src/future/components/msem-package/components/widget.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"widget.d.ts","sourceRoot":"","sources":["../../../../../src/future/components/msem-package/components/widget.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,KAAK,KAAK,KAAK,MAAM,UAAU,CAAC;AAIvC,KAAK,KAAK,GAAG;IACX,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC;IACrB,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC;IACtD,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,iBAAiB,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IACnE,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAuBF,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAC7B,KAAK,EACL,MAAM,EACN,MAAM,EACN,IAAI,EACJ,OAAO,EACP,IAAI,EACJ,cAAc,EACd,iBAAiB,EACjB,SAAS,GACV,EAAE,KAAK,2CAmLP"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import classNames from "classnames";
|
|
4
|
-
import {
|
|
4
|
+
import { useMsemRuntime } from "../context";
|
|
5
5
|
import * as Icons from "dt-design-system/es/icons";
|
|
6
|
-
import * as MseM from "../../msem";
|
|
7
6
|
import T from "../i18n/translations";
|
|
8
7
|
import styles from "./widget.module.css";
|
|
9
8
|
const WIDGETS = {
|
|
10
9
|
lodging: "Lodging",
|
|
10
|
+
easyrentRental: "EasyrentRental",
|
|
11
11
|
skiRental: "SkiRental",
|
|
12
12
|
skiPass: "SkiPass",
|
|
13
13
|
liftJb: "LiftJb",
|
|
@@ -28,7 +28,7 @@ const defaultHide = [
|
|
|
28
28
|
export default function Widget({ index, config, widget, step, setStep, stay, completedSteps, setCompletedSteps, packageId, }) {
|
|
29
29
|
const ref = React.useRef(null);
|
|
30
30
|
const widgetContainerRef = React.useRef(null);
|
|
31
|
-
const { lang } =
|
|
31
|
+
const { lang, widgets } = useMsemRuntime();
|
|
32
32
|
const [addedToCart, setAddedToCart] = React.useState(false);
|
|
33
33
|
const { id, widget: kind, image, title, tagline, options, presets, repeatable, optional, maxParticipants, } = widget;
|
|
34
34
|
const [innerStep, setInnerStep] = React.useState(1);
|
|
@@ -80,7 +80,7 @@ export default function Widget({ index, config, widget, step, setStep, stay, com
|
|
|
80
80
|
}
|
|
81
81
|
};
|
|
82
82
|
const widgetId = `id-${id}`;
|
|
83
|
-
const Widget =
|
|
83
|
+
const Widget = widgets[WIDGETS[kind]];
|
|
84
84
|
const tmpHide = options?.hide
|
|
85
85
|
? [...options.hide, ...defaultHide]
|
|
86
86
|
: defaultHide;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"widgets-zones.d.ts","sourceRoot":"","sources":["../../../../../src/future/components/msem-package/components/widgets-zones.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,KAAK,MAAM,UAAU,CAAC;AAIvC,KAAK,KAAK,GAAG;IAAE,MAAM,EAAE,KAAK,CAAC,MAAM,CAAA;CAAE,CAAC;AAEtC,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,EAAE,MAAM,EAAE,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"widgets-zones.d.ts","sourceRoot":"","sources":["../../../../../src/future/components/msem-package/components/widgets-zones.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,KAAK,MAAM,UAAU,CAAC;AAIvC,KAAK,KAAK,GAAG;IAAE,MAAM,EAAE,KAAK,CAAC,MAAM,CAAA;CAAE,CAAC;AAEtC,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,EAAE,MAAM,EAAE,EAAE,KAAK,2CA+BxD"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import * as Icons from "dt-design-system/es/icons";
|
|
4
|
-
import
|
|
4
|
+
import { useMsemRuntime } from "../context";
|
|
5
5
|
import styles from "./widgets-zones.module.css";
|
|
6
6
|
export default function WidgetsSettings({ config }) {
|
|
7
|
+
const { Zone } = useMsemRuntime();
|
|
7
8
|
React.useEffect(() => {
|
|
8
9
|
document
|
|
9
10
|
.querySelectorAll(".msem-package-widget-zone")
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"widgets.d.ts","sourceRoot":"","sources":["../../../../../src/future/components/msem-package/components/widgets.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,KAAK,KAAK,MAAM,UAAU,CAAC;AAKvC,KAAK,KAAK,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC;IAAC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAA;CAAE,CAAC;AAEzE,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"widgets.d.ts","sourceRoot":"","sources":["../../../../../src/future/components/msem-package/components/widgets.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,KAAK,KAAK,MAAM,UAAU,CAAC;AAKvC,KAAK,KAAK,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC;IAAC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAA;CAAE,CAAC;AAEzE,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,KAAK,2CAmJ/D"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { useMsemRuntime } from "../context";
|
|
4
4
|
import Button from "dt-design-system/es/button";
|
|
5
5
|
import Information from "dt-design-system/es/information";
|
|
6
6
|
import * as Icons from "dt-design-system/es/icons";
|
|
@@ -9,8 +9,7 @@ import T from "../i18n/translations";
|
|
|
9
9
|
import * as Api from "../utils/api";
|
|
10
10
|
import styles from "./widgets.module.css";
|
|
11
11
|
export default function Widgets({ cartUrl, config, stay }) {
|
|
12
|
-
const { lang,
|
|
13
|
-
const hasLangPrefix = ubloConfig.langPrefix.links;
|
|
12
|
+
const { lang, langPrefixLinks: hasLangPrefix, esfplusUrl } = useMsemRuntime();
|
|
14
13
|
const { widgets, optionalWidgets, id } = config;
|
|
15
14
|
const [step, setStep] = React.useState(null);
|
|
16
15
|
const [completedSteps, setCompletedSteps] = React.useState([-1]);
|
|
@@ -31,7 +30,7 @@ export default function Widgets({ cartUrl, config, stay }) {
|
|
|
31
30
|
const cartId = window?.sessionStorage.getItem("cartId");
|
|
32
31
|
const { packageId, uncompleted } = currentPackageInfo.current;
|
|
33
32
|
if (uncompleted && cartId && packageId) {
|
|
34
|
-
Api.removePackage(JSON.parse(cartId), packageId);
|
|
33
|
+
Api.removePackage(esfplusUrl, JSON.parse(cartId), packageId);
|
|
35
34
|
}
|
|
36
35
|
};
|
|
37
36
|
window.addEventListener("beforeunload", onUnload);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export type MsemRuntime = {
|
|
3
|
+
cmsMode?: string;
|
|
4
|
+
lang?: string;
|
|
5
|
+
path?: string;
|
|
6
|
+
menuPath?: {
|
|
7
|
+
id?: number | string;
|
|
8
|
+
} | null;
|
|
9
|
+
langPrefixLinks: boolean;
|
|
10
|
+
esfplusUrl: string;
|
|
11
|
+
Zone: React.ComponentType<any>;
|
|
12
|
+
DatePicker: React.ComponentType<any>;
|
|
13
|
+
widgets: Record<string, React.ComponentType<any>>;
|
|
14
|
+
};
|
|
15
|
+
export declare const MsemRuntimeProvider: React.Provider<MsemRuntime>;
|
|
16
|
+
export declare function useMsemRuntime(): MsemRuntime;
|
|
17
|
+
//# sourceMappingURL=context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../../src/future/components/msem-package/context.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,MAAM,WAAW,GAAG;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE;QAAE,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAC3C,eAAe,EAAE,OAAO,CAAC;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;IAC/B,UAAU,EAAE,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;IACrC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC;CACnD,CAAC;AAGF,eAAO,MAAM,mBAAmB,6BAA8B,CAAC;AAE/D,wBAAgB,cAAc,IAAI,WAAW,CAI5C"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
const MsemRuntimeContext = React.createContext(null);
|
|
3
|
+
export const MsemRuntimeProvider = MsemRuntimeContext.Provider;
|
|
4
|
+
export function useMsemRuntime() {
|
|
5
|
+
const ctx = React.useContext(MsemRuntimeContext);
|
|
6
|
+
if (!ctx)
|
|
7
|
+
throw new Error("useMsemRuntime must be used within MseMPackage core");
|
|
8
|
+
return ctx;
|
|
9
|
+
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import type { MsemRuntime } from "./context";
|
|
1
2
|
import type * as Types from "./types";
|
|
2
3
|
export type Props = {
|
|
3
4
|
idPrefix: string;
|
|
4
5
|
editorOptions: Types.EditorOptions;
|
|
5
6
|
cartUrl: string;
|
|
7
|
+
runtime: MsemRuntime;
|
|
6
8
|
};
|
|
7
|
-
export default function MseMPackage({ idPrefix, editorOptions, cartUrl, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
//# sourceMappingURL=
|
|
9
|
+
export default function MseMPackage({ idPrefix, editorOptions, cartUrl, runtime, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
//# sourceMappingURL=core.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../../../src/future/components/msem-package/core.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,KAAK,KAAK,KAAK,MAAM,SAAS,CAAC;AAItC,MAAM,MAAM,KAAK,GAAG;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,KAAK,CAAC,aAAa,CAAC;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,WAAW,CAAC;CACtB,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAClC,QAAQ,EACR,aAAa,EACb,OAAO,EACP,OAAO,GACR,EAAE,KAAK,2CAgCP"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import Config from "./components/config";
|
|
4
|
+
import GlobalSettings from "./components/global-settings";
|
|
5
|
+
import StaySettings from "./components/stay-settings";
|
|
6
|
+
import WidgetsSettings from "./components/widgets-settings";
|
|
7
|
+
import Filters from "./components/filters";
|
|
8
|
+
import Widgets from "./components/widgets";
|
|
9
|
+
import { MsemRuntimeProvider } from "./context";
|
|
10
|
+
import styles from "./msem-package.module.css";
|
|
11
|
+
export default function MseMPackage({ idPrefix, editorOptions, cartUrl, runtime, }) {
|
|
12
|
+
const { cmsMode } = runtime;
|
|
13
|
+
const [stay, setStay] = React.useState();
|
|
14
|
+
const [config, setConfig] = React.useState({});
|
|
15
|
+
const isEditing = cmsMode === "editing";
|
|
16
|
+
return (_jsx(MsemRuntimeProvider, { value: runtime, children: _jsxs("div", { className: styles.container, children: [_jsx(Config, { idPrefix: idPrefix, config: config, setConfig: setConfig }), isEditing && (_jsxs(_Fragment, { children: [_jsx(GlobalSettings, { config: config, setConfig: setConfig }), _jsx(StaySettings, { config: config, setConfig: setConfig }), _jsx(WidgetsSettings, { config: config, setConfig: setConfig, editorOptions: editorOptions })] })), !isEditing && (_jsxs(_Fragment, { children: [_jsx(Filters, { config: config, stay: stay, setStay: setStay }), _jsx(Widgets, { cartUrl: cartUrl, config: config, stay: stay })] }))] }) }));
|
|
17
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { useMsemRuntime } from "../context";
|
|
3
3
|
import ca from "./ca.json";
|
|
4
4
|
import en from "./en.json";
|
|
5
5
|
import es from "./es.json";
|
|
@@ -17,6 +17,6 @@ export function t(lang, key) {
|
|
|
17
17
|
}, translations);
|
|
18
18
|
}
|
|
19
19
|
export default function T({ id }) {
|
|
20
|
-
const { lang } =
|
|
20
|
+
const { lang } = useMsemRuntime();
|
|
21
21
|
return _jsx(_Fragment, { children: t(lang, id) });
|
|
22
22
|
}
|
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type * as Types from "./types";
|
|
2
2
|
export * from "./types";
|
|
3
|
-
export default
|
|
3
|
+
export { default as Core } from "./core";
|
|
4
|
+
export * from "./context";
|
|
5
|
+
export type Props = {
|
|
6
|
+
idPrefix: string;
|
|
7
|
+
editorOptions: Types.EditorOptions;
|
|
8
|
+
cartUrl: string;
|
|
9
|
+
};
|
|
10
|
+
export default function MseMPackage(props: Props): import("react/jsx-runtime").JSX.Element;
|
|
4
11
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/future/components/msem-package/index.
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/future/components/msem-package/index.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,KAAK,KAAK,MAAM,SAAS,CAAC;AAEtC,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,QAAQ,CAAC;AACzC,cAAc,WAAW,CAAC;AAE1B,MAAM,MAAM,KAAK,GAAG;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,KAAK,CAAC,aAAa,CAAC;IACnC,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,KAAK,EAAE,KAAK,2CAe/C"}
|
|
@@ -1,3 +1,26 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useUbloContext } from "ublo/with-ublo";
|
|
3
|
+
import getConfig from "next/config";
|
|
4
|
+
import Zone from "ublo/zone";
|
|
5
|
+
import DatePicker from "../../../common/components/date-picker";
|
|
6
|
+
import * as MseM from "../msem";
|
|
7
|
+
import Core from "./core";
|
|
2
8
|
export * from "./types";
|
|
3
|
-
export default
|
|
9
|
+
export { default as Core } from "./core";
|
|
10
|
+
export * from "./context";
|
|
11
|
+
export default function MseMPackage(props) {
|
|
12
|
+
const { cmsMode, lang, path, menuPath, config } = useUbloContext();
|
|
13
|
+
const { publicRuntimeConfig } = getConfig();
|
|
14
|
+
const runtime = {
|
|
15
|
+
cmsMode,
|
|
16
|
+
lang,
|
|
17
|
+
path,
|
|
18
|
+
menuPath,
|
|
19
|
+
langPrefixLinks: config.langPrefix.links,
|
|
20
|
+
esfplusUrl: publicRuntimeConfig.esfplusUrl,
|
|
21
|
+
Zone,
|
|
22
|
+
DatePicker,
|
|
23
|
+
widgets: MseM,
|
|
24
|
+
};
|
|
25
|
+
return _jsx(Core, { ...props, runtime: runtime });
|
|
26
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const removePackage: (cartId: string, packageId: string) => Promise<any>;
|
|
1
|
+
export declare const removePackage: (esfplusUrl: string, cartId: string, packageId: string) => Promise<any>;
|
|
2
2
|
//# sourceMappingURL=api.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../../../src/future/components/msem-package/utils/api.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../../../src/future/components/msem-package/utils/api.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa,eACZ,MAAM,UACV,MAAM,aACH,MAAM,iBAWlB,CAAC"}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import getConfig from "next/config";
|
|
2
1
|
import { post } from "../../../../common/utils/fetcher";
|
|
3
|
-
const
|
|
4
|
-
const { esfplusUrl } = publicRuntimeConfig;
|
|
5
|
-
export const removePackage = async (cartId, packageId) => {
|
|
2
|
+
export const removePackage = async (esfplusUrl, cartId, packageId) => {
|
|
6
3
|
const endpoint = `${esfplusUrl}/api/esfplus/remove-package`;
|
|
7
4
|
return post(endpoint, { cartId, packageId, preview: false }, undefined, undefined, undefined);
|
|
8
5
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"widget-list-item.d.ts","sourceRoot":"","sources":["../../../../../src/future/components/msem-preset-editor/components/widget-list-item.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAS/B,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAGhD,KAAK,KAAK,GAAG;IACX,IAAI,EAAE,KAAK,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC;IACnC,YAAY,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,SAAS,CAAC,EAAE,KAAK,KAAK,IAAI,CAAC;IACvD,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,mBAAmB,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;CACpE,CAAC;
|
|
1
|
+
{"version":3,"file":"widget-list-item.d.ts","sourceRoot":"","sources":["../../../../../src/future/components/msem-preset-editor/components/widget-list-item.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAS/B,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAGhD,KAAK,KAAK,GAAG;IACX,IAAI,EAAE,KAAK,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC;IACnC,YAAY,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,SAAS,CAAC,EAAE,KAAK,KAAK,IAAI,CAAC;IACvD,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,mBAAmB,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;CACpE,CAAC;AAaF,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,EACrC,IAAI,EACJ,MAAM,EACN,YAAY,EACZ,YAAY,EACZ,mBAAmB,GACpB,EAAE,KAAK,2CAwKP"}
|
|
@@ -15,7 +15,7 @@ export default function WidgetList({ lang, msemServicesUrl, channel, resort, fac
|
|
|
15
15
|
try {
|
|
16
16
|
const offers = (await Offers.get(msemServicesUrl, lang, channel, resort, facet));
|
|
17
17
|
const filteredOffers = offers.filter(({ kind }) => {
|
|
18
|
-
return kind !== "FFS" && kind !== "ASSU";
|
|
18
|
+
return kind !== "FFS" && kind !== "ASSU" && kind !== "DONS";
|
|
19
19
|
});
|
|
20
20
|
setOffers(filteredOffers);
|
|
21
21
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
type Props = {
|
|
3
|
+
lang: "fr" | "en";
|
|
4
|
+
msemServicesUrl: string;
|
|
5
|
+
stay: {
|
|
6
|
+
from: string;
|
|
7
|
+
to: string;
|
|
8
|
+
};
|
|
9
|
+
facet: string;
|
|
10
|
+
preset: Record<string, any> | null;
|
|
11
|
+
setPreset: React.Dispatch<React.SetStateAction<Record<string, any> | null>>;
|
|
12
|
+
setShowPresetDialog: React.Dispatch<React.SetStateAction<boolean>>;
|
|
13
|
+
onChange?: (preset: Record<string, any> | null) => void;
|
|
14
|
+
testPreset: () => void;
|
|
15
|
+
};
|
|
16
|
+
export default function SkiRental({ msemServicesUrl, preset, setPreset, facet, setShowPresetDialog, onChange, testPreset, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=easyrent-rental.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"easyrent-rental.d.ts","sourceRoot":"","sources":["../../../../../src/future/components/msem-preset-editor/editors/easyrent-rental.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAQ/B,KAAK,KAAK,GAAG;IACX,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;IACxB,IAAI,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,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;AA2BF,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAChC,eAAe,EACf,MAAM,EACN,SAAS,EACT,KAAK,EACL,mBAAmB,EACnB,QAAQ,EACR,UAAU,GACX,EAAE,KAAK,2CAgUP"}
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import MultipleSelect from "dt-design-system/es/multiple-select";
|
|
4
|
+
import Select from "dt-design-system/es/select";
|
|
5
|
+
import NumberPicker from "dt-design-system/es/number-picker";
|
|
6
|
+
import Input from "dt-design-system/es/input";
|
|
7
|
+
import Form from "../components/form";
|
|
8
|
+
import * as API from "../services/api";
|
|
9
|
+
const DEFAULT_LISTING_DATA = {
|
|
10
|
+
merchants: [],
|
|
11
|
+
};
|
|
12
|
+
const DEFAULT_DATA = {
|
|
13
|
+
catalog: "",
|
|
14
|
+
duration: 0,
|
|
15
|
+
rentFrom: "",
|
|
16
|
+
activity: "",
|
|
17
|
+
level: "",
|
|
18
|
+
productId: "",
|
|
19
|
+
};
|
|
20
|
+
const activities = [
|
|
21
|
+
{ label: "", value: "" },
|
|
22
|
+
{ label: "Ski", value: "SKI" },
|
|
23
|
+
{ label: "Snow", value: "SNOW" },
|
|
24
|
+
{ label: "Autre", value: "OTHER" },
|
|
25
|
+
];
|
|
26
|
+
const levels = [
|
|
27
|
+
{ label: "", value: "" },
|
|
28
|
+
{ label: "Débutant", value: "DEBUTANT" },
|
|
29
|
+
{ label: "Intermédiaire", value: "INTERMEDIAIRE" },
|
|
30
|
+
{ label: "Confirmé", value: "CONFIRME" },
|
|
31
|
+
];
|
|
32
|
+
export default function SkiRental({ msemServicesUrl, preset, setPreset, facet, setShowPresetDialog, onChange, testPreset, }) {
|
|
33
|
+
const savedPreset = React.useRef(preset);
|
|
34
|
+
const { channel, resort, merchant } = preset?.options;
|
|
35
|
+
const mode = merchant === undefined ? "LISTING" : "MERCHANT";
|
|
36
|
+
const [loading, setLoading] = React.useState(false);
|
|
37
|
+
const [loadingProducts, setLoadingProducts] = React.useState(false);
|
|
38
|
+
const [merchantList, setMerchantList] = React.useState([]);
|
|
39
|
+
const [catalogs, setCatalogs] = React.useState([]);
|
|
40
|
+
const [catalog, setCatalog] = React.useState(preset?.options?.catalog || "");
|
|
41
|
+
const isReady = catalogs !== null;
|
|
42
|
+
const [products, setProducts] = React.useState([]);
|
|
43
|
+
const [merchants, setMerchants] = React.useState(getDefaultData(preset, "LISTING"));
|
|
44
|
+
const [data, setData] = React.useState(getDefaultData(preset, "MERCHANT"));
|
|
45
|
+
const formattedMerchants = merchantList.map(({ name, code }) => {
|
|
46
|
+
return { label: name, value: code };
|
|
47
|
+
});
|
|
48
|
+
const cancelPreset = () => {
|
|
49
|
+
setPreset(savedPreset.current);
|
|
50
|
+
setShowPresetDialog(false);
|
|
51
|
+
};
|
|
52
|
+
const confirmPreset = () => {
|
|
53
|
+
setShowPresetDialog(false);
|
|
54
|
+
};
|
|
55
|
+
const updateMerchants = (newValue) => {
|
|
56
|
+
setMerchants(newValue.map((v) => v.value));
|
|
57
|
+
};
|
|
58
|
+
const updateData = (field) => (newValue) => {
|
|
59
|
+
setData((current = {}) => {
|
|
60
|
+
const newData = {
|
|
61
|
+
...current,
|
|
62
|
+
[field]: newValue,
|
|
63
|
+
};
|
|
64
|
+
return newData;
|
|
65
|
+
});
|
|
66
|
+
};
|
|
67
|
+
React.useEffect(() => {
|
|
68
|
+
const runEffect = async () => {
|
|
69
|
+
try {
|
|
70
|
+
setLoading(true);
|
|
71
|
+
const renters = await API.getEasyRentRenters(msemServicesUrl, channel, resort);
|
|
72
|
+
setMerchantList(renters);
|
|
73
|
+
}
|
|
74
|
+
catch (e) {
|
|
75
|
+
console.error(e);
|
|
76
|
+
}
|
|
77
|
+
finally {
|
|
78
|
+
setLoading(false);
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
runEffect();
|
|
82
|
+
}, []);
|
|
83
|
+
React.useEffect(() => {
|
|
84
|
+
setPreset((current = {}) => {
|
|
85
|
+
let newPreset = current;
|
|
86
|
+
if (mode === "LISTING") {
|
|
87
|
+
const catalog = data.catalog || undefined;
|
|
88
|
+
const duration = data.duration || undefined;
|
|
89
|
+
const rentFrom = data.rentFrom || undefined;
|
|
90
|
+
const activity = data.activity || undefined;
|
|
91
|
+
const level = data.level || undefined;
|
|
92
|
+
newPreset = {
|
|
93
|
+
...current,
|
|
94
|
+
presets: {
|
|
95
|
+
...(current?.presets || {}),
|
|
96
|
+
duration,
|
|
97
|
+
rentFrom,
|
|
98
|
+
activity,
|
|
99
|
+
level,
|
|
100
|
+
merchants,
|
|
101
|
+
},
|
|
102
|
+
options: {
|
|
103
|
+
...(current?.options || {}),
|
|
104
|
+
catalog,
|
|
105
|
+
},
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
if (mode === "MERCHANT") {
|
|
109
|
+
const catalog = data.catalog || undefined;
|
|
110
|
+
const duration = data.duration || undefined;
|
|
111
|
+
const rentFrom = data.rentFrom || undefined;
|
|
112
|
+
const activity = data.activity || undefined;
|
|
113
|
+
const level = data.level || undefined;
|
|
114
|
+
const productId = data.productId ? Number(data.productId) : undefined;
|
|
115
|
+
newPreset = {
|
|
116
|
+
...current,
|
|
117
|
+
presets: {
|
|
118
|
+
...(current?.presets || {}),
|
|
119
|
+
duration,
|
|
120
|
+
rentFrom,
|
|
121
|
+
activity,
|
|
122
|
+
level,
|
|
123
|
+
productId,
|
|
124
|
+
},
|
|
125
|
+
options: {
|
|
126
|
+
...(current?.options || {}),
|
|
127
|
+
catalog,
|
|
128
|
+
},
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
onChange?.(newPreset);
|
|
132
|
+
return newPreset;
|
|
133
|
+
});
|
|
134
|
+
}, [data, merchants, mode, onChange, setPreset]);
|
|
135
|
+
React.useEffect(() => {
|
|
136
|
+
const getMerchantSettings = async () => {
|
|
137
|
+
try {
|
|
138
|
+
setLoading(true);
|
|
139
|
+
const catalogs = await API.getEasyrentRentalCatalogs(msemServicesUrl, merchant);
|
|
140
|
+
const products = await API.getEasyrentRentalProducts(msemServicesUrl, merchant, facet, data.catalog || undefined);
|
|
141
|
+
setCatalogs(catalogs);
|
|
142
|
+
setProducts(products.map((product) => ({
|
|
143
|
+
label: product.label,
|
|
144
|
+
value: product.id,
|
|
145
|
+
})));
|
|
146
|
+
}
|
|
147
|
+
catch (e) {
|
|
148
|
+
console.error(e);
|
|
149
|
+
}
|
|
150
|
+
finally {
|
|
151
|
+
setLoading(false);
|
|
152
|
+
}
|
|
153
|
+
};
|
|
154
|
+
if (mode === "MERCHANT" && merchant !== undefined) {
|
|
155
|
+
getMerchantSettings();
|
|
156
|
+
}
|
|
157
|
+
}, [mode, merchant, msemServicesUrl, facet, data.catalog]);
|
|
158
|
+
React.useEffect(() => {
|
|
159
|
+
const getProducts = async () => {
|
|
160
|
+
try {
|
|
161
|
+
setLoadingProducts(true);
|
|
162
|
+
const products = await API.getEasyrentRentalProducts(msemServicesUrl, merchant, facet, data.catalog || undefined, data.activity || undefined, data.level || undefined);
|
|
163
|
+
setProducts(products.map((product) => ({
|
|
164
|
+
label: product.label,
|
|
165
|
+
value: product.id,
|
|
166
|
+
})));
|
|
167
|
+
}
|
|
168
|
+
catch (e) {
|
|
169
|
+
console.error(e);
|
|
170
|
+
}
|
|
171
|
+
finally {
|
|
172
|
+
setLoadingProducts(false);
|
|
173
|
+
}
|
|
174
|
+
};
|
|
175
|
+
if (mode === "MERCHANT") {
|
|
176
|
+
getProducts();
|
|
177
|
+
}
|
|
178
|
+
}, [
|
|
179
|
+
msemServicesUrl,
|
|
180
|
+
mode,
|
|
181
|
+
merchant,
|
|
182
|
+
facet,
|
|
183
|
+
data.catalog,
|
|
184
|
+
data.activity,
|
|
185
|
+
data.level,
|
|
186
|
+
]);
|
|
187
|
+
React.useEffect(() => {
|
|
188
|
+
const checkProduct = async () => {
|
|
189
|
+
if (data.productId &&
|
|
190
|
+
!products.some((product) => product.value === parseInt(data.productId))) {
|
|
191
|
+
setData((current = {}) => ({
|
|
192
|
+
...current,
|
|
193
|
+
productId: DEFAULT_DATA.productId,
|
|
194
|
+
}));
|
|
195
|
+
}
|
|
196
|
+
};
|
|
197
|
+
if (mode === "MERCHANT") {
|
|
198
|
+
checkProduct();
|
|
199
|
+
}
|
|
200
|
+
}, [mode, products, data.productId]);
|
|
201
|
+
const selectedMerchants = merchants?.map((merchant) => formattedMerchants.find((d) => d.value === merchant));
|
|
202
|
+
const title = mode === "LISTING"
|
|
203
|
+
? "Presets loueurs de matériel"
|
|
204
|
+
: `Presets ${preset?.name}`;
|
|
205
|
+
return (_jsxs(Form, { title: title, width: 420, preset: preset, buttonsActions: {
|
|
206
|
+
testPreset,
|
|
207
|
+
cancelPreset,
|
|
208
|
+
confirmPreset,
|
|
209
|
+
}, children: [mode === "LISTING" && merchantList?.length > 0 && (_jsxs(_Fragment, { children: [_jsx(MultipleSelect, { label: "Liste de marchands", options: formattedMerchants, values: selectedMerchants, onChange: updateMerchants, disabled: loading, withSearch: true }), _jsx(Input, { label: "Catalogue", value: data.catalog || DEFAULT_DATA.catalog, onValueChange: updateData("catalog"), disabled: loading }), _jsx(Input, { type: "date", label: "Date de d\u00E9but", value: data.rentFrom || DEFAULT_DATA.rentFrom, onValueChange: updateData("rentFrom"), disabled: loading }), _jsx(NumberPicker, { label: "Dur\u00E9e", value: data.duration || DEFAULT_DATA.duration, onChange: updateData("duration"), disabled: loading }), _jsx(Select, { label: "Activit\u00E9", value: data.activity || DEFAULT_DATA.activity, options: activities, onValueChange: updateData("activity"), disabled: loading }), _jsx(Select, { label: "Niveau", value: data.level || DEFAULT_DATA.level, options: levels, onValueChange: updateData("level"), disabled: loading })] })), mode === "MERCHANT" && (_jsxs(_Fragment, { children: [_jsx(Select, { label: "Catalogue", value: catalog, options: catalogs ? ["", ...catalogs] : [], onValueChange: (value) => {
|
|
210
|
+
setCatalog(value);
|
|
211
|
+
setData({ ...data, catalog: value });
|
|
212
|
+
}, loading: !isReady }), _jsx(Input, { type: "date", label: "Date de d\u00E9but", value: data.rentFrom || DEFAULT_DATA.rentFrom, onValueChange: updateData("rentFrom"), disabled: loading }), _jsx(NumberPicker, { label: "Dur\u00E9e", value: data.duration || DEFAULT_DATA.duration, onChange: updateData("duration"), disabled: loading }), _jsx(Select, { label: "Activit\u00E9", value: data.activity || DEFAULT_DATA.activity, options: activities, onValueChange: updateData("activity"), disabled: loading }), _jsx(Select, { label: "Niveau", value: data.level || DEFAULT_DATA.level, options: levels, onValueChange: updateData("level"), disabled: loading }), _jsx(Select, { label: "Produit", value: data.productId || DEFAULT_DATA.productId, options: products ? ["", ...products] : [], onValueChange: updateData("productId"), loading: loadingProducts })] }))] }));
|
|
213
|
+
}
|
|
214
|
+
function getDefaultData(preset, mode) {
|
|
215
|
+
if (mode === "LISTING") {
|
|
216
|
+
if (!preset?.presets)
|
|
217
|
+
return DEFAULT_LISTING_DATA.merchants;
|
|
218
|
+
const { merchants } = preset.presets;
|
|
219
|
+
return merchants || DEFAULT_LISTING_DATA.merchants;
|
|
220
|
+
}
|
|
221
|
+
else {
|
|
222
|
+
if (!preset?.presets)
|
|
223
|
+
return DEFAULT_DATA;
|
|
224
|
+
const { catalog } = preset.options;
|
|
225
|
+
const { duration, rentFrom, activity, level, productId } = preset.presets || {};
|
|
226
|
+
return {
|
|
227
|
+
catalog: catalog || DEFAULT_DATA.catalog,
|
|
228
|
+
duration: duration || DEFAULT_DATA.duration,
|
|
229
|
+
rentFrom: rentFrom || DEFAULT_DATA.rentFrom,
|
|
230
|
+
activity: activity || DEFAULT_DATA.activity,
|
|
231
|
+
level: level || DEFAULT_DATA.level,
|
|
232
|
+
productId: productId || DEFAULT_DATA.productId,
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
}
|
|
@@ -5,6 +5,7 @@ import Elloha from "./elloha";
|
|
|
5
5
|
import Vakario from "./vakario";
|
|
6
6
|
import StandardProducts from "./standard-products";
|
|
7
7
|
import SkiRental from "./ski-rental";
|
|
8
|
+
import EasyrentRental from "./easyrent-rental";
|
|
8
9
|
import Esf from "./esf";
|
|
9
10
|
declare const Editor: {
|
|
10
11
|
lodging: typeof Lodgings;
|
|
@@ -14,6 +15,7 @@ declare const Editor: {
|
|
|
14
15
|
vakario: typeof Vakario;
|
|
15
16
|
otherProducts: typeof StandardProducts;
|
|
16
17
|
skiRental: typeof SkiRental;
|
|
18
|
+
easyrentRental: typeof EasyrentRental;
|
|
17
19
|
esf: typeof Esf;
|
|
18
20
|
};
|
|
19
21
|
export default Editor;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/future/components/msem-preset-editor/editors/index.tsx"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,cAAc,CAAC;AACrC,OAAO,WAAW,MAAM,iBAAiB,CAAC;AAC1C,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,gBAAgB,MAAM,qBAAqB,CAAC;AACnD,OAAO,SAAS,MAAM,cAAc,CAAC;AACrC,OAAO,GAAG,MAAM,OAAO,CAAC;AAExB,QAAA,MAAM,MAAM
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/future/components/msem-preset-editor/editors/index.tsx"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,cAAc,CAAC;AACrC,OAAO,WAAW,MAAM,iBAAiB,CAAC;AAC1C,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,gBAAgB,MAAM,qBAAqB,CAAC;AACnD,OAAO,SAAS,MAAM,cAAc,CAAC;AACrC,OAAO,cAAc,MAAM,mBAAmB,CAAC;AAC/C,OAAO,GAAG,MAAM,OAAO,CAAC;AAExB,QAAA,MAAM,MAAM;;;;;;;;;;CAUX,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -5,6 +5,7 @@ import Elloha from "./elloha";
|
|
|
5
5
|
import Vakario from "./vakario";
|
|
6
6
|
import StandardProducts from "./standard-products";
|
|
7
7
|
import SkiRental from "./ski-rental";
|
|
8
|
+
import EasyrentRental from "./easyrent-rental";
|
|
8
9
|
import Esf from "./esf";
|
|
9
10
|
const Editor = {
|
|
10
11
|
lodging: Lodgings,
|
|
@@ -14,6 +15,7 @@ const Editor = {
|
|
|
14
15
|
vakario: Vakario,
|
|
15
16
|
otherProducts: StandardProducts,
|
|
16
17
|
skiRental: SkiRental,
|
|
18
|
+
easyrentRental: EasyrentRental,
|
|
17
19
|
esf: Esf,
|
|
18
20
|
};
|
|
19
21
|
export default Editor;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ski-rental.d.ts","sourceRoot":"","sources":["../../../../../src/future/components/msem-preset-editor/editors/ski-rental.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAQ/B,KAAK,KAAK,GAAG;IACX,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;IACxB,IAAI,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,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;AA2BF,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAChC,eAAe,EACf,MAAM,EACN,SAAS,EACT,KAAK,EACL,mBAAmB,EACnB,QAAQ,EACR,UAAU,GACX,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"ski-rental.d.ts","sourceRoot":"","sources":["../../../../../src/future/components/msem-preset-editor/editors/ski-rental.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAQ/B,KAAK,KAAK,GAAG;IACX,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;IACxB,IAAI,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,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;AA2BF,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAChC,eAAe,EACf,MAAM,EACN,SAAS,EACT,KAAK,EACL,mBAAmB,EACnB,QAAQ,EACR,UAAU,GACX,EAAE,KAAK,2CAiUP"}
|
|
@@ -68,7 +68,7 @@ export default function SkiRental({ msemServicesUrl, preset, setPreset, facet, s
|
|
|
68
68
|
const runEffect = async () => {
|
|
69
69
|
try {
|
|
70
70
|
setLoading(true);
|
|
71
|
-
const renters = await API.
|
|
71
|
+
const renters = await API.getRenters(msemServicesUrl, channel, resort);
|
|
72
72
|
setMerchantList(renters);
|
|
73
73
|
}
|
|
74
74
|
catch (e) {
|
|
@@ -209,7 +209,9 @@ export default function SkiRental({ msemServicesUrl, preset, setPreset, facet, s
|
|
|
209
209
|
}, children: [mode === "LISTING" && merchantList?.length > 0 && (_jsxs(_Fragment, { children: [_jsx(MultipleSelect, { label: "Liste de marchands", options: formattedMerchants, values: selectedMerchants, onChange: updateMerchants, disabled: loading, withSearch: true }), _jsx(Input, { label: "Catalogue", value: data.catalog || DEFAULT_DATA.catalog, onValueChange: updateData("catalog"), disabled: loading }), _jsx(Input, { type: "date", label: "Date de d\u00E9but", value: data.rentFrom || DEFAULT_DATA.rentFrom, onValueChange: updateData("rentFrom"), disabled: loading }), _jsx(NumberPicker, { label: "Dur\u00E9e", value: data.duration || DEFAULT_DATA.duration, onChange: updateData("duration"), disabled: loading }), _jsx(Select, { label: "Activit\u00E9", value: data.activity || DEFAULT_DATA.activity, options: activities, onValueChange: updateData("activity"), disabled: loading }), _jsx(Select, { label: "Niveau", value: data.level || DEFAULT_DATA.level, options: levels, onValueChange: updateData("level"), disabled: loading })] })), mode === "MERCHANT" && (_jsxs(_Fragment, { children: [_jsx(Select, { label: "Catalogue", value: catalog, options: catalogs ? ["", ...catalogs] : [], onValueChange: (value) => {
|
|
210
210
|
setCatalog(value);
|
|
211
211
|
setData({ ...data, catalog: value });
|
|
212
|
-
}, loading: !isReady
|
|
212
|
+
}, loading: !isReady, error: catalogs?.length === 0
|
|
213
|
+
? "Aucun catalogue disponible. La configuration du marchand n'est probablement pas complète."
|
|
214
|
+
: undefined }), _jsx(Input, { type: "date", label: "Date de d\u00E9but", value: data.rentFrom || DEFAULT_DATA.rentFrom, onValueChange: updateData("rentFrom"), disabled: loading }), _jsx(NumberPicker, { label: "Dur\u00E9e", value: data.duration || DEFAULT_DATA.duration, onChange: updateData("duration"), disabled: loading }), _jsx(Select, { label: "Activit\u00E9", value: data.activity || DEFAULT_DATA.activity, options: activities, onValueChange: updateData("activity"), disabled: loading }), _jsx(Select, { label: "Niveau", value: data.level || DEFAULT_DATA.level, options: levels, onValueChange: updateData("level"), disabled: loading }), _jsx(Select, { label: "Produit", value: data.productId || DEFAULT_DATA.productId, options: products ? ["", ...products] : [], onValueChange: updateData("productId"), loading: loadingProducts })] }))] }));
|
|
213
215
|
}
|
|
214
216
|
function getDefaultData(preset, mode) {
|
|
215
217
|
if (mode === "LISTING") {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"msem-preset-editor.d.ts","sourceRoot":"","sources":["../../../../src/future/components/msem-preset-editor/msem-preset-editor.tsx"],"names":[],"mappings":"AAmBA,KAAK,MAAM,GAAG;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,KAAK,KAAK,GAAG;IACX,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC;IAC3C,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,KAAK,IAAI,CAAC;IACxD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,EACvC,IAAI,EACJ,OAAO,EACP,MAAM,EACN,eAAe,EACf,WAAW,EACX,OAAO,EACP,aAAa,EACb,QAAQ,EACR,OAAO,EACP,KAAK,EACL,QAAQ,GACT,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"msem-preset-editor.d.ts","sourceRoot":"","sources":["../../../../src/future/components/msem-preset-editor/msem-preset-editor.tsx"],"names":[],"mappings":"AAmBA,KAAK,MAAM,GAAG;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,KAAK,KAAK,GAAG;IACX,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC;IAC3C,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,KAAK,IAAI,CAAC;IACxD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,EACvC,IAAI,EACJ,OAAO,EACP,MAAM,EACN,eAAe,EACf,WAAW,EACX,OAAO,EACP,aAAa,EACb,QAAQ,EACR,OAAO,EACP,KAAK,EACL,QAAQ,GACT,EAAE,KAAK,2CAwNP"}
|
|
@@ -16,9 +16,7 @@ import * as UrlParams from "./services/url-params";
|
|
|
16
16
|
import * as Preset from "./services/preset";
|
|
17
17
|
import css from "./msem-preset-editor.module.css";
|
|
18
18
|
export default function MseMPresetEditor({ lang, channel, resort, msemServicesUrl, urlOverride, resorts, currentPreset, onChange, showUrl, facet, hideStay, }) {
|
|
19
|
-
const defaultResort = Number(currentPreset
|
|
20
|
-
? currentPreset.options.resort
|
|
21
|
-
: resort || resorts?.[0]?.value);
|
|
19
|
+
const defaultResort = Number(currentPreset ? currentPreset.options.resort : resort || resorts?.[0]?.value);
|
|
22
20
|
const [selectedResort, setSelectedResort] = React.useState(defaultResort);
|
|
23
21
|
const [selectedFacet, setSelectedFacet] = React.useState(facet?.toString() || currentPreset?.options?.facet?.toString() || "");
|
|
24
22
|
const [stay, setStay] = React.useState(currentPreset?.presets?.stay || { from: "", to: "" });
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export declare function getOffers(msemServicesUrl: string, lang: "fr" | "en", channel: string, resort: number | string, facet: string): Promise<any>;
|
|
2
2
|
export declare function getOtherOffers(msemServicesUrl: string, lang: "fr" | "en", channel: string, resort: number | string, facet: string, kind: string): Promise<any>;
|
|
3
|
-
export declare function getRenters(msemServicesUrl: string, channel: string, resort: number | string): Promise<any>;
|
|
3
|
+
export declare function getRenters(msemServicesUrl: string, channel: string, resort: number | string, date?: string): Promise<any>;
|
|
4
|
+
export declare function getEasyRentRenters(msemServicesUrl: string, channel: string, resort: number | string, date?: string): Promise<any>;
|
|
4
5
|
export declare function getSkiPassesCatalogs(msemServicesUrl: string, merchant: string): Promise<any>;
|
|
5
6
|
export declare function getSkiPassesFilters(msemServicesUrl: string, merchant: string, catalog: string): Promise<any>;
|
|
6
7
|
export declare function getLodgings(msemServicesUrl: string, channel: string, resort: string): Promise<any>;
|
|
@@ -12,7 +13,8 @@ export declare function getVakarioAges(msemServicesUrl: string, channel: string,
|
|
|
12
13
|
export declare function getVakarioCategories(msemServicesUrl: string, channel: string, merchant: string, kind: string, age: string, lang: "fr" | "en"): Promise<any>;
|
|
13
14
|
export declare function getVakarioLevels(msemServicesUrl: string, channel: string, merchant: string, kind: string, age: string, category: string, lang: "fr" | "en"): Promise<any>;
|
|
14
15
|
export declare function getOtherProductsCategories(msemServicesUrl: string, facet: string, merchant: string, lang: "fr" | "en"): Promise<any>;
|
|
15
|
-
export declare function
|
|
16
|
+
export declare function getEasyrentRentalCatalogs(msemServicesUrl: string, merchant: string): Promise<any>;
|
|
17
|
+
export declare function getEasyrentRentalProducts(msemServicesUrl: string, merchant: string, facet: string, catalog?: string, activity?: string, level?: string): Promise<any>;
|
|
16
18
|
export declare function getSkiRentalCatalogs(msemServicesUrl: string, merchant: string): Promise<any>;
|
|
17
19
|
export declare function getSkiRentalProducts(msemServicesUrl: string, merchant: string, facet: string, catalog?: string, activity?: string, level?: string): Promise<any>;
|
|
18
20
|
export declare function getEsfKinds(msemServicesUrl: string, channel: string, resort: number, stayFrom: string, stayTo: string, season: string, lang: "fr" | "en"): Promise<any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../../../src/future/components/msem-preset-editor/services/api.ts"],"names":[],"mappings":"AAGA,wBAAgB,SAAS,CACvB,eAAe,EAAE,MAAM,EACvB,IAAI,EAAE,IAAI,GAAG,IAAI,EACjB,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,GAAG,MAAM,EACvB,KAAK,EAAE,MAAM,gBAId;AAWD,wBAAsB,cAAc,CAClC,eAAe,EAAE,MAAM,EACvB,IAAI,EAAE,IAAI,GAAG,IAAI,EACjB,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,GAAG,MAAM,EACvB,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,gBAMb;AAED,wBAAsB,UAAU,CAC9B,eAAe,EAAE,MAAM,EACvB,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../../../src/future/components/msem-preset-editor/services/api.ts"],"names":[],"mappings":"AAGA,wBAAgB,SAAS,CACvB,eAAe,EAAE,MAAM,EACvB,IAAI,EAAE,IAAI,GAAG,IAAI,EACjB,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,GAAG,MAAM,EACvB,KAAK,EAAE,MAAM,gBAId;AAWD,wBAAsB,cAAc,CAClC,eAAe,EAAE,MAAM,EACvB,IAAI,EAAE,IAAI,GAAG,IAAI,EACjB,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,GAAG,MAAM,EACvB,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,gBAMb;AAED,wBAAsB,UAAU,CAC9B,eAAe,EAAE,MAAM,EACvB,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,GAAG,MAAM,EACvB,IAAI,CAAC,EAAE,MAAM,gBAId;AAED,wBAAsB,kBAAkB,CACtC,eAAe,EAAE,MAAM,EACvB,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,GAAG,MAAM,EACvB,IAAI,CAAC,EAAE,MAAM,gBAId;AAED,wBAAsB,oBAAoB,CACxC,eAAe,EAAE,MAAM,EACvB,QAAQ,EAAE,MAAM,gBAIjB;AAED,wBAAsB,mBAAmB,CACvC,eAAe,EAAE,MAAM,EACvB,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,gBAIhB;AAGD,wBAAsB,WAAW,CAC/B,eAAe,EAAE,MAAM,EACvB,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,gBAIf;AAED,wBAAsB,iBAAiB,CACrC,eAAe,EAAE,MAAM,EACvB,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,IAAI,GAAG,IAAI,gBAIlB;AAED,wBAAsB,eAAe,CACnC,eAAe,EAAE,MAAM,EACvB,EAAE,EAAE,MAAM,EACV,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,IAAI,GAAG,IAAI,EACjB,OAAO,UAAQ,gBAIhB;AAED,wBAAsB,eAAe,CACnC,eAAe,EAAE,MAAM,EACvB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,IAAI,GAAG,IAAI,gBAIlB;AAED,wBAAsB,eAAe,CACnC,eAAe,EAAE,MAAM,EACvB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,IAAI,GAAG,IAAI,gBAIlB;AAED,wBAAsB,cAAc,CAClC,eAAe,EAAE,MAAM,EACvB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,IAAI,GAAG,IAAI,gBAIlB;AAED,wBAAsB,oBAAoB,CACxC,eAAe,EAAE,MAAM,EACvB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,IAAI,GAAG,IAAI,gBAIlB;AAED,wBAAsB,gBAAgB,CACpC,eAAe,EAAE,MAAM,EACvB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,IAAI,GAAG,IAAI,gBAIlB;AAED,wBAAsB,0BAA0B,CAC9C,eAAe,EAAE,MAAM,EACvB,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,IAAI,GAAG,IAAI,gBAIlB;AAED,wBAAsB,yBAAyB,CAC7C,eAAe,EAAE,MAAM,EACvB,QAAQ,EAAE,MAAM,gBAIjB;AAED,wBAAsB,yBAAyB,CAC7C,eAAe,EAAE,MAAM,EACvB,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,MAAM,EACb,OAAO,CAAC,EAAE,MAAM,EAChB,QAAQ,CAAC,EAAE,MAAM,EACjB,KAAK,CAAC,EAAE,MAAM,gBAIf;AAED,wBAAsB,oBAAoB,CACxC,eAAe,EAAE,MAAM,EACvB,QAAQ,EAAE,MAAM,gBAIjB;AAED,wBAAsB,oBAAoB,CACxC,eAAe,EAAE,MAAM,EACvB,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,MAAM,EACb,OAAO,CAAC,EAAE,MAAM,EAChB,QAAQ,CAAC,EAAE,MAAM,EACjB,KAAK,CAAC,EAAE,MAAM,gBAIf;AAED,wBAAsB,WAAW,CAC/B,eAAe,EAAE,MAAM,EACvB,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,IAAI,GAAG,IAAI,gBAYlB"}
|
|
@@ -18,9 +18,13 @@ export async function getOtherOffers(msemServicesUrl, lang, channel, resort, fac
|
|
|
18
18
|
const endpoint = `${msemServicesUrl}/api/tunnel/offers/${channel}/${resort}/${kindSlug}`;
|
|
19
19
|
return GET(endpoint, { lang, facet });
|
|
20
20
|
}
|
|
21
|
-
export async function getRenters(msemServicesUrl, channel, resort) {
|
|
21
|
+
export async function getRenters(msemServicesUrl, channel, resort, date) {
|
|
22
22
|
const endpoint = `${msemServicesUrl}/api/gear-rental/${resort}/renters`;
|
|
23
|
-
return POST(endpoint, { channel });
|
|
23
|
+
return POST(endpoint, { channel, date });
|
|
24
|
+
}
|
|
25
|
+
export async function getEasyRentRenters(msemServicesUrl, channel, resort, date) {
|
|
26
|
+
const endpoint = `${msemServicesUrl}/api/easyrent-rental/${resort}/renters`;
|
|
27
|
+
return POST(endpoint, { channel, date });
|
|
24
28
|
}
|
|
25
29
|
export async function getSkiPassesCatalogs(msemServicesUrl, merchant) {
|
|
26
30
|
const endpoint = `${msemServicesUrl}/api/ski-pass-eliberty/${merchant}/catalogs`;
|
|
@@ -66,16 +70,20 @@ export async function getOtherProductsCategories(msemServicesUrl, facet, merchan
|
|
|
66
70
|
const endpoint = `${msemServicesUrl}/api/standard-product/merchant/${merchant}`;
|
|
67
71
|
return POST(endpoint, { facet: Number(facet), lang });
|
|
68
72
|
}
|
|
69
|
-
export async function
|
|
70
|
-
const endpoint = `${msemServicesUrl}/api/
|
|
71
|
-
return POST(endpoint
|
|
73
|
+
export async function getEasyrentRentalCatalogs(msemServicesUrl, merchant) {
|
|
74
|
+
const endpoint = `${msemServicesUrl}/api/easyrent-rental/settings/${merchant}/catalogs`;
|
|
75
|
+
return POST(endpoint);
|
|
76
|
+
}
|
|
77
|
+
export async function getEasyrentRentalProducts(msemServicesUrl, merchant, facet, catalog, activity, level) {
|
|
78
|
+
const endpoint = `${msemServicesUrl}/api/easyrent-rental/settings/${merchant}/products`;
|
|
79
|
+
return POST(endpoint, { facet, catalog, activity, level });
|
|
72
80
|
}
|
|
73
81
|
export async function getSkiRentalCatalogs(msemServicesUrl, merchant) {
|
|
74
|
-
const endpoint = `${msemServicesUrl}/api/
|
|
82
|
+
const endpoint = `${msemServicesUrl}/api/gear-rental/settings/${merchant}/catalogs`;
|
|
75
83
|
return POST(endpoint);
|
|
76
84
|
}
|
|
77
85
|
export async function getSkiRentalProducts(msemServicesUrl, merchant, facet, catalog, activity, level) {
|
|
78
|
-
const endpoint = `${msemServicesUrl}/api/
|
|
86
|
+
const endpoint = `${msemServicesUrl}/api/gear-rental/settings/${merchant}/products`;
|
|
79
87
|
return POST(endpoint, { facet, catalog, activity, level });
|
|
80
88
|
}
|
|
81
89
|
export async function getEsfKinds(msemServicesUrl, channel, resort, stayFrom, stayTo, season, lang) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"offers.d.ts","sourceRoot":"","sources":["../../../../../src/future/components/msem-preset-editor/services/offers.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,KAAK,GAAG;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC7B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC5B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,KAAK,EAAE,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE;QACR,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,wBAAsB,GAAG,CACvB,eAAe,EAAE,MAAM,EACvB,IAAI,EAAE,IAAI,GAAG,IAAI,EACjB,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,GAAG,MAAM,EACvB,KAAK,EAAE,MAAM;;UA3BP,MAAM;cACF,MAAM;WACT,MAAM;UACP,MAAM;UACN,MAAM;aACH,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;YACpB,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;aAClB,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;YACpB,MAAM;
|
|
1
|
+
{"version":3,"file":"offers.d.ts","sourceRoot":"","sources":["../../../../../src/future/components/msem-preset-editor/services/offers.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,KAAK,GAAG;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC7B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC5B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,KAAK,EAAE,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE;QACR,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,wBAAsB,GAAG,CACvB,eAAe,EAAE,MAAM,EACvB,IAAI,EAAE,IAAI,GAAG,IAAI,EACjB,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,GAAG,MAAM,EACvB,KAAK,EAAE,MAAM;;UA3BP,MAAM;cACF,MAAM;WACT,MAAM;UACP,MAAM;UACN,MAAM;aACH,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;YACpB,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;aAClB,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;YACpB,MAAM;MA2Ff"}
|
|
@@ -31,6 +31,19 @@ export async function get(msemServicesUrl, lang, channel, resort, facet) {
|
|
|
31
31
|
}
|
|
32
32
|
return offer;
|
|
33
33
|
}));
|
|
34
|
+
if (channel === "LBM") {
|
|
35
|
+
const easyrentOffers = await API.getEasyRentRenters(msemServicesUrl, channel, resort);
|
|
36
|
+
formattedOffers.push({
|
|
37
|
+
image: "https://widget.msem.tech/images/tunnel/offers/offer_skirental.jpg",
|
|
38
|
+
logo: "https://widget.msem.tech/images/tunnel/offers/logo_skirental.svg",
|
|
39
|
+
name: "Location Easyrent",
|
|
40
|
+
widget: "easyrentRental",
|
|
41
|
+
kind: "SKIRENTAL",
|
|
42
|
+
items: easyrentOffers.map((renter) => {
|
|
43
|
+
return { ...renter, widget: "easyrentRental" };
|
|
44
|
+
}),
|
|
45
|
+
});
|
|
46
|
+
}
|
|
34
47
|
return formattedOffers;
|
|
35
48
|
}
|
|
36
49
|
function mergeSkiPasses(offer) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preset.d.ts","sourceRoot":"","sources":["../../../../../src/future/components/msem-preset-editor/services/preset.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,OAAO,GAAG;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,OAAO,GAAG;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC;IACpC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"preset.d.ts","sourceRoot":"","sources":["../../../../../src/future/components/msem-preset-editor/services/preset.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,OAAO,GAAG;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,OAAO,GAAG;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC;IACpC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,uBA2B/C"}
|
|
@@ -4,9 +4,15 @@ export function format(data) {
|
|
|
4
4
|
if (isLift) {
|
|
5
5
|
return data;
|
|
6
6
|
}
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
const isOtherProductsOrSkiRentalOrEasyrentRental = [
|
|
8
|
+
"otherProducts",
|
|
9
|
+
"skiRental",
|
|
10
|
+
"easyrentRental",
|
|
11
|
+
].includes(widget);
|
|
12
|
+
const merchant = isOtherProductsOrSkiRentalOrEasyrentRental ? slug : code;
|
|
13
|
+
const merchantSlug = isOtherProductsOrSkiRentalOrEasyrentRental
|
|
14
|
+
? slug
|
|
15
|
+
: undefined;
|
|
10
16
|
const categoryGroup = taxonomy?.category;
|
|
11
17
|
const options = {
|
|
12
18
|
merchant,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../../../src/market-place/components/instant-search/services/api.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../../../src/market-place/components/instant-search/services/api.ts"],"names":[],"mappings":"AAOA,wBAAgB,YAAY,CAC1B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,OAAO,GAAE,MAAgE,EACzE,cAAc,CAAC,EAAE,MAAM,gBAaxB;AAED,MAAM,MAAM,kBAAkB,GAAG;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE;QACR,SAAS,EAAE;YACT,GAAG,EAAE,MAAM,CAAC;SACb,EAAE,CAAC;QACJ,aAAa,EAAE;YACb,GAAG,EAAE,MAAM,CAAC;SACb,EAAE,CAAC;KACL,CAAC;CACH,CAAC;AAEF,wBAAsB,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,iCAM/D"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import getConfig from "next/config";
|
|
2
2
|
import { GET, POST } from "../../../../future/utils/fetcher";
|
|
3
3
|
const { publicRuntimeConfig } = getConfig();
|
|
4
|
-
const { searchApi: api, googleSites } = publicRuntimeConfig;
|
|
4
|
+
const { searchApi: api = "https://search.ublo.app/api", googleSites } = publicRuntimeConfig;
|
|
5
5
|
export function fetchResults(site, lang, query, queryBy = "title,text,pageTitle,seoKeywords,parentTitle,seoTitle", queryByWeights) {
|
|
6
6
|
const endpoint = `${api}/ublo-search/search/market-place/v2`;
|
|
7
7
|
return POST(endpoint, {
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"msem-package.d.ts","sourceRoot":"","sources":["../../../../src/future/components/msem-package/msem-package.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,KAAK,KAAK,MAAM,SAAS,CAAC;AAItC,MAAM,MAAM,KAAK,GAAG;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,KAAK,CAAC,aAAa,CAAC;IACnC,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAClC,QAAQ,EACR,aAAa,EACb,OAAO,GACR,EAAE,KAAK,2CA8BP"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
import { useUbloContext } from "ublo/with-ublo";
|
|
4
|
-
import Config from "./components/config";
|
|
5
|
-
import GlobalSettings from "./components/global-settings";
|
|
6
|
-
import StaySettings from "./components/stay-settings";
|
|
7
|
-
import WidgetsSettings from "./components/widgets-settings";
|
|
8
|
-
import Filters from "./components/filters";
|
|
9
|
-
import Widgets from "./components/widgets";
|
|
10
|
-
import styles from "./msem-package.module.css";
|
|
11
|
-
export default function MseMPackage({ idPrefix, editorOptions, cartUrl, }) {
|
|
12
|
-
const { cmsMode } = useUbloContext();
|
|
13
|
-
const [stay, setStay] = React.useState();
|
|
14
|
-
const [config, setConfig] = React.useState({});
|
|
15
|
-
const isEditing = cmsMode === "editing";
|
|
16
|
-
return (_jsxs("div", { className: styles.container, children: [_jsx(Config, { idPrefix: idPrefix, config: config, setConfig: setConfig }), isEditing && (_jsxs(_Fragment, { children: [_jsx(GlobalSettings, { config: config, setConfig: setConfig }), _jsx(StaySettings, { config: config, setConfig: setConfig }), _jsx(WidgetsSettings, { config: config, setConfig: setConfig, editorOptions: editorOptions })] })), !isEditing && (_jsxs(_Fragment, { children: [_jsx(Filters, { config: config, stay: stay, setStay: setStay }), _jsx(Widgets, { cartUrl: cartUrl, config: config, stay: stay })] }))] }));
|
|
17
|
-
}
|