ublo-lib 1.47.13 → 1.47.15
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.
|
@@ -13,7 +13,7 @@ const DEFAULT_DATA = {
|
|
|
13
13
|
lodging: "",
|
|
14
14
|
merchants: [],
|
|
15
15
|
options: [],
|
|
16
|
-
|
|
16
|
+
sectors: [],
|
|
17
17
|
nbRooms: [],
|
|
18
18
|
roomType: "",
|
|
19
19
|
type: "",
|
|
@@ -60,7 +60,7 @@ export default function Lodgings({ lang, msemServicesUrl, preset, setPreset, set
|
|
|
60
60
|
const [lodgings, setLodgings] = React.useState([]);
|
|
61
61
|
const [filters, setFilters] = React.useState({
|
|
62
62
|
options: [],
|
|
63
|
-
|
|
63
|
+
sectors: [],
|
|
64
64
|
});
|
|
65
65
|
const [rooms, setRooms] = React.useState([]);
|
|
66
66
|
const [loading, setLoading] = React.useState(true);
|
|
@@ -92,7 +92,7 @@ export default function Lodgings({ lang, msemServicesUrl, preset, setPreset, set
|
|
|
92
92
|
}));
|
|
93
93
|
const selectedMerchants = data.merchants?.map((merchant) => formattedMerchants.find((d) => d.value === merchant));
|
|
94
94
|
const selectedOptions = data.options?.map((option) => filters?.options?.find((d) => d.value === option));
|
|
95
|
-
const
|
|
95
|
+
const selectedSectors = data.sectors?.map((sector) => filters?.sectors?.find((d) => d.value === sector));
|
|
96
96
|
const selectedMeubleTypes = data.meubleType?.map((meubleType) => MEUBLE_TYPES.find((d) => d.value === meubleType));
|
|
97
97
|
const cancelPreset = () => {
|
|
98
98
|
setPreset(savedPreset.current);
|
|
@@ -111,7 +111,7 @@ export default function Lodgings({ lang, msemServicesUrl, preset, setPreset, set
|
|
|
111
111
|
if (key === "accomodations")
|
|
112
112
|
return acc;
|
|
113
113
|
const filter = filters[key];
|
|
114
|
-
if (key === "
|
|
114
|
+
if (key === "sectors") {
|
|
115
115
|
const entries = filter.map((entry) => ({
|
|
116
116
|
value: entry.id,
|
|
117
117
|
label: entry.name,
|
|
@@ -155,7 +155,7 @@ export default function Lodgings({ lang, msemServicesUrl, preset, setPreset, set
|
|
|
155
155
|
setData((data) => ({
|
|
156
156
|
...data,
|
|
157
157
|
options: DEFAULT_DATA.options,
|
|
158
|
-
|
|
158
|
+
sectors: DEFAULT_DATA.sectors,
|
|
159
159
|
type: DEFAULT_DATA.type,
|
|
160
160
|
meubleType: DEFAULT_DATA.meubleType,
|
|
161
161
|
}));
|
|
@@ -179,7 +179,7 @@ export default function Lodgings({ lang, msemServicesUrl, preset, setPreset, set
|
|
|
179
179
|
const paxPlan = adults ? { adults, children, agesChildren } : undefined;
|
|
180
180
|
const merchants = data.merchants?.length ? data.merchants : undefined;
|
|
181
181
|
const options = data.options?.length ? data.options : undefined;
|
|
182
|
-
const
|
|
182
|
+
const sectors = data.sectors?.length ? data.sectors : undefined;
|
|
183
183
|
const type = data.type || undefined;
|
|
184
184
|
const meubleType = data.meubleType?.length
|
|
185
185
|
? data.meubleType.join(",")
|
|
@@ -192,7 +192,7 @@ export default function Lodgings({ lang, msemServicesUrl, preset, setPreset, set
|
|
|
192
192
|
merchants,
|
|
193
193
|
accomodation,
|
|
194
194
|
options,
|
|
195
|
-
|
|
195
|
+
sectors,
|
|
196
196
|
nbRooms,
|
|
197
197
|
type,
|
|
198
198
|
meubleType,
|
|
@@ -208,12 +208,12 @@ export default function Lodgings({ lang, msemServicesUrl, preset, setPreset, set
|
|
|
208
208
|
return newPreset;
|
|
209
209
|
});
|
|
210
210
|
}, [data, onChange, urlOverride, setPreset]);
|
|
211
|
-
return (_jsxs(Form, { title: "Presets h\u00E9bergements", width: 580, preset: preset, buttonsActions: { testPreset, cancelPreset, confirmPreset }, children: [_jsx("div", { className: css.label, children: "Nombre de personnes" }), _jsxs("div", { className: css.row, children: [_jsx(NumberPicker, { className: css.peopleInput, label: "Adultes", min: 0, max: 20, value: data.adults, onChange: updateField("adults"), withInput: true }), _jsx(NumberPicker, { className: css.peopleInput, label: "Enfants", min: 0, max: 9, value: data.children, onChange: updateField("children"), withInput: true })] }), _jsx("div", { className: css.label, children: "H\u00E9bergement" }), _jsx(Select, { placeholder: "S\u00E9lectionnez un h\u00E9bergement", options: formattedLodgings, value: data.lodging, onValueChange: updateField("lodging"), loading: loading }), !showFilters && (_jsxs(_Fragment, { children: [_jsx("div", { className: css.label, children: "Chambres" }), (formattedRooms?.length > 0 || loading) && (_jsx(Select, { label: "Type de bien", placeholder: "S\u00E9lectionnez un type de bien", value: data.roomType, options: formattedRooms, onValueChange: updateField("roomType"), loading: loading })), _jsx(NumberPicker, { label: "Nombre de chambres", min: 0, max: 20, value: data.nbRooms?.[0] || 0, onChange: updateRoomNb, withInput: true })] })), showFilters && (_jsxs(_Fragment, { children: [_jsx("div", { className: css.label, children: "Filtres" }), lodgings?.length > 0 && (_jsx(MultipleSelect, { label: "Liste de marchands", options: formattedMerchants, values: selectedMerchants, onChange: updateFilter("merchants"), loading: loading, withSearch: true })), (loading || kinds.length > 1) && (_jsx(Select, { label: "Type", placeholder: "S\u00E9lectionnez un type", options: kinds, value: data.type, onValueChange: updateField("type"), loading: loading })), showMeubleType && (_jsx(MultipleSelect, { placeholder: "Selectionnez une ou plusieurs options", label: "Type de meubl\u00E9", options: MEUBLE_TYPES, values: selectedMeubleTypes, onChange: updateFilter("meubleType"), loading: loading })), (loading || filters.options.length >= 1) && (_jsx(MultipleSelect, { placeholder: "Selectionnez une ou plusieurs options", label: "Options", options: filters.options, values: selectedOptions, onChange: updateFilter("options"), loading: loading, withSearch: true })), (loading || filters.
|
|
211
|
+
return (_jsxs(Form, { title: "Presets h\u00E9bergements", width: 580, preset: preset, buttonsActions: { testPreset, cancelPreset, confirmPreset }, children: [_jsx("div", { className: css.label, children: "Nombre de personnes" }), _jsxs("div", { className: css.row, children: [_jsx(NumberPicker, { className: css.peopleInput, label: "Adultes", min: 0, max: 20, value: data.adults, onChange: updateField("adults"), withInput: true }), _jsx(NumberPicker, { className: css.peopleInput, label: "Enfants", min: 0, max: 9, value: data.children, onChange: updateField("children"), withInput: true })] }), _jsx("div", { className: css.label, children: "H\u00E9bergement" }), _jsx(Select, { placeholder: "S\u00E9lectionnez un h\u00E9bergement", options: formattedLodgings, value: data.lodging, onValueChange: updateField("lodging"), loading: loading }), !showFilters && (_jsxs(_Fragment, { children: [_jsx("div", { className: css.label, children: "Chambres" }), (formattedRooms?.length > 0 || loading) && (_jsx(Select, { label: "Type de bien", placeholder: "S\u00E9lectionnez un type de bien", value: data.roomType, options: formattedRooms, onValueChange: updateField("roomType"), loading: loading })), _jsx(NumberPicker, { label: "Nombre de chambres", min: 0, max: 20, value: data.nbRooms?.[0] || 0, onChange: updateRoomNb, withInput: true })] })), showFilters && (_jsxs(_Fragment, { children: [_jsx("div", { className: css.label, children: "Filtres" }), lodgings?.length > 0 && (_jsx(MultipleSelect, { label: "Liste de marchands", options: formattedMerchants, values: selectedMerchants, onChange: updateFilter("merchants"), loading: loading, withSearch: true })), (loading || kinds.length > 1) && (_jsx(Select, { label: "Type", placeholder: "S\u00E9lectionnez un type", options: kinds, value: data.type, onValueChange: updateField("type"), loading: loading })), showMeubleType && (_jsx(MultipleSelect, { placeholder: "Selectionnez une ou plusieurs options", label: "Type de meubl\u00E9", options: MEUBLE_TYPES, values: selectedMeubleTypes, onChange: updateFilter("meubleType"), loading: loading })), (loading || filters.options.length >= 1) && (_jsx(MultipleSelect, { placeholder: "Selectionnez une ou plusieurs options", label: "Options", options: filters.options, values: selectedOptions, onChange: updateFilter("options"), loading: loading, withSearch: true })), (loading || filters.sectors.length >= 1) && (_jsx(MultipleSelect, { placeholder: "Selectionnez une ou plusieurs options", label: "Quartiers", options: filters.sectors, values: selectedSectors, onChange: updateFilter("sectors"), loading: loading, withSearch: true })), _jsx("div", { className: css.label, children: "Avanc\u00E9" }), _jsx(Input, { className: css.input, label: "Filtre", value: data.filter, placeholder: "('10', '22') in options", onValueChange: updateField("filter") })] }))] }));
|
|
212
212
|
}
|
|
213
213
|
function getDefaultData(preset) {
|
|
214
214
|
if (!preset?.presets && !preset?.options)
|
|
215
215
|
return DEFAULT_DATA;
|
|
216
|
-
const { merchants, accomodation, nbRooms, options,
|
|
216
|
+
const { merchants, accomodation, nbRooms, options, sectors, type, meubleType, filter, } = preset?.presets || {};
|
|
217
217
|
const { paxPlan, roomType } = preset?.options?.previewDetails || {};
|
|
218
218
|
return {
|
|
219
219
|
adults: paxPlan?.adults || DEFAULT_DATA.adults,
|
|
@@ -223,7 +223,7 @@ function getDefaultData(preset) {
|
|
|
223
223
|
nbRooms: nbRooms || DEFAULT_DATA.nbRooms,
|
|
224
224
|
roomType: roomType || DEFAULT_DATA.roomType,
|
|
225
225
|
options: options || DEFAULT_DATA.options,
|
|
226
|
-
|
|
226
|
+
sectors: sectors || DEFAULT_DATA.sectors,
|
|
227
227
|
type: type || DEFAULT_DATA.type,
|
|
228
228
|
meubleType: meubleType?.split(",") || DEFAULT_DATA.meubleType,
|
|
229
229
|
filter: filter || DEFAULT_DATA.filter,
|
|
@@ -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;AAO/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;AAeF,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAChC,eAAe,EACf,MAAM,EACN,SAAS,EAET,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;AAO/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;AAeF,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAChC,eAAe,EACf,MAAM,EACN,SAAS,EAET,mBAAmB,EACnB,QAAQ,EACR,UAAU,GACX,EAAE,KAAK,2CA6KP"}
|
|
@@ -80,7 +80,7 @@ export default function SkiRental({ msemServicesUrl, preset, setPreset, setShowP
|
|
|
80
80
|
const rentFrom = data.rentFrom || undefined;
|
|
81
81
|
const activity = data.activity || undefined;
|
|
82
82
|
const level = data.level || undefined;
|
|
83
|
-
const productId = data.productId
|
|
83
|
+
const productId = data.productId ? Number(data.productId) : undefined;
|
|
84
84
|
newPreset = {
|
|
85
85
|
...current,
|
|
86
86
|
presets: {
|
|
@@ -102,7 +102,10 @@ export default function SkiRental({ msemServicesUrl, preset, setPreset, setShowP
|
|
|
102
102
|
});
|
|
103
103
|
}, [data, merchants, mode, onChange, setPreset]);
|
|
104
104
|
const selectedMerchants = merchants?.map((merchant) => formattedMerchants.find((d) => d.value === merchant));
|
|
105
|
-
|
|
105
|
+
const title = mode === "LISTING"
|
|
106
|
+
? "Presets loueurs de matériel"
|
|
107
|
+
: "Presets loueur de matériel";
|
|
108
|
+
return (_jsxs(Form, { title: title, width: 420, preset: preset, buttonsActions: {
|
|
106
109
|
testPreset,
|
|
107
110
|
cancelPreset,
|
|
108
111
|
confirmPreset,
|