mozrest-sdk-react-dev 0.2.89 → 0.2.90
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/mozrest-sdk.es.js +22 -9
- package/package.json +1 -1
package/mozrest-sdk.es.js
CHANGED
|
@@ -106950,16 +106950,23 @@ const ConfirmationModal = ({ onAccept, isLoading, title: title2, text: text2 = "
|
|
|
106950
106950
|
isLoading
|
|
106951
106951
|
}, t2("ACCEPT")))));
|
|
106952
106952
|
};
|
|
106953
|
+
const ExportResbookReservationAnalytics = async ({ params, venueId }) => {
|
|
106954
|
+
await instance$1.get(
|
|
106955
|
+
`reports/resbook-booking-summary/${venueId}`,
|
|
106956
|
+
{ params }
|
|
106957
|
+
);
|
|
106958
|
+
return { data: "requested" };
|
|
106959
|
+
};
|
|
106953
106960
|
const ExportBookingModal = ({ open, onClose: onClose2, isExportLoading, setIsExportLoading, userEmail, userFullName, currentVenue }) => {
|
|
106954
106961
|
const { t: t2 } = useTranslation();
|
|
106955
106962
|
const [exportFilters, setExportFilters] = useState({
|
|
106956
|
-
["filters[
|
|
106957
|
-
["filters[
|
|
106963
|
+
["filters[fromZ]"]: hooks().format("YYYY-MM-DD"),
|
|
106964
|
+
["filters[tillZ]"]: hooks().format("YYYY-MM-DD")
|
|
106958
106965
|
});
|
|
106959
106966
|
const [openConfirmationModal, setOpenConfirmationModal] = useState(false);
|
|
106960
106967
|
const onOpenConfirmationModal = () => setOpenConfirmationModal(true);
|
|
106961
106968
|
const onCloseConfirmationModal = () => setOpenConfirmationModal(false);
|
|
106962
|
-
const { isExecuting, execute, error: error3 } = useService(
|
|
106969
|
+
const { isExecuting, execute, error: error3 } = useService(ExportResbookReservationAnalytics, {
|
|
106963
106970
|
onSuccess: async () => {
|
|
106964
106971
|
onClose2();
|
|
106965
106972
|
setIsExportLoading(false);
|
|
@@ -106975,8 +106982,8 @@ const ExportBookingModal = ({ open, onClose: onClose2, isExportLoading, setIsExp
|
|
|
106975
106982
|
if (!currentVenue)
|
|
106976
106983
|
return;
|
|
106977
106984
|
execute({
|
|
106985
|
+
venueId: currentVenue,
|
|
106978
106986
|
params: {
|
|
106979
|
-
"filters[venues]": [currentVenue],
|
|
106980
106987
|
...exportFilters,
|
|
106981
106988
|
...userEmail ? {
|
|
106982
106989
|
["filters[userEmail]"]: userEmail
|
|
@@ -106999,13 +107006,13 @@ const ExportBookingModal = ({ open, onClose: onClose2, isExportLoading, setIsExp
|
|
|
106999
107006
|
}, /* @__PURE__ */ React__default.createElement(DatePicker, {
|
|
107000
107007
|
id: "dateRange",
|
|
107001
107008
|
label: t2("BOOKINGCREATIONDATERANGE"),
|
|
107002
|
-
range: { from: exportFilters["filters[
|
|
107009
|
+
range: { from: exportFilters["filters[fromZ]"], till: exportFilters["filters[tillZ]"] },
|
|
107003
107010
|
onChange: ({ from: from2, till }) => {
|
|
107004
107011
|
if (from2 && till) {
|
|
107005
107012
|
setExportFilters({
|
|
107006
107013
|
...exportFilters,
|
|
107007
|
-
["filters[
|
|
107008
|
-
["filters[
|
|
107014
|
+
["filters[fromZ]"]: hooks(from2).format("YYYY-MM-DD"),
|
|
107015
|
+
["filters[tillZ]"]: hooks(till).format("YYYY-MM-DD")
|
|
107009
107016
|
});
|
|
107010
107017
|
}
|
|
107011
107018
|
}
|
|
@@ -107020,7 +107027,7 @@ const ExportBookingModal = ({ open, onClose: onClose2, isExportLoading, setIsExp
|
|
|
107020
107027
|
open: openConfirmationModal,
|
|
107021
107028
|
onClose: onCloseConfirmationModal,
|
|
107022
107029
|
onAccept: () => onRequestExcel(),
|
|
107023
|
-
text: `Do you want to export an excel file from ${exportFilters["filters[
|
|
107030
|
+
text: `Do you want to export an excel file from ${exportFilters["filters[fromZ]"]} until ${exportFilters["filters[tillZ]"]}? You will receive shortly the report on you email inbox.`,
|
|
107024
107031
|
width: 500,
|
|
107025
107032
|
isLoading: isExportLoading || isExecuting,
|
|
107026
107033
|
icon: "calendar"
|
|
@@ -107188,7 +107195,13 @@ const index$c = ({ filters: filters2, setFilters, currentVenue, userEmail, userF
|
|
|
107188
107195
|
setDatePickerOpen(false);
|
|
107189
107196
|
}
|
|
107190
107197
|
}, t2("TOMORROW")))
|
|
107191
|
-
})
|
|
107198
|
+
}), /* @__PURE__ */ React__default.createElement(Button, {
|
|
107199
|
+
mode: "success",
|
|
107200
|
+
onClick: () => setShowExportBookingConfirmationModal(true)
|
|
107201
|
+
}, /* @__PURE__ */ React__default.createElement(Icon, {
|
|
107202
|
+
icon: "download",
|
|
107203
|
+
size: "xs"
|
|
107204
|
+
}))), canEdit && /* @__PURE__ */ React__default.createElement(Button, {
|
|
107192
107205
|
className: styles$l.addReservationButton,
|
|
107193
107206
|
mode: "success",
|
|
107194
107207
|
onClick: () => {
|