mozrest-sdk-react-dev 0.2.83 → 0.2.84
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 +370 -176
- package/package.json +1 -1
- package/style.css +1 -1
package/mozrest-sdk.es.js
CHANGED
|
@@ -39583,10 +39583,12 @@ const Card = ({
|
|
|
39583
39583
|
header: header2,
|
|
39584
39584
|
children,
|
|
39585
39585
|
className,
|
|
39586
|
-
classNameContent
|
|
39586
|
+
classNameContent,
|
|
39587
|
+
style: style2
|
|
39587
39588
|
}) => {
|
|
39588
39589
|
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement("div", {
|
|
39589
|
-
className: classNames$2(styles$1Y.container, className, "mz-card")
|
|
39590
|
+
className: classNames$2(styles$1Y.container, className, "mz-card"),
|
|
39591
|
+
style: style2
|
|
39590
39592
|
}, /* @__PURE__ */ React__default.createElement(Header$5, {
|
|
39591
39593
|
header: header2
|
|
39592
39594
|
}), /* @__PURE__ */ React__default.createElement("div", {
|
|
@@ -96304,7 +96306,6 @@ const Venues = () => {
|
|
|
96304
96306
|
const [page, updatePage] = useState(1);
|
|
96305
96307
|
const [search2, setSearch] = useState("");
|
|
96306
96308
|
const navigate = useNavigate();
|
|
96307
|
-
console.log("enter here");
|
|
96308
96309
|
const { data: data2, isLoading, error: error3, isValidating, reload } = useFetch(
|
|
96309
96310
|
GetVenuesSummary,
|
|
96310
96311
|
{
|
|
@@ -103093,56 +103094,61 @@ const ReservationsAnalytics = ({ userEmail, userFullName }) => {
|
|
|
103093
103094
|
totalDays
|
|
103094
103095
|
}));
|
|
103095
103096
|
};
|
|
103096
|
-
const mainConatiner$2 = "
|
|
103097
|
-
const mainTableContainer = "
|
|
103098
|
-
const mainSidebarContainer = "
|
|
103099
|
-
const sidebarCloseIcon = "
|
|
103100
|
-
const headerContainer = "
|
|
103101
|
-
const searchContainer = "
|
|
103102
|
-
const buttonList = "
|
|
103103
|
-
const buttonItem = "
|
|
103104
|
-
const
|
|
103105
|
-
const
|
|
103106
|
-
const
|
|
103107
|
-
const
|
|
103108
|
-
const
|
|
103109
|
-
const
|
|
103110
|
-
const
|
|
103111
|
-
const
|
|
103112
|
-
const
|
|
103113
|
-
const
|
|
103114
|
-
const
|
|
103115
|
-
const
|
|
103116
|
-
const
|
|
103117
|
-
const
|
|
103118
|
-
const
|
|
103119
|
-
const
|
|
103120
|
-
const
|
|
103121
|
-
const
|
|
103122
|
-
const
|
|
103123
|
-
const
|
|
103124
|
-
const
|
|
103125
|
-
const
|
|
103126
|
-
const
|
|
103127
|
-
const
|
|
103128
|
-
const
|
|
103097
|
+
const mainConatiner$2 = "_mainConatiner_1mwxr_48";
|
|
103098
|
+
const mainTableContainer = "_mainTableContainer_1mwxr_58";
|
|
103099
|
+
const mainSidebarContainer = "_mainSidebarContainer_1mwxr_66";
|
|
103100
|
+
const sidebarCloseIcon = "_sidebarCloseIcon_1mwxr_76";
|
|
103101
|
+
const headerContainer = "_headerContainer_1mwxr_128";
|
|
103102
|
+
const searchContainer = "_searchContainer_1mwxr_134";
|
|
103103
|
+
const buttonList = "_buttonList_1mwxr_142";
|
|
103104
|
+
const buttonItem = "_buttonItem_1mwxr_147";
|
|
103105
|
+
const addReservationButton = "_addReservationButton_1mwxr_156";
|
|
103106
|
+
const tableTopHeader = "_tableTopHeader_1mwxr_165";
|
|
103107
|
+
const tableTopHeaderContent = "_tableTopHeaderContent_1mwxr_179";
|
|
103108
|
+
const tableTopHeaderContentText = "_tableTopHeaderContentText_1mwxr_186";
|
|
103109
|
+
const tableRowContainer = "_tableRowContainer_1mwxr_195";
|
|
103110
|
+
const tableRowCard = "_tableRowCard_1mwxr_201";
|
|
103111
|
+
const fadeInX = "_fadeInX_1mwxr_1";
|
|
103112
|
+
const noData = "_noData_1mwxr_209";
|
|
103113
|
+
const tableRowHour = "_tableRowHour_1mwxr_216";
|
|
103114
|
+
const tableRowHourText = "_tableRowHourText_1mwxr_232";
|
|
103115
|
+
const hours = "_hours_1mwxr_240";
|
|
103116
|
+
const tableRowContent = "_tableRowContent_1mwxr_246";
|
|
103117
|
+
const rowImage = "_rowImage_1mwxr_261";
|
|
103118
|
+
const rowContactContainer = "_rowContactContainer_1mwxr_275";
|
|
103119
|
+
const rowContactText = "_rowContactText_1mwxr_287";
|
|
103120
|
+
const rowContactPhone = "_rowContactPhone_1mwxr_293";
|
|
103121
|
+
const rowSectionContainer = "_rowSectionContainer_1mwxr_300";
|
|
103122
|
+
const rowSection = "_rowSection_1mwxr_300";
|
|
103123
|
+
const rowSectionText = "_rowSectionText_1mwxr_313";
|
|
103124
|
+
const rowSectionSecText = "_rowSectionSecText_1mwxr_319";
|
|
103125
|
+
const rowActionButton = "_rowActionButton_1mwxr_326";
|
|
103126
|
+
const bookingInfoContainer = "_bookingInfoContainer_1mwxr_338";
|
|
103127
|
+
const bookingInfoCardRow = "_bookingInfoCardRow_1mwxr_342";
|
|
103128
|
+
const bookingInfoCardContainer = "_bookingInfoCardContainer_1mwxr_350";
|
|
103129
|
+
const bookingInfoCard = "_bookingInfoCard_1mwxr_342";
|
|
103130
|
+
const bookingInfoCardContent = "_bookingInfoCardContent_1mwxr_362";
|
|
103131
|
+
const bookingInfoCardTitle = "_bookingInfoCardTitle_1mwxr_368";
|
|
103132
|
+
const bookingInfoCardText = "_bookingInfoCardText_1mwxr_371";
|
|
103129
103133
|
var styles$l = {
|
|
103130
103134
|
mainConatiner: mainConatiner$2,
|
|
103131
103135
|
mainTableContainer,
|
|
103132
103136
|
mainSidebarContainer,
|
|
103133
103137
|
sidebarCloseIcon,
|
|
103134
|
-
"mainSidebarContainer--open": "_mainSidebarContainer--
|
|
103135
|
-
"mainSidebarContainer--close": "_mainSidebarContainer--
|
|
103136
|
-
"sidebarCloseIcon--show": "_sidebarCloseIcon--
|
|
103138
|
+
"mainSidebarContainer--open": "_mainSidebarContainer--open_1mwxr_84",
|
|
103139
|
+
"mainSidebarContainer--close": "_mainSidebarContainer--close_1mwxr_90",
|
|
103140
|
+
"sidebarCloseIcon--show": "_sidebarCloseIcon--show_1mwxr_98",
|
|
103137
103141
|
headerContainer,
|
|
103138
103142
|
searchContainer,
|
|
103139
103143
|
buttonList,
|
|
103140
103144
|
buttonItem,
|
|
103145
|
+
addReservationButton,
|
|
103141
103146
|
tableTopHeader,
|
|
103142
103147
|
tableTopHeaderContent,
|
|
103143
103148
|
tableTopHeaderContentText,
|
|
103144
103149
|
tableRowContainer,
|
|
103145
103150
|
tableRowCard,
|
|
103151
|
+
fadeInX,
|
|
103146
103152
|
noData,
|
|
103147
103153
|
tableRowHour,
|
|
103148
103154
|
tableRowHourText,
|
|
@@ -103153,6 +103159,7 @@ var styles$l = {
|
|
|
103153
103159
|
rowContactText,
|
|
103154
103160
|
rowContactPhone,
|
|
103155
103161
|
rowSectionContainer,
|
|
103162
|
+
rowSection,
|
|
103156
103163
|
rowSectionText,
|
|
103157
103164
|
rowSectionSecText,
|
|
103158
103165
|
rowActionButton,
|
|
@@ -104679,14 +104686,14 @@ var icons = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty(
|
|
|
104679
104686
|
people,
|
|
104680
104687
|
clock
|
|
104681
104688
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
104682
|
-
const icon$2 = "
|
|
104689
|
+
const icon$2 = "_icon_lm3br_1";
|
|
104683
104690
|
var styles$k = {
|
|
104684
104691
|
icon: icon$2,
|
|
104685
|
-
"icon--xs": "_icon--
|
|
104686
|
-
"icon--small": "_icon--
|
|
104687
|
-
"icon--medium": "_icon--
|
|
104688
|
-
"icon--large": "_icon--
|
|
104689
|
-
"icon--xl": "_icon--
|
|
104692
|
+
"icon--xs": "_icon--xs_lm3br_12",
|
|
104693
|
+
"icon--small": "_icon--small_lm3br_15",
|
|
104694
|
+
"icon--medium": "_icon--medium_lm3br_18",
|
|
104695
|
+
"icon--large": "_icon--large_lm3br_21",
|
|
104696
|
+
"icon--xl": "_icon--xl_lm3br_24"
|
|
104690
104697
|
};
|
|
104691
104698
|
const Icon = ({
|
|
104692
104699
|
size = "medium",
|
|
@@ -106853,9 +106860,17 @@ const useSelectedBookingContext = () => {
|
|
|
106853
106860
|
return useContext(SelectedBookingContext);
|
|
106854
106861
|
};
|
|
106855
106862
|
const SelectedBookingProvider = ({ children }) => {
|
|
106863
|
+
var _a2;
|
|
106856
106864
|
const [selectedBooking, setSelectedBooking] = useState(null);
|
|
106865
|
+
const [canEdit, setCanEdit] = useState(false);
|
|
106866
|
+
const roles = (_a2 = userData == null ? void 0 : userData.roles) != null ? _a2 : [];
|
|
106867
|
+
useEffect(() => {
|
|
106868
|
+
if (!roles.includes("COMPANY_USER")) {
|
|
106869
|
+
setCanEdit(true);
|
|
106870
|
+
}
|
|
106871
|
+
}, [roles]);
|
|
106857
106872
|
return /* @__PURE__ */ React__default.createElement(SelectedBookingContext.Provider, {
|
|
106858
|
-
value: { selectedBooking, setSelectedBooking }
|
|
106873
|
+
value: { selectedBooking, setSelectedBooking, canEdit }
|
|
106859
106874
|
}, children);
|
|
106860
106875
|
};
|
|
106861
106876
|
const debounce = (func, delay) => {
|
|
@@ -106875,10 +106890,137 @@ const ShowSidebarProvider = ({ children }) => {
|
|
|
106875
106890
|
value: { showSidebar, setShowSidebar }
|
|
106876
106891
|
}, children);
|
|
106877
106892
|
};
|
|
106878
|
-
|
|
106893
|
+
var styles$d = /* @__PURE__ */ (() => ".resbook-modal .ant-modal-centered .ant-modal{border:0;border-radius:6px;background-color:#2f3349}.resbook-modal .ant-modal-content{background-color:transparent;border-radius:6px}.resbook-modal .ant-modal-header,.resbook-modal .ant-modal-body{background-color:#2f3349!important;color:#fff}.resbook-modal .ant-modal-header{border-bottom:0;border-radius:6px 6px 0 0;padding-bottom:0}.resbook-modal .ant-modal-body{border-radius:0 0 6px 6px;padding-top:0}.resbook-modal .ant-modal-header h1,.resbook-modal .ant-modal-header p,.resbook-modal .ant-modal-body h1,.resbook-modal .ant-modal-body h2,.resbook-modal .ant-modal-body h3,.resbook-modal .ant-modal-body h4,.resbook-modal .ant-modal-body p{font-family:Public Sans,sans-serif}.resbook-modal .ant-modal-header p,.resbook-modal .ant-modal-body p{font-size:15px;color:#acabc1}.resbook-modal .ant-modal-header p{margin-bottom:0;margin-top:0}.resbook-modal .ant-modal-header h1,.resbook-modal .ant-modal-body h1{font-weight:600;color:#cfcde4;font-size:18px}.resbook-modal .ant-modal-body label{font-size:15px;color:#acabc1}.resbook-modal .ant-modal-body h2{color:#fff}.resbook-modal .ant-modal-body [class*=regularHourContainer]{color:#d0cee5;box-shadow:none;font-family:var(--font-family)}.resbook-modal .ant-modal-body [class*=regularHourContainer] strong{font-weight:300;font-size:15px}.resbook-modal .mz-header input,.resbook-modal .ant-modal-body input,.resbook-modal .ant-modal-body textarea{background-color:#3a3d54;color:#d0cee5;border-width:0 0 1px;border-color:#d0cee5;border-radius:0;padding:10px 5px}.resbook-modal .mz-header .css-spersy-control,.resbook-modal .ant-modal-body .css-spersy-control{background-color:#3a3d54;border-width:0 0 1px;border-radius:0}.resbook-modal .css-spersy-control>div>div:first-child{color:#d0cee5!important;font-family:Public Sans,sans-serif;padding:7px 0}.resbook-modal .ant-modal-body #react-select-4-listbox{background-color:#3a3d54;font-family:var(--font-family)}.resbook-modal .ant-modal-title,.resbook-modal .ant-modal-body span{color:#fff}.resbook-modal .ant-modal-close-x line{stroke:#fff}\n")();
|
|
106894
|
+
const Modal2 = ({
|
|
106895
|
+
open,
|
|
106896
|
+
children,
|
|
106897
|
+
onClose: onClose2,
|
|
106898
|
+
title: title2,
|
|
106899
|
+
width
|
|
106900
|
+
}) => {
|
|
106901
|
+
return /* @__PURE__ */ React__default.createElement(ModalAntd, {
|
|
106902
|
+
className: "resbook-modal",
|
|
106903
|
+
title: /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, typeof title2 === "string" && /* @__PURE__ */ React__default.createElement(Heading, null, title2), typeof title2 !== "string" && !!title2 ? title2 : /* @__PURE__ */ React__default.createElement("div", null)),
|
|
106904
|
+
open,
|
|
106905
|
+
onCancel: onClose2,
|
|
106906
|
+
width: width || 1e3,
|
|
106907
|
+
footer: null,
|
|
106908
|
+
closeIcon: /* @__PURE__ */ React__default.createElement(Icon, {
|
|
106909
|
+
icon: "close",
|
|
106910
|
+
size: "small"
|
|
106911
|
+
}),
|
|
106912
|
+
centered: true,
|
|
106913
|
+
zIndex: 1032
|
|
106914
|
+
}, children);
|
|
106915
|
+
};
|
|
106916
|
+
const ConfirmationModal = ({ onAccept, isLoading, title: title2, text: text2 = "AREYOUSURE?", icon: icon2, ...props }) => {
|
|
106917
|
+
const { t: t2 } = useTranslation();
|
|
106918
|
+
return /* @__PURE__ */ React__default.createElement(Modal2, {
|
|
106919
|
+
...props,
|
|
106920
|
+
title: title2,
|
|
106921
|
+
width: 500
|
|
106922
|
+
}, icon2 && /* @__PURE__ */ React__default.createElement("div", {
|
|
106923
|
+
style: { display: "flex", justifyContent: "center" }
|
|
106924
|
+
}, /* @__PURE__ */ React__default.createElement(Icon, {
|
|
106925
|
+
icon: icon2,
|
|
106926
|
+
size: "large"
|
|
106927
|
+
})), /* @__PURE__ */ React__default.createElement("h3", {
|
|
106928
|
+
style: { marginTop: 0, paddingTop: 20 }
|
|
106929
|
+
}, t2(text2)), /* @__PURE__ */ React__default.createElement("div", null, /* @__PURE__ */ React__default.createElement("div", {
|
|
106930
|
+
style: { display: "flex", justifyContent: "center", gap: 20, marginTop: 20 }
|
|
106931
|
+
}, /* @__PURE__ */ React__default.createElement(Button, {
|
|
106932
|
+
size: "small",
|
|
106933
|
+
mode: "tertiary",
|
|
106934
|
+
onClick: props.onClose,
|
|
106935
|
+
disabled: isLoading
|
|
106936
|
+
}, t2("CANCEL")), /* @__PURE__ */ React__default.createElement(Button, {
|
|
106937
|
+
size: "small",
|
|
106938
|
+
type: "submit",
|
|
106939
|
+
onClick: () => onAccept(),
|
|
106940
|
+
isLoading
|
|
106941
|
+
}, t2("ACCEPT")))));
|
|
106942
|
+
};
|
|
106943
|
+
const ExportBookingModal = ({ open, onClose: onClose2, isExportLoading, setIsExportLoading, userEmail, userFullName, currentVenue }) => {
|
|
106944
|
+
const { t: t2 } = useTranslation();
|
|
106945
|
+
const [exportFilters, setExportFilters] = useState({
|
|
106946
|
+
["filters[from]"]: hooks().format("YYYY-MM-DD"),
|
|
106947
|
+
["filters[till]"]: hooks().format("YYYY-MM-DD")
|
|
106948
|
+
});
|
|
106949
|
+
const [openConfirmationModal, setOpenConfirmationModal] = useState(false);
|
|
106950
|
+
const onOpenConfirmationModal = () => setOpenConfirmationModal(true);
|
|
106951
|
+
const onCloseConfirmationModal = () => setOpenConfirmationModal(false);
|
|
106952
|
+
const { isExecuting, execute, error: error3 } = useService(ExportReservationAnalytics, {
|
|
106953
|
+
onSuccess: async () => {
|
|
106954
|
+
onClose2();
|
|
106955
|
+
setIsExportLoading(false);
|
|
106956
|
+
},
|
|
106957
|
+
onError: async () => {
|
|
106958
|
+
setIsExportLoading(false);
|
|
106959
|
+
},
|
|
106960
|
+
successText: "Successfully requested"
|
|
106961
|
+
});
|
|
106962
|
+
const onRequestExcel = () => {
|
|
106963
|
+
setIsExportLoading(true);
|
|
106964
|
+
onCloseConfirmationModal();
|
|
106965
|
+
if (!currentVenue)
|
|
106966
|
+
return;
|
|
106967
|
+
execute({
|
|
106968
|
+
params: {
|
|
106969
|
+
"filters[venues]": [currentVenue],
|
|
106970
|
+
...exportFilters,
|
|
106971
|
+
...userEmail ? {
|
|
106972
|
+
["filters[userEmail]"]: userEmail
|
|
106973
|
+
} : {},
|
|
106974
|
+
...userFullName ? {
|
|
106975
|
+
["filters[userFullName]"]: userFullName
|
|
106976
|
+
} : {}
|
|
106977
|
+
}
|
|
106978
|
+
});
|
|
106979
|
+
};
|
|
106980
|
+
return /* @__PURE__ */ React__default.createElement(Modal2, {
|
|
106981
|
+
open,
|
|
106982
|
+
onClose: onClose2,
|
|
106983
|
+
width: 500,
|
|
106984
|
+
title: /* @__PURE__ */ React__default.createElement(Heading, null, /* @__PURE__ */ React__default.createElement(Icon$2, {
|
|
106985
|
+
icon: "clipBoardList"
|
|
106986
|
+
}), t2("EXPORTDATA"))
|
|
106987
|
+
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
106988
|
+
className: ""
|
|
106989
|
+
}, /* @__PURE__ */ React__default.createElement(DatePicker, {
|
|
106990
|
+
id: "dateRange",
|
|
106991
|
+
label: t2("BOOKINGCREATIONDATERANGE"),
|
|
106992
|
+
range: { from: exportFilters["filters[from]"], till: exportFilters["filters[till]"] },
|
|
106993
|
+
onChange: ({ from: from2, till }) => {
|
|
106994
|
+
if (from2 && till) {
|
|
106995
|
+
setExportFilters({
|
|
106996
|
+
...exportFilters,
|
|
106997
|
+
["filters[from]"]: hooks(from2).format("YYYY-MM-DD"),
|
|
106998
|
+
["filters[till]"]: hooks(till).format("YYYY-MM-DD")
|
|
106999
|
+
});
|
|
107000
|
+
}
|
|
107001
|
+
}
|
|
107002
|
+
}), /* @__PURE__ */ React__default.createElement("div", {
|
|
107003
|
+
style: { display: "flex", flexDirection: "column", gap: 20 }
|
|
107004
|
+
}, /* @__PURE__ */ React__default.createElement("div", null, "Choose the Booking creation date range to export. The rest of the filters selected on the page will apply as export criteria."), /* @__PURE__ */ React__default.createElement("div", null, "You will receive shortly the report on you email inbox after clicking the 'Export data' button.")), /* @__PURE__ */ React__default.createElement("div", {
|
|
107005
|
+
style: { display: "flex", justifyContent: "center" }
|
|
107006
|
+
}, /* @__PURE__ */ React__default.createElement(Button$4, {
|
|
107007
|
+
isLoading: isExportLoading,
|
|
107008
|
+
onClick: () => onOpenConfirmationModal()
|
|
107009
|
+
}, t2("EXPORTDATA")))), /* @__PURE__ */ React__default.createElement(ConfirmationModal, {
|
|
107010
|
+
open: openConfirmationModal,
|
|
107011
|
+
onClose: onCloseConfirmationModal,
|
|
107012
|
+
onAccept: () => onRequestExcel(),
|
|
107013
|
+
text: `Do you want to export an excel file from ${exportFilters["filters[from]"]} until ${exportFilters["filters[till]"]}? You will receive shortly the report on you email inbox.`,
|
|
107014
|
+
width: 500,
|
|
107015
|
+
isLoading: isExportLoading || isExecuting,
|
|
107016
|
+
icon: "calendar"
|
|
107017
|
+
}));
|
|
107018
|
+
};
|
|
107019
|
+
const index$c = ({ filters: filters2, setFilters, currentVenue, userEmail, userFullName }) => {
|
|
106879
107020
|
const { t: t2 } = useTranslation();
|
|
106880
107021
|
const { showSidebar, setShowSidebar } = useShowSidebarContext();
|
|
106881
|
-
const { selectedBooking, setSelectedBooking } = useSelectedBookingContext();
|
|
107022
|
+
const { selectedBooking, setSelectedBooking, canEdit } = useSelectedBookingContext();
|
|
107023
|
+
const [showExportBookingConfirmationModal, setShowExportBookingConfirmationModal] = useState(false);
|
|
106882
107024
|
const [datePickerOpen, setDatePickerOpen] = useState(false);
|
|
106883
107025
|
const datePickerRef = useRef(null);
|
|
106884
107026
|
const defaultValue2 = {
|
|
@@ -106998,7 +107140,7 @@ const index$c = ({ filters: filters2, setFilters }) => {
|
|
|
106998
107140
|
className: styles$l.buttonItem,
|
|
106999
107141
|
onClick: () => selectDate("tomorrow")
|
|
107000
107142
|
}, t2("TOMORROW")), /* @__PURE__ */ React__default.createElement("div", {
|
|
107001
|
-
style: { display: "flex",
|
|
107143
|
+
style: { display: "flex", gap: 5, justifyContent: "center", alignItems: "center" }
|
|
107002
107144
|
}, /* @__PURE__ */ React__default.createElement(Button, {
|
|
107003
107145
|
mode: "primary",
|
|
107004
107146
|
onClick: () => setDatePickerOpen(true)
|
|
@@ -107036,17 +107178,39 @@ const index$c = ({ filters: filters2, setFilters }) => {
|
|
|
107036
107178
|
setDatePickerOpen(false);
|
|
107037
107179
|
}
|
|
107038
107180
|
}, t2("TOMORROW")))
|
|
107039
|
-
})
|
|
107181
|
+
}), /* @__PURE__ */ React__default.createElement(Button, {
|
|
107182
|
+
mode: "success",
|
|
107183
|
+
onClick: () => setShowExportBookingConfirmationModal(true)
|
|
107184
|
+
}, /* @__PURE__ */ React__default.createElement(Icon, {
|
|
107185
|
+
icon: "download",
|
|
107186
|
+
size: "xs"
|
|
107187
|
+
}))), canEdit && /* @__PURE__ */ React__default.createElement(Button, {
|
|
107188
|
+
className: styles$l.addReservationButton,
|
|
107040
107189
|
mode: "success",
|
|
107041
107190
|
onClick: () => {
|
|
107042
107191
|
setSelectedBooking(null);
|
|
107043
107192
|
setShowSidebar(true);
|
|
107044
107193
|
}
|
|
107045
|
-
}, t2("ADDRESERVATION")))
|
|
107194
|
+
}, t2("ADDRESERVATION"))), /* @__PURE__ */ React__default.createElement(ExportBookingModal, {
|
|
107195
|
+
isExportLoading: false,
|
|
107196
|
+
setIsExportLoading: () => {
|
|
107197
|
+
},
|
|
107198
|
+
open: showExportBookingConfirmationModal,
|
|
107199
|
+
currentVenue,
|
|
107200
|
+
userEmail,
|
|
107201
|
+
userFullName,
|
|
107202
|
+
onClose: () => {
|
|
107203
|
+
setShowExportBookingConfirmationModal(false);
|
|
107204
|
+
}
|
|
107205
|
+
}));
|
|
107046
107206
|
};
|
|
107047
107207
|
const injectStyles = () => {
|
|
107048
107208
|
const styleElement = document.createElement("style");
|
|
107049
107209
|
styleElement.innerHTML = `
|
|
107210
|
+
.ant-picker-range {
|
|
107211
|
+
background-color: #3A3D54 !important;
|
|
107212
|
+
}
|
|
107213
|
+
|
|
107050
107214
|
.ant-picker-panel {
|
|
107051
107215
|
background-color: #2F3349 !important;
|
|
107052
107216
|
border-radius: 6px !important;
|
|
@@ -107185,12 +107349,12 @@ const ReloadProvider = ({ children, reload }) => {
|
|
|
107185
107349
|
value: { reload }
|
|
107186
107350
|
}, children);
|
|
107187
107351
|
};
|
|
107188
|
-
const TableRow = ({ item: item2, filtersData, venueId }) => {
|
|
107352
|
+
const TableRow = ({ index: index2, item: item2, filtersData, venueId }) => {
|
|
107189
107353
|
var _a2, _b, _c, _d;
|
|
107190
107354
|
const { t: t2 } = useTranslation();
|
|
107191
107355
|
const { reload: reloadMainTable } = useReloadContext();
|
|
107192
107356
|
const { showSidebar, setShowSidebar } = useShowSidebarContext();
|
|
107193
|
-
const { selectedBooking, setSelectedBooking } = useSelectedBookingContext();
|
|
107357
|
+
const { selectedBooking, setSelectedBooking, canEdit } = useSelectedBookingContext();
|
|
107194
107358
|
const { execute } = useService(UpdateBookingStatusBooking, {
|
|
107195
107359
|
onSuccess: async () => {
|
|
107196
107360
|
reloadMainTable();
|
|
@@ -107253,12 +107417,17 @@ const TableRow = ({ item: item2, filtersData, venueId }) => {
|
|
|
107253
107417
|
}
|
|
107254
107418
|
};
|
|
107255
107419
|
return /* @__PURE__ */ React__default.createElement(Card, {
|
|
107256
|
-
className: styles$l.tableRowCard
|
|
107420
|
+
className: styles$l.tableRowCard,
|
|
107421
|
+
style: {
|
|
107422
|
+
animationDelay: `${index2 * 0.2}s`
|
|
107423
|
+
}
|
|
107257
107424
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
107258
|
-
style: { display: "flex", cursor: "pointer" },
|
|
107425
|
+
style: { display: "flex", cursor: window.innerWidth > 768 ? "pointer" : "default" },
|
|
107259
107426
|
onClick: () => {
|
|
107260
|
-
|
|
107261
|
-
|
|
107427
|
+
if (window.innerWidth > 768) {
|
|
107428
|
+
setSelectedBooking(item2);
|
|
107429
|
+
setShowSidebar(true);
|
|
107430
|
+
}
|
|
107262
107431
|
}
|
|
107263
107432
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
107264
107433
|
className: styles$l.tableRowHour
|
|
@@ -107280,17 +107449,19 @@ const TableRow = ({ item: item2, filtersData, venueId }) => {
|
|
|
107280
107449
|
className: styles$l.rowContactPhone
|
|
107281
107450
|
}, (_a2 = item2 == null ? void 0 : item2.contact) == null ? void 0 : _a2.telephone)), /* @__PURE__ */ React__default.createElement("div", {
|
|
107282
107451
|
className: styles$l.rowSectionContainer
|
|
107452
|
+
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
107453
|
+
className: styles$l.rowSection
|
|
107283
107454
|
}, /* @__PURE__ */ React__default.createElement("h4", {
|
|
107284
107455
|
className: styles$l.rowSectionText
|
|
107285
107456
|
}, item2 == null ? void 0 : item2.partySize), /* @__PURE__ */ React__default.createElement("p", {
|
|
107286
107457
|
className: styles$l.rowSectionSecText
|
|
107287
107458
|
}, t2("GUESTS"))), /* @__PURE__ */ React__default.createElement("div", {
|
|
107288
|
-
className: styles$l.
|
|
107459
|
+
className: styles$l.rowSection
|
|
107289
107460
|
}, /* @__PURE__ */ React__default.createElement("h4", {
|
|
107290
107461
|
className: styles$l.rowSectionText
|
|
107291
107462
|
}, (_b = item2 == null ? void 0 : item2.table) == null ? void 0 : _b.name), /* @__PURE__ */ React__default.createElement("p", {
|
|
107292
107463
|
className: styles$l.rowSectionSecText
|
|
107293
|
-
}, (_c = item2 == null ? void 0 : item2.table) == null ? void 0 : _c.areaName)), /* @__PURE__ */ React__default.createElement("div", {
|
|
107464
|
+
}, (_c = item2 == null ? void 0 : item2.table) == null ? void 0 : _c.areaName))), canEdit && /* @__PURE__ */ React__default.createElement("div", {
|
|
107294
107465
|
className: styles$l.rowActionButton
|
|
107295
107466
|
}, /* @__PURE__ */ React__default.createElement(Button, {
|
|
107296
107467
|
icon: statusBuilder(item2.status).icon,
|
|
@@ -107343,8 +107514,9 @@ const TableBody = ({ data: data2, filtersData, venueId }) => {
|
|
|
107343
107514
|
className: styles$l.tableTopHeaderContentText
|
|
107344
107515
|
}, group.length, " ", t2("RESERVATIONS"))), /* @__PURE__ */ React__default.createElement("div", {
|
|
107345
107516
|
className: styles$l.tableRowContainer
|
|
107346
|
-
}, group.map((item2) => {
|
|
107517
|
+
}, group.map((item2, index2) => {
|
|
107347
107518
|
return /* @__PURE__ */ React__default.createElement(TableRow, {
|
|
107519
|
+
index: index2,
|
|
107348
107520
|
key: item2.id,
|
|
107349
107521
|
item: item2,
|
|
107350
107522
|
filtersData,
|
|
@@ -107367,7 +107539,7 @@ const index$b = ({ data: data2, filters: filters2, filtersData, venueId }) => {
|
|
|
107367
107539
|
};
|
|
107368
107540
|
const container = "_container_ut3y7_1";
|
|
107369
107541
|
const tooltip = "_tooltip_ut3y7_5";
|
|
107370
|
-
var styles$
|
|
107542
|
+
var styles$c = {
|
|
107371
107543
|
container,
|
|
107372
107544
|
tooltip
|
|
107373
107545
|
};
|
|
@@ -107426,7 +107598,7 @@ const Select = ({
|
|
|
107426
107598
|
...props
|
|
107427
107599
|
}) => {
|
|
107428
107600
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
107429
|
-
className: styles$
|
|
107601
|
+
className: styles$c.container
|
|
107430
107602
|
}, label2 && /* @__PURE__ */ React__default.createElement(Label, {
|
|
107431
107603
|
htmlFor: id2
|
|
107432
107604
|
}, label2), /* @__PURE__ */ React__default.createElement("div", {
|
|
@@ -107457,7 +107629,7 @@ const SelectField = ({ control, name, ...props }) => {
|
|
|
107457
107629
|
});
|
|
107458
107630
|
};
|
|
107459
107631
|
const input$1 = "_input_zx6p9_1";
|
|
107460
|
-
var styles$
|
|
107632
|
+
var styles$b = {
|
|
107461
107633
|
input: input$1
|
|
107462
107634
|
};
|
|
107463
107635
|
const TextArea = React__default.forwardRef(
|
|
@@ -107490,7 +107662,7 @@ const TextArea = React__default.forwardRef(
|
|
|
107490
107662
|
}, label2), /* @__PURE__ */ React__default.createElement("div", {
|
|
107491
107663
|
style: { position: "relative" }
|
|
107492
107664
|
}, /* @__PURE__ */ React__default.createElement("textarea", {
|
|
107493
|
-
className: styles$
|
|
107665
|
+
className: styles$b.input,
|
|
107494
107666
|
onChange: handleChange,
|
|
107495
107667
|
id: id2,
|
|
107496
107668
|
name: id2,
|
|
@@ -107521,51 +107693,6 @@ const TextAreaField = ({ control, name, ...props }) => {
|
|
|
107521
107693
|
}))
|
|
107522
107694
|
});
|
|
107523
107695
|
};
|
|
107524
|
-
var styles$b = /* @__PURE__ */ (() => ".resbook-modal .ant-modal-centered .ant-modal{border:0;border-radius:6px;background-color:#2f3349}.resbook-modal .ant-modal-content{background-color:transparent;border-radius:6px}.resbook-modal .ant-modal-header,.resbook-modal .ant-modal-body{background-color:#2f3349!important;color:#fff}.resbook-modal .ant-modal-header{border-bottom:0;border-radius:6px 6px 0 0;padding-bottom:0}.resbook-modal .ant-modal-body{border-radius:0 0 6px 6px;padding-top:0}.resbook-modal .ant-modal-header h1,.resbook-modal .ant-modal-header p,.resbook-modal .ant-modal-body h1,.resbook-modal .ant-modal-body h2,.resbook-modal .ant-modal-body h3,.resbook-modal .ant-modal-body h4,.resbook-modal .ant-modal-body p{font-family:Public Sans,sans-serif}.resbook-modal .ant-modal-header p,.resbook-modal .ant-modal-body p{font-size:15px;color:#acabc1}.resbook-modal .ant-modal-header p{margin-bottom:0;margin-top:0}.resbook-modal .ant-modal-header h1,.resbook-modal .ant-modal-body h1{font-weight:600;color:#cfcde4;font-size:18px}.resbook-modal .ant-modal-body label{font-size:15px;color:#acabc1}.resbook-modal .ant-modal-body h2{color:#fff}.resbook-modal .ant-modal-body [class*=regularHourContainer]{color:#d0cee5;box-shadow:none;font-family:var(--font-family)}.resbook-modal .ant-modal-body [class*=regularHourContainer] strong{font-weight:300;font-size:15px}.resbook-modal .mz-header input,.resbook-modal .ant-modal-body input,.resbook-modal .ant-modal-body textarea{background-color:#3a3d54;color:#d0cee5;border-width:0 0 1px;border-color:#d0cee5;border-radius:0;padding:10px 5px}.resbook-modal .mz-header .css-spersy-control,.resbook-modal .ant-modal-body .css-spersy-control{background-color:#3a3d54;border-width:0 0 1px;border-radius:0}.resbook-modal .css-spersy-control>div>div:first-child{color:#d0cee5!important;font-family:Public Sans,sans-serif;padding:7px 0}.resbook-modal .ant-modal-body #react-select-4-listbox{background-color:#3a3d54;font-family:var(--font-family)}.resbook-modal .ant-modal-title,.resbook-modal .ant-modal-body span{color:#fff}.resbook-modal .ant-modal-close-x line{stroke:#fff}\n")();
|
|
107525
|
-
const Modal2 = ({
|
|
107526
|
-
open,
|
|
107527
|
-
children,
|
|
107528
|
-
onClose: onClose2,
|
|
107529
|
-
title: title2,
|
|
107530
|
-
width
|
|
107531
|
-
}) => {
|
|
107532
|
-
return /* @__PURE__ */ React__default.createElement(ModalAntd, {
|
|
107533
|
-
className: "resbook-modal",
|
|
107534
|
-
title: /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, typeof title2 === "string" && /* @__PURE__ */ React__default.createElement(Heading, null, title2), typeof title2 !== "string" && !!title2 ? title2 : /* @__PURE__ */ React__default.createElement("div", null)),
|
|
107535
|
-
open,
|
|
107536
|
-
onCancel: onClose2,
|
|
107537
|
-
width: width || 1e3,
|
|
107538
|
-
footer: null,
|
|
107539
|
-
closeIcon: /* @__PURE__ */ React__default.createElement(Icon, {
|
|
107540
|
-
icon: "close",
|
|
107541
|
-
size: "small"
|
|
107542
|
-
}),
|
|
107543
|
-
centered: true,
|
|
107544
|
-
zIndex: 1032
|
|
107545
|
-
}, children);
|
|
107546
|
-
};
|
|
107547
|
-
const ConfirmationModal = ({ onAccept, isLoading, title: title2, text: text2 = "AREYOUSURE?", ...props }) => {
|
|
107548
|
-
const { t: t2 } = useTranslation();
|
|
107549
|
-
return /* @__PURE__ */ React__default.createElement(Modal2, {
|
|
107550
|
-
...props,
|
|
107551
|
-
title: title2,
|
|
107552
|
-
width: 500
|
|
107553
|
-
}, /* @__PURE__ */ React__default.createElement("h3", {
|
|
107554
|
-
style: { marginTop: 0, paddingTop: 20 }
|
|
107555
|
-
}, t2(text2)), /* @__PURE__ */ React__default.createElement("div", null, /* @__PURE__ */ React__default.createElement("div", {
|
|
107556
|
-
style: { display: "flex", justifyContent: "center", gap: 20, marginTop: 20 }
|
|
107557
|
-
}, /* @__PURE__ */ React__default.createElement(Button, {
|
|
107558
|
-
size: "small",
|
|
107559
|
-
mode: "tertiary",
|
|
107560
|
-
onClick: props.onClose,
|
|
107561
|
-
disabled: isLoading
|
|
107562
|
-
}, t2("CANCEL")), /* @__PURE__ */ React__default.createElement(Button, {
|
|
107563
|
-
size: "small",
|
|
107564
|
-
type: "submit",
|
|
107565
|
-
onClick: () => onAccept(),
|
|
107566
|
-
isLoading
|
|
107567
|
-
}, t2("ACCEPT")))));
|
|
107568
|
-
};
|
|
107569
107696
|
const ActionButtons = ({ onSubmit, venueId }) => {
|
|
107570
107697
|
const { t: t2 } = useTranslation();
|
|
107571
107698
|
const { selectedBooking, setSelectedBooking } = useSelectedBookingContext();
|
|
@@ -107705,7 +107832,7 @@ const Header = () => {
|
|
|
107705
107832
|
const index$a = ({ filtersData, venueId }) => {
|
|
107706
107833
|
const { t: t2 } = useTranslation();
|
|
107707
107834
|
const { reload: reloadMainTable } = useReloadContext();
|
|
107708
|
-
const { selectedBooking, setSelectedBooking } = useSelectedBookingContext();
|
|
107835
|
+
const { selectedBooking, setSelectedBooking, canEdit } = useSelectedBookingContext();
|
|
107709
107836
|
const { showMessageError } = useMessage();
|
|
107710
107837
|
const [currentTimeZone, setCurrentTimeZone] = useState("");
|
|
107711
107838
|
const [partySizeOptions2, setPartySizeOptions] = useState([]);
|
|
@@ -107936,6 +108063,7 @@ const index$a = ({ filtersData, venueId }) => {
|
|
|
107936
108063
|
}, /* @__PURE__ */ React__default.createElement(Header, null), !selectedBooking && /* @__PURE__ */ React__default.createElement("div", {
|
|
107937
108064
|
style: { width: "100%" }
|
|
107938
108065
|
}, /* @__PURE__ */ React__default.createElement(SelectField, {
|
|
108066
|
+
isDisabled: !canEdit,
|
|
107939
108067
|
control,
|
|
107940
108068
|
id: "source",
|
|
107941
108069
|
name: "source",
|
|
@@ -107946,6 +108074,7 @@ const index$a = ({ filtersData, venueId }) => {
|
|
|
107946
108074
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
107947
108075
|
style: { width: "50%" }
|
|
107948
108076
|
}, /* @__PURE__ */ React__default.createElement(TextInputField, {
|
|
108077
|
+
disabled: !canEdit,
|
|
107949
108078
|
control,
|
|
107950
108079
|
id: "date",
|
|
107951
108080
|
name: "date",
|
|
@@ -107956,6 +108085,7 @@ const index$a = ({ filtersData, venueId }) => {
|
|
|
107956
108085
|
})), /* @__PURE__ */ React__default.createElement("div", {
|
|
107957
108086
|
style: { width: "50%" }
|
|
107958
108087
|
}, /* @__PURE__ */ React__default.createElement(SelectField, {
|
|
108088
|
+
isDisabled: !canEdit,
|
|
107959
108089
|
control,
|
|
107960
108090
|
isClearable: true,
|
|
107961
108091
|
id: "time",
|
|
@@ -107967,6 +108097,7 @@ const index$a = ({ filtersData, venueId }) => {
|
|
|
107967
108097
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
107968
108098
|
style: { width: "50%" }
|
|
107969
108099
|
}, /* @__PURE__ */ React__default.createElement(SelectField, {
|
|
108100
|
+
isDisabled: !canEdit,
|
|
107970
108101
|
control,
|
|
107971
108102
|
isClearable: true,
|
|
107972
108103
|
id: "partySize",
|
|
@@ -107976,6 +108107,7 @@ const index$a = ({ filtersData, venueId }) => {
|
|
|
107976
108107
|
})), /* @__PURE__ */ React__default.createElement("div", {
|
|
107977
108108
|
style: { width: "50%" }
|
|
107978
108109
|
}, /* @__PURE__ */ React__default.createElement(SelectField, {
|
|
108110
|
+
isDisabled: !canEdit,
|
|
107979
108111
|
control,
|
|
107980
108112
|
id: "table",
|
|
107981
108113
|
name: "table",
|
|
@@ -107986,7 +108118,7 @@ const index$a = ({ filtersData, venueId }) => {
|
|
|
107986
108118
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
107987
108119
|
style: { width: "50%" }
|
|
107988
108120
|
}, /* @__PURE__ */ React__default.createElement(TextInputField, {
|
|
107989
|
-
disabled: selectedBooking,
|
|
108121
|
+
disabled: selectedBooking || !canEdit,
|
|
107990
108122
|
control,
|
|
107991
108123
|
id: "firstName",
|
|
107992
108124
|
name: "firstName",
|
|
@@ -107997,7 +108129,7 @@ const index$a = ({ filtersData, venueId }) => {
|
|
|
107997
108129
|
})), /* @__PURE__ */ React__default.createElement("div", {
|
|
107998
108130
|
style: { width: "50%" }
|
|
107999
108131
|
}, /* @__PURE__ */ React__default.createElement(TextInputField, {
|
|
108000
|
-
disabled: selectedBooking,
|
|
108132
|
+
disabled: selectedBooking || !canEdit,
|
|
108001
108133
|
control,
|
|
108002
108134
|
id: "lastName",
|
|
108003
108135
|
name: "lastName",
|
|
@@ -108008,7 +108140,7 @@ const index$a = ({ filtersData, venueId }) => {
|
|
|
108008
108140
|
}))), /* @__PURE__ */ React__default.createElement("div", {
|
|
108009
108141
|
style: { width: "100%" }
|
|
108010
108142
|
}, /* @__PURE__ */ React__default.createElement(TextInputField, {
|
|
108011
|
-
disabled: selectedBooking,
|
|
108143
|
+
disabled: selectedBooking || !canEdit,
|
|
108012
108144
|
control,
|
|
108013
108145
|
id: "email",
|
|
108014
108146
|
name: "email",
|
|
@@ -108019,7 +108151,7 @@ const index$a = ({ filtersData, venueId }) => {
|
|
|
108019
108151
|
})), /* @__PURE__ */ React__default.createElement("div", {
|
|
108020
108152
|
style: { width: "100%" }
|
|
108021
108153
|
}, /* @__PURE__ */ React__default.createElement(TextInputField, {
|
|
108022
|
-
disabled: selectedBooking,
|
|
108154
|
+
disabled: selectedBooking || !canEdit,
|
|
108023
108155
|
control,
|
|
108024
108156
|
id: "phone",
|
|
108025
108157
|
name: "phone",
|
|
@@ -108030,7 +108162,7 @@ const index$a = ({ filtersData, venueId }) => {
|
|
|
108030
108162
|
})), /* @__PURE__ */ React__default.createElement("div", {
|
|
108031
108163
|
style: { width: "100%" }
|
|
108032
108164
|
}, /* @__PURE__ */ React__default.createElement(TextAreaField, {
|
|
108033
|
-
disabled: selectedBooking,
|
|
108165
|
+
disabled: selectedBooking || !canEdit,
|
|
108034
108166
|
control,
|
|
108035
108167
|
id: "notes",
|
|
108036
108168
|
name: "notes",
|
|
@@ -108038,7 +108170,7 @@ const index$a = ({ filtersData, venueId }) => {
|
|
|
108038
108170
|
placeholder: "Notes ..."
|
|
108039
108171
|
})), /* @__PURE__ */ React__default.createElement("hr", {
|
|
108040
108172
|
style: { width: "100%" }
|
|
108041
|
-
}), /* @__PURE__ */ React__default.createElement(ActionButtons, {
|
|
108173
|
+
}), canEdit && /* @__PURE__ */ React__default.createElement(ActionButtons, {
|
|
108042
108174
|
onSubmit,
|
|
108043
108175
|
venueId
|
|
108044
108176
|
}), selectedBooking && /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement("hr", {
|
|
@@ -108047,7 +108179,7 @@ const index$a = ({ filtersData, venueId }) => {
|
|
|
108047
108179
|
item: selectedBooking
|
|
108048
108180
|
})));
|
|
108049
108181
|
};
|
|
108050
|
-
function MainComponent({ venueId }) {
|
|
108182
|
+
function MainComponent({ venueId, userEmail, userFullName }) {
|
|
108051
108183
|
const [currentVenue, setCurrentVenue] = useState(null);
|
|
108052
108184
|
const { showSidebar, setShowSidebar } = useShowSidebarContext();
|
|
108053
108185
|
const [filters2, setFilters] = useState({
|
|
@@ -108109,6 +108241,14 @@ function MainComponent({ venueId }) {
|
|
|
108109
108241
|
document.removeEventListener("mousedown", handleOutsideClick);
|
|
108110
108242
|
};
|
|
108111
108243
|
}, [showSidebar, setShowSidebar]);
|
|
108244
|
+
useEffect(() => {
|
|
108245
|
+
const interval = setInterval(() => {
|
|
108246
|
+
reload();
|
|
108247
|
+
}, 6e4);
|
|
108248
|
+
return () => {
|
|
108249
|
+
clearInterval(interval);
|
|
108250
|
+
};
|
|
108251
|
+
}, [reload]);
|
|
108112
108252
|
return /* @__PURE__ */ React__default.createElement(ReloadProvider, {
|
|
108113
108253
|
reload
|
|
108114
108254
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
@@ -108117,7 +108257,10 @@ function MainComponent({ venueId }) {
|
|
|
108117
108257
|
className: styles$l.mainTableContainer
|
|
108118
108258
|
}, /* @__PURE__ */ React__default.createElement(index$c, {
|
|
108119
108259
|
filters: filters2,
|
|
108120
|
-
setFilters
|
|
108260
|
+
setFilters,
|
|
108261
|
+
currentVenue,
|
|
108262
|
+
userEmail,
|
|
108263
|
+
userFullName
|
|
108121
108264
|
}), /* @__PURE__ */ React__default.createElement(index$b, {
|
|
108122
108265
|
data: data2,
|
|
108123
108266
|
filters: filters2,
|
|
@@ -108133,9 +108276,11 @@ function MainComponent({ venueId }) {
|
|
|
108133
108276
|
venueId
|
|
108134
108277
|
}))));
|
|
108135
108278
|
}
|
|
108136
|
-
function Main$2({ venueId }) {
|
|
108279
|
+
function Main$2({ venueId, userEmail, userFullName }) {
|
|
108137
108280
|
return /* @__PURE__ */ React__default.createElement(SelectedBookingProvider, null, /* @__PURE__ */ React__default.createElement(ShowSidebarProvider, null, /* @__PURE__ */ React__default.createElement(MainComponent, {
|
|
108138
|
-
venueId
|
|
108281
|
+
venueId,
|
|
108282
|
+
userEmail,
|
|
108283
|
+
userFullName
|
|
108139
108284
|
})));
|
|
108140
108285
|
}
|
|
108141
108286
|
const mainConatiner$1 = "_mainConatiner_au98t_70";
|
|
@@ -108174,7 +108319,7 @@ var styles$a = {
|
|
|
108174
108319
|
scrollableForm: scrollableForm$1,
|
|
108175
108320
|
fixedActions: fixedActions$1
|
|
108176
108321
|
};
|
|
108177
|
-
const AreaManagementCard$1 = ({ isOpenDrawer, setIsOpenDrawer, data: data2 }) => {
|
|
108322
|
+
const AreaManagementCard$1 = ({ isOpenDrawer, setIsOpenDrawer, data: data2, canEdit }) => {
|
|
108178
108323
|
const { t: t2 } = useTranslation();
|
|
108179
108324
|
return /* @__PURE__ */ React__default.createElement(Card, {
|
|
108180
108325
|
className: styles$a.sectionCard
|
|
@@ -108198,7 +108343,7 @@ const AreaManagementCard$1 = ({ isOpenDrawer, setIsOpenDrawer, data: data2 }) =>
|
|
|
108198
108343
|
}, data2.areas.slice(0, 2).map((area, index2) => /* @__PURE__ */ React__default.createElement("p", {
|
|
108199
108344
|
key: index2,
|
|
108200
108345
|
style: { fontWeight: "bold" }
|
|
108201
|
-
}, area.name)))), /* @__PURE__ */ React__default.createElement("div", {
|
|
108346
|
+
}, area.name)))), canEdit && /* @__PURE__ */ React__default.createElement("div", {
|
|
108202
108347
|
className: styles$a.cardFooter
|
|
108203
108348
|
}, /* @__PURE__ */ React__default.createElement("hr", null), /* @__PURE__ */ React__default.createElement("div", {
|
|
108204
108349
|
className: styles$a.cardFooterContent,
|
|
@@ -108251,12 +108396,13 @@ const Drawer = ({ isOpen, onClose: onClose2, children, title: title2, titleDesc,
|
|
|
108251
108396
|
className: styles$9.drawer__body
|
|
108252
108397
|
}, children)));
|
|
108253
108398
|
};
|
|
108254
|
-
const label$1 = "
|
|
108255
|
-
const label__switch = "
|
|
108256
|
-
const input = "
|
|
108399
|
+
const label$1 = "_label_o8bxt_1";
|
|
108400
|
+
const label__switch = "_label__switch_o8bxt_8";
|
|
108401
|
+
const input = "_input_o8bxt_34";
|
|
108257
108402
|
var styles$8 = {
|
|
108258
108403
|
label: label$1,
|
|
108259
108404
|
label__switch,
|
|
108405
|
+
"label__switch--disabled": "_label__switch--disabled_o8bxt_18",
|
|
108260
108406
|
input
|
|
108261
108407
|
};
|
|
108262
108408
|
const Toggle = ({
|
|
@@ -108279,10 +108425,13 @@ const Toggle = ({
|
|
|
108279
108425
|
htmlFor: id2,
|
|
108280
108426
|
className: styles$8.label
|
|
108281
108427
|
}, /* @__PURE__ */ React__default.createElement("span", {
|
|
108282
|
-
className:
|
|
108428
|
+
className: classNames$2(
|
|
108429
|
+
styles$8.label__switch,
|
|
108430
|
+
disabled2 ? styles$8["label__switch--disabled"] : ""
|
|
108431
|
+
)
|
|
108283
108432
|
}), label2));
|
|
108284
108433
|
};
|
|
108285
|
-
const SwitchField = ({ control, name, onChangeEvent, ...props }) => {
|
|
108434
|
+
const SwitchField = ({ control, name, onChangeEvent, disabled: disabled2, ...props }) => {
|
|
108286
108435
|
return /* @__PURE__ */ React__default.createElement(Controller, {
|
|
108287
108436
|
control,
|
|
108288
108437
|
name,
|
|
@@ -108294,6 +108443,7 @@ const SwitchField = ({ control, name, onChangeEvent, ...props }) => {
|
|
|
108294
108443
|
name,
|
|
108295
108444
|
value: value2 || "",
|
|
108296
108445
|
label: props.label,
|
|
108446
|
+
disabled: disabled2,
|
|
108297
108447
|
onChange: (e3) => {
|
|
108298
108448
|
onChange3(e3);
|
|
108299
108449
|
if (onChangeEvent) {
|
|
@@ -108512,14 +108662,15 @@ const fieldChanged$3 = (currentValue, initialData) => {
|
|
|
108512
108662
|
}
|
|
108513
108663
|
return false;
|
|
108514
108664
|
};
|
|
108515
|
-
const index$9 = ({ venueId, reloadAreas, areas }) => {
|
|
108665
|
+
const index$9 = ({ venueId, reloadAreas, areas, canEdit }) => {
|
|
108516
108666
|
const [isOpenDrawer, setIsOpenDrawer] = useState(false);
|
|
108517
108667
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
108518
108668
|
className: styles$a.sectionManagement
|
|
108519
108669
|
}, /* @__PURE__ */ React__default.createElement(AreaManagementCard$1, {
|
|
108520
108670
|
isOpenDrawer,
|
|
108521
108671
|
setIsOpenDrawer,
|
|
108522
|
-
data: areas
|
|
108672
|
+
data: areas,
|
|
108673
|
+
canEdit
|
|
108523
108674
|
}), /* @__PURE__ */ React__default.createElement(AreaEditDrawer, {
|
|
108524
108675
|
data: areas,
|
|
108525
108676
|
isOpen: isOpenDrawer,
|
|
@@ -108528,7 +108679,7 @@ const index$9 = ({ venueId, reloadAreas, areas }) => {
|
|
|
108528
108679
|
reload: reloadAreas
|
|
108529
108680
|
}));
|
|
108530
108681
|
};
|
|
108531
|
-
const AreaManagementCard = ({ isOpenDrawer, setIsOpenDrawer, data: data2 }) => {
|
|
108682
|
+
const AreaManagementCard = ({ isOpenDrawer, setIsOpenDrawer, data: data2, canEdit }) => {
|
|
108532
108683
|
const { t: t2 } = useTranslation();
|
|
108533
108684
|
return /* @__PURE__ */ React__default.createElement(Card, {
|
|
108534
108685
|
className: styles$a.sectionCard
|
|
@@ -108552,7 +108703,7 @@ const AreaManagementCard = ({ isOpenDrawer, setIsOpenDrawer, data: data2 }) => {
|
|
|
108552
108703
|
}, table2.name), /* @__PURE__ */ React__default.createElement("p", null, table2.minCapacity, "-", table2.maxCapacity), /* @__PURE__ */ React__default.createElement("p", {
|
|
108553
108704
|
style: { flex: 1, textAlign: "center" }
|
|
108554
108705
|
}, (_b = (_a2 = table2.area) == null ? void 0 : _a2.name) != null ? _b : "---"));
|
|
108555
|
-
}))), /* @__PURE__ */ React__default.createElement("div", {
|
|
108706
|
+
}))), canEdit && /* @__PURE__ */ React__default.createElement("div", {
|
|
108556
108707
|
className: styles$a.cardFooter
|
|
108557
108708
|
}, /* @__PURE__ */ React__default.createElement("hr", null), /* @__PURE__ */ React__default.createElement("div", {
|
|
108558
108709
|
className: styles$a.cardFooterContent,
|
|
@@ -108922,7 +109073,7 @@ const fieldChanged$2 = (currentValue, initialData) => {
|
|
|
108922
109073
|
}
|
|
108923
109074
|
return false;
|
|
108924
109075
|
};
|
|
108925
|
-
const index$8 = ({ venueId, areas }) => {
|
|
109076
|
+
const index$8 = ({ venueId, areas, canEdit }) => {
|
|
108926
109077
|
const [isOpenDrawer, setIsOpenDrawer] = useState(false);
|
|
108927
109078
|
const { data: data2, isLoading, error: error3, reload } = useFetch(GetTableManagement, { cacheId: "table0management", venue_id: venueId });
|
|
108928
109079
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
@@ -108930,7 +109081,8 @@ const index$8 = ({ venueId, areas }) => {
|
|
|
108930
109081
|
}, /* @__PURE__ */ React__default.createElement(AreaManagementCard, {
|
|
108931
109082
|
isOpenDrawer,
|
|
108932
109083
|
setIsOpenDrawer,
|
|
108933
|
-
data: data2
|
|
109084
|
+
data: data2,
|
|
109085
|
+
canEdit
|
|
108934
109086
|
}), /* @__PURE__ */ React__default.createElement(TableEditDrawer, {
|
|
108935
109087
|
data: data2,
|
|
108936
109088
|
areasList: areas,
|
|
@@ -108950,7 +109102,7 @@ const TimeFormatter = ({ seconds: seconds2, type: type4 = "hours" }) => {
|
|
|
108950
109102
|
${minutes2 && minutes2 !== 0 ? minutes2 + "m" : ""}
|
|
108951
109103
|
`);
|
|
108952
109104
|
};
|
|
108953
|
-
const ReservationDurationCard = ({ isOpenDrawer, setIsOpenDrawer, data: data2 }) => {
|
|
109105
|
+
const ReservationDurationCard = ({ isOpenDrawer, setIsOpenDrawer, data: data2, canEdit }) => {
|
|
108954
109106
|
const { t: t2 } = useTranslation();
|
|
108955
109107
|
return /* @__PURE__ */ React__default.createElement(Card, {
|
|
108956
109108
|
className: styles$a.sectionCard
|
|
@@ -108985,7 +109137,7 @@ const ReservationDurationCard = ({ isOpenDrawer, setIsOpenDrawer, data: data2 })
|
|
|
108985
109137
|
}, (shift == null ? void 0 : shift.duration) ? /* @__PURE__ */ React__default.createElement(TimeFormatter, {
|
|
108986
109138
|
seconds: shift == null ? void 0 : shift.duration
|
|
108987
109139
|
}) : "---")));
|
|
108988
|
-
}))), /* @__PURE__ */ React__default.createElement("div", {
|
|
109140
|
+
}))), canEdit && /* @__PURE__ */ React__default.createElement("div", {
|
|
108989
109141
|
className: styles$a.cardFooter
|
|
108990
109142
|
}, /* @__PURE__ */ React__default.createElement("hr", null), /* @__PURE__ */ React__default.createElement("div", {
|
|
108991
109143
|
className: styles$a.cardFooterContent,
|
|
@@ -109032,10 +109184,10 @@ const ReservationDurationEditDrawer = ({ isOpen, setIsOpen, venueId, data: data2
|
|
|
109032
109184
|
try {
|
|
109033
109185
|
for (const shift of formData.shifts) {
|
|
109034
109186
|
if (shift.shift1Id && fieldChanged$1(shift, initialData)) {
|
|
109035
|
-
await executeUpdater({ data: { duration: shift.shift1 }, venue_id: venueId, table_id: shift.shift1Id, module: "seatingRule" });
|
|
109187
|
+
await executeUpdater({ data: { duration: shift.shift1 * 60 }, venue_id: venueId, table_id: shift.shift1Id, module: "seatingRule" });
|
|
109036
109188
|
}
|
|
109037
109189
|
if (shift.shift2Id && fieldChanged$1(shift, initialData)) {
|
|
109038
|
-
await executeUpdater({ data: { duration: shift.shift2 }, venue_id: venueId, table_id: shift.shift2Id, module: "seatingRule" });
|
|
109190
|
+
await executeUpdater({ data: { duration: shift.shift2 * 60 }, venue_id: venueId, table_id: shift.shift2Id, module: "seatingRule" });
|
|
109039
109191
|
}
|
|
109040
109192
|
}
|
|
109041
109193
|
reload();
|
|
@@ -109050,9 +109202,9 @@ const ReservationDurationEditDrawer = ({ isOpen, setIsOpen, venueId, data: data2
|
|
|
109050
109202
|
var _a3, _b, _c, _d;
|
|
109051
109203
|
return {
|
|
109052
109204
|
partySize: Number(partySize),
|
|
109053
|
-
shift1: `${(_a3 = shifts[0]) == null ? void 0 : _a3.duration}` || null,
|
|
109205
|
+
shift1: `${((_a3 = shifts[0]) == null ? void 0 : _a3.duration) / 60}` || null,
|
|
109054
109206
|
shift1Id: ((_b = shifts[0]) == null ? void 0 : _b.id) || null,
|
|
109055
|
-
shift2: `${(_c = shifts[1]) == null ? void 0 : _c.duration}` || null,
|
|
109207
|
+
shift2: `${((_c = shifts[1]) == null ? void 0 : _c.duration) / 60}` || null,
|
|
109056
109208
|
shift2Id: ((_d = shifts[1]) == null ? void 0 : _d.id) || null
|
|
109057
109209
|
};
|
|
109058
109210
|
});
|
|
@@ -109113,7 +109265,7 @@ const fieldChanged$1 = (currentValue, initialData) => {
|
|
|
109113
109265
|
}
|
|
109114
109266
|
return true;
|
|
109115
109267
|
};
|
|
109116
|
-
const index$7 = ({ venueId }) => {
|
|
109268
|
+
const index$7 = ({ venueId, canEdit }) => {
|
|
109117
109269
|
const [isOpenDrawer, setIsOpenDrawer] = useState(false);
|
|
109118
109270
|
const { data: data2, isLoading, error: error3, reload } = useFetch(GetSeatingRules, { cacheId: "reservation0duration", venue_id: venueId });
|
|
109119
109271
|
const [formatedData, setformatedData] = useState(null);
|
|
@@ -109131,7 +109283,8 @@ const index$7 = ({ venueId }) => {
|
|
|
109131
109283
|
}, /* @__PURE__ */ React__default.createElement(ReservationDurationCard, {
|
|
109132
109284
|
isOpenDrawer,
|
|
109133
109285
|
setIsOpenDrawer,
|
|
109134
|
-
data: formatedData
|
|
109286
|
+
data: formatedData,
|
|
109287
|
+
canEdit
|
|
109135
109288
|
}), /* @__PURE__ */ React__default.createElement(ReservationDurationEditDrawer, {
|
|
109136
109289
|
data: formatedData,
|
|
109137
109290
|
isOpen: isOpenDrawer,
|
|
@@ -109140,7 +109293,7 @@ const index$7 = ({ venueId }) => {
|
|
|
109140
109293
|
reload
|
|
109141
109294
|
}));
|
|
109142
109295
|
};
|
|
109143
|
-
const SpecialDatesCard = ({ isOpenDrawer, setIsOpenDrawer, data: data2 }) => {
|
|
109296
|
+
const SpecialDatesCard = ({ isOpenDrawer, setIsOpenDrawer, data: data2, canEdit }) => {
|
|
109144
109297
|
const getOrdinal = (n2) => {
|
|
109145
109298
|
const s2 = ["th", "st", "nd", "rd"];
|
|
109146
109299
|
const v2 = n2 % 100;
|
|
@@ -109171,7 +109324,7 @@ const SpecialDatesCard = ({ isOpenDrawer, setIsOpenDrawer, data: data2 }) => {
|
|
|
109171
109324
|
style: { textAlign: "center" }
|
|
109172
109325
|
}, t2("CLOSED")) : /* @__PURE__ */ React__default.createElement("p", {
|
|
109173
109326
|
style: { textAlign: "center" }
|
|
109174
|
-
}, t2("SPECIAL_SHIFTS")))))), /* @__PURE__ */ React__default.createElement("div", {
|
|
109327
|
+
}, t2("SPECIAL_SHIFTS")))))), canEdit && /* @__PURE__ */ React__default.createElement("div", {
|
|
109175
109328
|
className: styles$a.cardFooter
|
|
109176
109329
|
}, /* @__PURE__ */ React__default.createElement("hr", null), /* @__PURE__ */ React__default.createElement("div", {
|
|
109177
109330
|
className: styles$a.cardFooterContent,
|
|
@@ -109452,7 +109605,7 @@ const fieldChanged = (currentValue, initialData) => {
|
|
|
109452
109605
|
}
|
|
109453
109606
|
return false;
|
|
109454
109607
|
};
|
|
109455
|
-
const index$6 = ({ venueId }) => {
|
|
109608
|
+
const index$6 = ({ venueId, canEdit }) => {
|
|
109456
109609
|
const [isOpenDrawer, setIsOpenDrawer] = useState(false);
|
|
109457
109610
|
const { data: data2, isLoading, error: error3, reload } = useFetch(GetSpecialDates, { cacheId: "special0dates", venue_id: venueId });
|
|
109458
109611
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
@@ -109460,7 +109613,8 @@ const index$6 = ({ venueId }) => {
|
|
|
109460
109613
|
}, /* @__PURE__ */ React__default.createElement(SpecialDatesCard, {
|
|
109461
109614
|
isOpenDrawer,
|
|
109462
109615
|
setIsOpenDrawer,
|
|
109463
|
-
data: data2
|
|
109616
|
+
data: data2,
|
|
109617
|
+
canEdit
|
|
109464
109618
|
}), /* @__PURE__ */ React__default.createElement(SpecialDatesEditDrawer, {
|
|
109465
109619
|
data: data2,
|
|
109466
109620
|
isOpen: isOpenDrawer,
|
|
@@ -109469,7 +109623,7 @@ const index$6 = ({ venueId }) => {
|
|
|
109469
109623
|
reload
|
|
109470
109624
|
}));
|
|
109471
109625
|
};
|
|
109472
|
-
const ShiftsCard = ({ isOpenDrawer, setIsOpenDrawer, data: data2 }) => {
|
|
109626
|
+
const ShiftsCard = ({ isOpenDrawer, setIsOpenDrawer, data: data2, canEdit }) => {
|
|
109473
109627
|
const { t: t2 } = useTranslation();
|
|
109474
109628
|
return /* @__PURE__ */ React__default.createElement(Card, {
|
|
109475
109629
|
className: styles$a.sectionCard
|
|
@@ -109496,7 +109650,7 @@ const ShiftsCard = ({ isOpenDrawer, setIsOpenDrawer, data: data2 }) => {
|
|
|
109496
109650
|
}, (_c = (_b = (_a2 = day2 == null ? void 0 : day2.timeslots) == null ? void 0 : _a2[0]) == null ? void 0 : _b.start) != null ? _c : "--", " - ", (_f = (_e2 = (_d = day2 == null ? void 0 : day2.timeslots) == null ? void 0 : _d[0]) == null ? void 0 : _e2.end) != null ? _f : "--"), /* @__PURE__ */ React__default.createElement("p", {
|
|
109497
109651
|
style: { textAlign: "center" }
|
|
109498
109652
|
}, (_i = (_h = (_g = day2 == null ? void 0 : day2.timeslots) == null ? void 0 : _g[1]) == null ? void 0 : _h.start) != null ? _i : "--", " - ", (_l = (_k = (_j = day2 == null ? void 0 : day2.timeslots) == null ? void 0 : _j[1]) == null ? void 0 : _k.end) != null ? _l : "--")));
|
|
109499
|
-
}))), /* @__PURE__ */ React__default.createElement("div", {
|
|
109653
|
+
}))), canEdit && /* @__PURE__ */ React__default.createElement("div", {
|
|
109500
109654
|
className: styles$a.cardFooter
|
|
109501
109655
|
}, /* @__PURE__ */ React__default.createElement("hr", null), /* @__PURE__ */ React__default.createElement("div", {
|
|
109502
109656
|
className: styles$a.cardFooterContent,
|
|
@@ -109661,7 +109815,7 @@ const ShiftsEditDrawer = ({ isOpen, setIsOpen, venueId, data: data2, reload }) =
|
|
|
109661
109815
|
onClick: () => onSubmit()
|
|
109662
109816
|
}, t2("SAVE")))));
|
|
109663
109817
|
};
|
|
109664
|
-
const index$5 = ({ venueId }) => {
|
|
109818
|
+
const index$5 = ({ venueId, canEdit }) => {
|
|
109665
109819
|
const [isOpenDrawer, setIsOpenDrawer] = useState(false);
|
|
109666
109820
|
const weekdayOrder = ["monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday"];
|
|
109667
109821
|
const { data: data2, isLoading, error: error3, reload } = useFetch(GetOpeningHours, { cacheId: "shifts0management", venue_id: venueId });
|
|
@@ -109680,7 +109834,8 @@ const index$5 = ({ venueId }) => {
|
|
|
109680
109834
|
}, /* @__PURE__ */ React__default.createElement(ShiftsCard, {
|
|
109681
109835
|
isOpenDrawer,
|
|
109682
109836
|
setIsOpenDrawer,
|
|
109683
|
-
data: formatedData
|
|
109837
|
+
data: formatedData,
|
|
109838
|
+
canEdit
|
|
109684
109839
|
}), /* @__PURE__ */ React__default.createElement(ShiftsEditDrawer, {
|
|
109685
109840
|
data: formatedData,
|
|
109686
109841
|
isOpen: isOpenDrawer,
|
|
@@ -109689,7 +109844,7 @@ const index$5 = ({ venueId }) => {
|
|
|
109689
109844
|
reload
|
|
109690
109845
|
}));
|
|
109691
109846
|
};
|
|
109692
|
-
const ReservationPreferencesCard = ({ isOpenDrawer, setIsOpenDrawer, data: data2 }) => {
|
|
109847
|
+
const ReservationPreferencesCard = ({ isOpenDrawer, setIsOpenDrawer, data: data2, canEdit }) => {
|
|
109693
109848
|
const { t: t2 } = useTranslation();
|
|
109694
109849
|
return /* @__PURE__ */ React__default.createElement(Card, {
|
|
109695
109850
|
className: styles$a.sectionCard
|
|
@@ -109715,7 +109870,7 @@ const ReservationPreferencesCard = ({ isOpenDrawer, setIsOpenDrawer, data: data2
|
|
|
109715
109870
|
style: { fontWeight: "bold" }
|
|
109716
109871
|
}, t2("TIMEOFFSETTOMEALTIME")), /* @__PURE__ */ React__default.createElement("p", {
|
|
109717
109872
|
style: { textAlign: "left" }
|
|
109718
|
-
}, data2 == null ? void 0 : data2.slotDuration, " min")))), /* @__PURE__ */ React__default.createElement("div", {
|
|
109873
|
+
}, data2 == null ? void 0 : data2.slotDuration, " min")))), canEdit && /* @__PURE__ */ React__default.createElement("div", {
|
|
109719
109874
|
className: styles$a.cardFooter
|
|
109720
109875
|
}, /* @__PURE__ */ React__default.createElement("hr", null), /* @__PURE__ */ React__default.createElement("div", {
|
|
109721
109876
|
className: styles$a.cardFooterContent,
|
|
@@ -109815,7 +109970,7 @@ const ReservationPreferencesEditDrawer = ({ isOpen, setIsOpen, venueId, data: da
|
|
|
109815
109970
|
onClick: () => onSubmit()
|
|
109816
109971
|
}, t2("SAVE")))));
|
|
109817
109972
|
};
|
|
109818
|
-
const index$4 = ({ venueId }) => {
|
|
109973
|
+
const index$4 = ({ venueId, canEdit }) => {
|
|
109819
109974
|
const [isOpenDrawer, setIsOpenDrawer] = useState(false);
|
|
109820
109975
|
const { data: data2, isLoading, error: error3, reload } = useFetch(GetArrivalRules, { cacheId: "bookingArrivalRules", venue_id: venueId });
|
|
109821
109976
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
@@ -109823,7 +109978,8 @@ const index$4 = ({ venueId }) => {
|
|
|
109823
109978
|
}, /* @__PURE__ */ React__default.createElement(ReservationPreferencesCard, {
|
|
109824
109979
|
isOpenDrawer,
|
|
109825
109980
|
setIsOpenDrawer,
|
|
109826
|
-
data: data2
|
|
109981
|
+
data: data2,
|
|
109982
|
+
canEdit
|
|
109827
109983
|
}), /* @__PURE__ */ React__default.createElement(ReservationPreferencesEditDrawer, {
|
|
109828
109984
|
data: data2,
|
|
109829
109985
|
isOpen: isOpenDrawer,
|
|
@@ -109861,9 +110017,17 @@ const formatVenueData = (data2) => {
|
|
|
109861
110017
|
return { bookableAreas: data2.bookableAreas };
|
|
109862
110018
|
};
|
|
109863
110019
|
function Main$1({ venueId }) {
|
|
110020
|
+
var _a2;
|
|
109864
110021
|
const { t: t2 } = useTranslation();
|
|
109865
110022
|
const [currentVenue, setCurrentVenue] = useState(null);
|
|
110023
|
+
const [canEdit, setCanEdit] = useState(false);
|
|
109866
110024
|
const { data: data2, isLoading, error: error3, reload } = useFetch(GetAreaManagement, { cacheId: "area0management", venue_id: currentVenue });
|
|
110025
|
+
const roles = (_a2 = userData == null ? void 0 : userData.roles) != null ? _a2 : [];
|
|
110026
|
+
useEffect(() => {
|
|
110027
|
+
if (!roles.includes("COMPANY_USER")) {
|
|
110028
|
+
setCanEdit(true);
|
|
110029
|
+
}
|
|
110030
|
+
}, [roles]);
|
|
109867
110031
|
useEffect(() => {
|
|
109868
110032
|
setCurrentVenue(venueId);
|
|
109869
110033
|
}, [venueId]);
|
|
@@ -109876,20 +110040,26 @@ function Main$1({ venueId }) {
|
|
|
109876
110040
|
}, /* @__PURE__ */ React__default.createElement(index$9, {
|
|
109877
110041
|
areas: data2,
|
|
109878
110042
|
reloadAreas: reload,
|
|
109879
|
-
venueId: currentVenue
|
|
110043
|
+
venueId: currentVenue,
|
|
110044
|
+
canEdit
|
|
109880
110045
|
}), /* @__PURE__ */ React__default.createElement(index$8, {
|
|
109881
110046
|
areas: data2,
|
|
109882
|
-
venueId: currentVenue
|
|
110047
|
+
venueId: currentVenue,
|
|
110048
|
+
canEdit
|
|
109883
110049
|
}), /* @__PURE__ */ React__default.createElement(index$7, {
|
|
109884
|
-
venueId: currentVenue
|
|
110050
|
+
venueId: currentVenue,
|
|
110051
|
+
canEdit
|
|
109885
110052
|
})), /* @__PURE__ */ React__default.createElement("div", {
|
|
109886
110053
|
className: styles$a.content
|
|
109887
110054
|
}, /* @__PURE__ */ React__default.createElement(index$5, {
|
|
109888
|
-
venueId: currentVenue
|
|
110055
|
+
venueId: currentVenue,
|
|
110056
|
+
canEdit
|
|
109889
110057
|
}), /* @__PURE__ */ React__default.createElement(index$6, {
|
|
109890
|
-
venueId: currentVenue
|
|
110058
|
+
venueId: currentVenue,
|
|
110059
|
+
canEdit
|
|
109891
110060
|
}), /* @__PURE__ */ React__default.createElement(index$4, {
|
|
109892
|
-
venueId: currentVenue
|
|
110061
|
+
venueId: currentVenue,
|
|
110062
|
+
canEdit
|
|
109893
110063
|
})));
|
|
109894
110064
|
}
|
|
109895
110065
|
const mainConatiner = "_mainConatiner_kqq6g_70";
|
|
@@ -109928,7 +110098,7 @@ var styles$7 = {
|
|
|
109928
110098
|
scrollableForm,
|
|
109929
110099
|
fixedActions
|
|
109930
110100
|
};
|
|
109931
|
-
const EmailsCard = ({ isOpenDrawer, setIsOpenDrawer, data: data2 }) => {
|
|
110101
|
+
const EmailsCard = ({ isOpenDrawer, setIsOpenDrawer, data: data2, canEdit }) => {
|
|
109932
110102
|
var _a2;
|
|
109933
110103
|
const { t: t2 } = useTranslation();
|
|
109934
110104
|
return /* @__PURE__ */ React__default.createElement(Card, {
|
|
@@ -109951,7 +110121,7 @@ const EmailsCard = ({ isOpenDrawer, setIsOpenDrawer, data: data2 }) => {
|
|
|
109951
110121
|
style: { display: "flex", alignItems: "center<", gap: 10 }
|
|
109952
110122
|
}, /* @__PURE__ */ React__default.createElement("div", null, /* @__PURE__ */ React__default.createElement(Icon, {
|
|
109953
110123
|
icon: "mail"
|
|
109954
|
-
})), t2("NOTDEFINED"))), /* @__PURE__ */ React__default.createElement("div", {
|
|
110124
|
+
})), t2("NOTDEFINED"))), canEdit && /* @__PURE__ */ React__default.createElement("div", {
|
|
109955
110125
|
className: styles$7.cardFooter
|
|
109956
110126
|
}, /* @__PURE__ */ React__default.createElement("hr", null), /* @__PURE__ */ React__default.createElement("div", {
|
|
109957
110127
|
className: styles$7.cardFooterContent,
|
|
@@ -110045,14 +110215,15 @@ const EmailEditDrawer = ({ isOpen, setIsOpen, venueId, data: data2, reload }) =>
|
|
|
110045
110215
|
onClick: () => onSubmit()
|
|
110046
110216
|
}, t2("SAVE")))));
|
|
110047
110217
|
};
|
|
110048
|
-
const index$3 = ({ venueId, data: data2, reload }) => {
|
|
110218
|
+
const index$3 = ({ venueId, data: data2, reload, canEdit }) => {
|
|
110049
110219
|
const [isOpenDrawer, setIsOpenDrawer] = useState(false);
|
|
110050
110220
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
110051
110221
|
className: styles$7.sectionManagement
|
|
110052
110222
|
}, /* @__PURE__ */ React__default.createElement(EmailsCard, {
|
|
110053
110223
|
isOpenDrawer,
|
|
110054
110224
|
setIsOpenDrawer,
|
|
110055
|
-
data: data2
|
|
110225
|
+
data: data2,
|
|
110226
|
+
canEdit
|
|
110056
110227
|
}), /* @__PURE__ */ React__default.createElement(EmailEditDrawer, {
|
|
110057
110228
|
data: data2,
|
|
110058
110229
|
isOpen: isOpenDrawer,
|
|
@@ -110061,7 +110232,7 @@ const index$3 = ({ venueId, data: data2, reload }) => {
|
|
|
110061
110232
|
reload
|
|
110062
110233
|
}));
|
|
110063
110234
|
};
|
|
110064
|
-
const ReservationsCard = ({ data: data2, reload }) => {
|
|
110235
|
+
const ReservationsCard = ({ data: data2, reload, canEdit }) => {
|
|
110065
110236
|
const { t: t2 } = useTranslation();
|
|
110066
110237
|
const { isExecuting, execute } = useService(UpdateUserNotificationSettings, {
|
|
110067
110238
|
onSuccess: async () => {
|
|
@@ -110108,6 +110279,7 @@ const ReservationsCard = ({ data: data2, reload }) => {
|
|
|
110108
110279
|
id: "bookingCreation",
|
|
110109
110280
|
name: "bookingCreation",
|
|
110110
110281
|
label: t2("NEWBOOKINGS"),
|
|
110282
|
+
disabled: !canEdit,
|
|
110111
110283
|
onChangeEvent: (e3) => {
|
|
110112
110284
|
execute({ data: { ...getValues(), bookingCreation: e3.target.checked } });
|
|
110113
110285
|
}
|
|
@@ -110116,6 +110288,7 @@ const ReservationsCard = ({ data: data2, reload }) => {
|
|
|
110116
110288
|
id: "bookingAmendment",
|
|
110117
110289
|
name: "bookingAmendment",
|
|
110118
110290
|
label: t2("BOOKINGAMEND"),
|
|
110291
|
+
disabled: !canEdit,
|
|
110119
110292
|
onChangeEvent: (e3) => {
|
|
110120
110293
|
execute({ data: { ...getValues(), bookingAmendment: e3.target.checked } });
|
|
110121
110294
|
}
|
|
@@ -110124,20 +110297,22 @@ const ReservationsCard = ({ data: data2, reload }) => {
|
|
|
110124
110297
|
id: "bookingCancellation",
|
|
110125
110298
|
name: "bookingCancellation",
|
|
110126
110299
|
label: t2("CANCELLATIONS"),
|
|
110300
|
+
disabled: !canEdit,
|
|
110127
110301
|
onChangeEvent: (e3) => {
|
|
110128
110302
|
execute({ data: { ...getValues(), bookingCancellation: e3.target.checked } });
|
|
110129
110303
|
}
|
|
110130
110304
|
}))));
|
|
110131
110305
|
};
|
|
110132
|
-
const index$2 = ({ venueId, data: data2, reload }) => {
|
|
110306
|
+
const index$2 = ({ venueId, data: data2, reload, canEdit }) => {
|
|
110133
110307
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
110134
110308
|
className: styles$7.sectionManagement
|
|
110135
110309
|
}, /* @__PURE__ */ React__default.createElement(ReservationsCard, {
|
|
110136
110310
|
data: data2,
|
|
110137
|
-
reload
|
|
110311
|
+
reload,
|
|
110312
|
+
canEdit
|
|
110138
110313
|
}));
|
|
110139
110314
|
};
|
|
110140
|
-
const ReviewsCard = ({ data: data2, reload }) => {
|
|
110315
|
+
const ReviewsCard = ({ data: data2, reload, canEdit }) => {
|
|
110141
110316
|
const { t: t2 } = useTranslation();
|
|
110142
110317
|
const { isExecuting, execute } = useService(UpdateUserNotificationSettings, {
|
|
110143
110318
|
onSuccess: async () => {
|
|
@@ -110183,6 +110358,7 @@ const ReviewsCard = ({ data: data2, reload }) => {
|
|
|
110183
110358
|
id: "allReviewAlert",
|
|
110184
110359
|
name: "allReviewAlert",
|
|
110185
110360
|
label: t2("ALLREVIEWS"),
|
|
110361
|
+
disabled: !canEdit,
|
|
110186
110362
|
onChangeEvent: (e3) => {
|
|
110187
110363
|
execute({ data: { ...getValues(), allReviewAlert: e3.target.checked } });
|
|
110188
110364
|
}
|
|
@@ -110191,20 +110367,22 @@ const ReviewsCard = ({ data: data2, reload }) => {
|
|
|
110191
110367
|
id: "negativeReviewAlert",
|
|
110192
110368
|
name: "negativeReviewAlert",
|
|
110193
110369
|
label: t2("NEGATIVEREVIEWS1"),
|
|
110370
|
+
disabled: !canEdit,
|
|
110194
110371
|
onChangeEvent: (e3) => {
|
|
110195
110372
|
execute({ data: { ...getValues(), negativeReviewAlert: e3.target.checked } });
|
|
110196
110373
|
}
|
|
110197
110374
|
}))));
|
|
110198
110375
|
};
|
|
110199
|
-
const index$1 = ({ venueId, data: data2, reload }) => {
|
|
110376
|
+
const index$1 = ({ venueId, data: data2, reload, canEdit }) => {
|
|
110200
110377
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
110201
110378
|
className: styles$7.sectionManagement
|
|
110202
110379
|
}, /* @__PURE__ */ React__default.createElement(ReviewsCard, {
|
|
110203
110380
|
data: data2,
|
|
110204
|
-
reload
|
|
110381
|
+
reload,
|
|
110382
|
+
canEdit
|
|
110205
110383
|
}));
|
|
110206
110384
|
};
|
|
110207
|
-
const ReviewsReportCard = ({ data: data2, reload }) => {
|
|
110385
|
+
const ReviewsReportCard = ({ data: data2, reload, canEdit }) => {
|
|
110208
110386
|
const { t: t2 } = useTranslation();
|
|
110209
110387
|
const { isExecuting, execute } = useService(UpdateUserNotificationSettings, {
|
|
110210
110388
|
onSuccess: async () => {
|
|
@@ -110248,6 +110426,7 @@ const ReviewsReportCard = ({ data: data2, reload }) => {
|
|
|
110248
110426
|
style: { display: "flex", flexDirection: "column", gap: 20 }
|
|
110249
110427
|
}, /* @__PURE__ */ React__default.createElement(SwitchField, {
|
|
110250
110428
|
control,
|
|
110429
|
+
disabled: !canEdit,
|
|
110251
110430
|
id: "dailyReport",
|
|
110252
110431
|
name: "dailyReport",
|
|
110253
110432
|
label: t2("DAILYREPORT"),
|
|
@@ -110256,6 +110435,7 @@ const ReviewsReportCard = ({ data: data2, reload }) => {
|
|
|
110256
110435
|
}
|
|
110257
110436
|
}), /* @__PURE__ */ React__default.createElement(SwitchField, {
|
|
110258
110437
|
control,
|
|
110438
|
+
disabled: !canEdit,
|
|
110259
110439
|
id: "weeklyReport",
|
|
110260
110440
|
name: "weeklyReport",
|
|
110261
110441
|
label: t2("WEEKLYREPORT"),
|
|
@@ -110264,6 +110444,7 @@ const ReviewsReportCard = ({ data: data2, reload }) => {
|
|
|
110264
110444
|
}
|
|
110265
110445
|
}), /* @__PURE__ */ React__default.createElement(SwitchField, {
|
|
110266
110446
|
control,
|
|
110447
|
+
disabled: !canEdit,
|
|
110267
110448
|
id: "monthlyReport",
|
|
110268
110449
|
name: "monthlyReport",
|
|
110269
110450
|
label: t2("MONTHLYREPORT"),
|
|
@@ -110272,23 +110453,32 @@ const ReviewsReportCard = ({ data: data2, reload }) => {
|
|
|
110272
110453
|
}
|
|
110273
110454
|
}))));
|
|
110274
110455
|
};
|
|
110275
|
-
const index = ({ venueId, data: data2, reload }) => {
|
|
110456
|
+
const index = ({ venueId, data: data2, reload, canEdit }) => {
|
|
110276
110457
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
110277
110458
|
className: styles$7.sectionManagement
|
|
110278
110459
|
}, /* @__PURE__ */ React__default.createElement(ReviewsReportCard, {
|
|
110279
110460
|
data: data2,
|
|
110280
|
-
reload
|
|
110461
|
+
reload,
|
|
110462
|
+
canEdit
|
|
110281
110463
|
}));
|
|
110282
110464
|
};
|
|
110283
110465
|
function Main({ venueId }) {
|
|
110466
|
+
var _a2;
|
|
110284
110467
|
const { t: t2 } = useTranslation();
|
|
110285
110468
|
const [currentVenue, setCurrentVenue] = useState(null);
|
|
110469
|
+
const [canEdit, setCanEdit] = useState(false);
|
|
110470
|
+
const roles = (_a2 = userData == null ? void 0 : userData.roles) != null ? _a2 : [];
|
|
110286
110471
|
const { data: data2, isLoading, error: error3, reload } = useFetch(
|
|
110287
110472
|
GetUserNotificationSettings,
|
|
110288
110473
|
{
|
|
110289
110474
|
cacheId: `user-notifications-settings`
|
|
110290
110475
|
}
|
|
110291
110476
|
);
|
|
110477
|
+
useEffect(() => {
|
|
110478
|
+
if (!roles.includes("COMPANY_USER")) {
|
|
110479
|
+
setCanEdit(true);
|
|
110480
|
+
}
|
|
110481
|
+
}, [roles]);
|
|
110292
110482
|
useEffect(() => {
|
|
110293
110483
|
setCurrentVenue(venueId);
|
|
110294
110484
|
}, [venueId]);
|
|
@@ -110301,19 +110491,23 @@ function Main({ venueId }) {
|
|
|
110301
110491
|
}, /* @__PURE__ */ React__default.createElement(index$3, {
|
|
110302
110492
|
venueId: currentVenue,
|
|
110303
110493
|
data: data2,
|
|
110304
|
-
reload
|
|
110494
|
+
reload,
|
|
110495
|
+
canEdit
|
|
110305
110496
|
}), /* @__PURE__ */ React__default.createElement(index$2, {
|
|
110306
110497
|
venueId: currentVenue,
|
|
110307
110498
|
data: data2,
|
|
110308
|
-
reload
|
|
110499
|
+
reload,
|
|
110500
|
+
canEdit
|
|
110309
110501
|
}), /* @__PURE__ */ React__default.createElement(index$1, {
|
|
110310
110502
|
venueId: currentVenue,
|
|
110311
110503
|
data: data2,
|
|
110312
|
-
reload
|
|
110504
|
+
reload,
|
|
110505
|
+
canEdit
|
|
110313
110506
|
}), /* @__PURE__ */ React__default.createElement(index, {
|
|
110314
110507
|
venueId: currentVenue,
|
|
110315
110508
|
data: data2,
|
|
110316
|
-
reload
|
|
110509
|
+
reload,
|
|
110510
|
+
canEdit
|
|
110317
110511
|
})));
|
|
110318
110512
|
}
|
|
110319
110513
|
const defaultValue = {
|