mozrest-sdk-react-dev 0.2.82 → 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 +520 -250
- 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", {
|
|
@@ -77091,7 +77093,7 @@ var styles$1u = {
|
|
|
77091
77093
|
spinner,
|
|
77092
77094
|
spin
|
|
77093
77095
|
};
|
|
77094
|
-
const Spinner = ({ size = 20, color: color2 = "black" }) => {
|
|
77096
|
+
const Spinner$1 = ({ size = 20, color: color2 = "black" }) => {
|
|
77095
77097
|
const spinnerStyle = {
|
|
77096
77098
|
width: size,
|
|
77097
77099
|
height: size,
|
|
@@ -77124,7 +77126,7 @@ const StatsCard = ({
|
|
|
77124
77126
|
if (loadingValue) {
|
|
77125
77127
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
77126
77128
|
style: { marginTop: 20, marginBottom: 30 }
|
|
77127
|
-
}, /* @__PURE__ */ React__default.createElement(Spinner, {
|
|
77129
|
+
}, /* @__PURE__ */ React__default.createElement(Spinner$1, {
|
|
77128
77130
|
size: 50
|
|
77129
77131
|
}));
|
|
77130
77132
|
}
|
|
@@ -77154,7 +77156,7 @@ const StatsCard = ({
|
|
|
77154
77156
|
})
|
|
77155
77157
|
}, comparison2 !== 0 ? arrow : /* @__PURE__ */ React__default.createElement("span", {
|
|
77156
77158
|
style: { height: 20 }
|
|
77157
|
-
}), !loadingComparison ? /* @__PURE__ */ React__default.createElement("span", null, comparison2 === 0 ? "" : `${comparison2} %`) : /* @__PURE__ */ React__default.createElement(Spinner, {
|
|
77159
|
+
}), !loadingComparison ? /* @__PURE__ */ React__default.createElement("span", null, comparison2 === 0 ? "" : `${comparison2} %`) : /* @__PURE__ */ React__default.createElement(Spinner$1, {
|
|
77158
77160
|
size: 15
|
|
77159
77161
|
})), children) : /* @__PURE__ */ React__default.createElement(SkeletonStatCard, null));
|
|
77160
77162
|
};
|
|
@@ -77474,7 +77476,7 @@ const Param = ({
|
|
|
77474
77476
|
className: styles$1s.param
|
|
77475
77477
|
}, /* @__PURE__ */ React__default.createElement("span", {
|
|
77476
77478
|
className: styles$1s.title
|
|
77477
|
-
}, title2, tooltip2 && /* @__PURE__ */ React__default.createElement(Tooltip$2, null, tooltip2)), loadingValue ? /* @__PURE__ */ React__default.createElement(Spinner, {
|
|
77479
|
+
}, title2, tooltip2 && /* @__PURE__ */ React__default.createElement(Tooltip$2, null, tooltip2)), loadingValue ? /* @__PURE__ */ React__default.createElement(Spinner$1, {
|
|
77478
77480
|
size: 15
|
|
77479
77481
|
}) : /* @__PURE__ */ React__default.createElement("span", null, value2));
|
|
77480
77482
|
const ParamsList = ({ params }) => {
|
|
@@ -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
|
{
|
|
@@ -96415,7 +96416,7 @@ const GetOpeningHours = async ({
|
|
|
96415
96416
|
venue_id
|
|
96416
96417
|
}) => {
|
|
96417
96418
|
try {
|
|
96418
|
-
const responseData = await instance$1.get(`/resbook/venue/${venue_id}/opening-hours`);
|
|
96419
|
+
const responseData = await instance$1.get(`/resbook/venue/${venue_id}/opening-hours?limit=100`);
|
|
96419
96420
|
if (!responseData || typeof responseData !== "object") {
|
|
96420
96421
|
console.error("Error fetching opening hours data: Invalid response data");
|
|
96421
96422
|
return [];
|
|
@@ -97071,7 +97072,8 @@ const GetTableManagement = async ({
|
|
|
97071
97072
|
`resbook/venue/${venue_id}/tables`,
|
|
97072
97073
|
{
|
|
97073
97074
|
params: {
|
|
97074
|
-
"sortby[
|
|
97075
|
+
"sortby[name]": "ASC",
|
|
97076
|
+
limit: 100
|
|
97075
97077
|
}
|
|
97076
97078
|
}
|
|
97077
97079
|
);
|
|
@@ -97270,7 +97272,7 @@ const GetArrivalRules = async ({
|
|
|
97270
97272
|
venue_id
|
|
97271
97273
|
}) => {
|
|
97272
97274
|
const responseData = await instance$1.get(
|
|
97273
|
-
`/resbook/venue/${venue_id}/arrival-rules`
|
|
97275
|
+
`/resbook/venue/${venue_id}/arrival-rules?limit=100`
|
|
97274
97276
|
);
|
|
97275
97277
|
const data2 = responseData.data;
|
|
97276
97278
|
return formatData$4(data2);
|
|
@@ -97550,7 +97552,7 @@ const GetSpecialDates = async ({
|
|
|
97550
97552
|
venue_id
|
|
97551
97553
|
}) => {
|
|
97552
97554
|
const responseData = await instance$1.get(
|
|
97553
|
-
`/resbook/venue/${venue_id}/special-dates`
|
|
97555
|
+
`/resbook/venue/${venue_id}/special-dates?limit=100`
|
|
97554
97556
|
);
|
|
97555
97557
|
const data2 = responseData.data;
|
|
97556
97558
|
return formatData$3(data2);
|
|
@@ -98627,10 +98629,10 @@ const GetCreateBookingSelectsData = async ({
|
|
|
98627
98629
|
}) => {
|
|
98628
98630
|
if (!venue_id)
|
|
98629
98631
|
return;
|
|
98630
|
-
const responseVenueData = await instance$1.get(`/v1/rms/venues/${venue_id}`);
|
|
98631
|
-
const responseAreas = await instance$1.get(`/v1/rms/venues/${venue_id}/areas`);
|
|
98632
|
-
const responseHours = await instance$1.get(`/resbook/venue/${venue_id}/opening-hours`);
|
|
98633
|
-
const responseTables = await instance$1.get(`/resbook/venue/${venue_id}/tables?sortby[orderPriority]=ASC`);
|
|
98632
|
+
const responseVenueData = await instance$1.get(`/v1/rms/venues/${venue_id}?limit=100`);
|
|
98633
|
+
const responseAreas = await instance$1.get(`/v1/rms/venues/${venue_id}/areas?limit=100`);
|
|
98634
|
+
const responseHours = await instance$1.get(`/resbook/venue/${venue_id}/opening-hours?limit=100`);
|
|
98635
|
+
const responseTables = await instance$1.get(`/resbook/venue/${venue_id}/tables?sortby[orderPriority]=ASC&limit=100`);
|
|
98634
98636
|
const responseChannels = await instance$1.get(`/resbook/smart-channels`);
|
|
98635
98637
|
const data2 = {
|
|
98636
98638
|
partySizes: formatPartySizeData(responseVenueData),
|
|
@@ -100196,7 +100198,7 @@ const GetTableAvailability = async ({
|
|
|
100196
100198
|
const responseData = await instance$1.get(
|
|
100197
100199
|
`/resbook/venue/${venue_id}/table-availablity`,
|
|
100198
100200
|
{
|
|
100199
|
-
params: { ...params, limit: 100 }
|
|
100201
|
+
params: { ...params, "sortby[orderPriority]": "ASC", limit: 100 }
|
|
100200
100202
|
}
|
|
100201
100203
|
);
|
|
100202
100204
|
const data2 = responseData != null ? responseData : [];
|
|
@@ -103092,56 +103094,61 @@ const ReservationsAnalytics = ({ userEmail, userFullName }) => {
|
|
|
103092
103094
|
totalDays
|
|
103093
103095
|
}));
|
|
103094
103096
|
};
|
|
103095
|
-
const mainConatiner$2 = "
|
|
103096
|
-
const mainTableContainer = "
|
|
103097
|
-
const mainSidebarContainer = "
|
|
103098
|
-
const sidebarCloseIcon = "
|
|
103099
|
-
const headerContainer = "
|
|
103100
|
-
const searchContainer = "
|
|
103101
|
-
const buttonList = "
|
|
103102
|
-
const buttonItem = "
|
|
103103
|
-
const
|
|
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
|
|
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";
|
|
103128
103133
|
var styles$l = {
|
|
103129
103134
|
mainConatiner: mainConatiner$2,
|
|
103130
103135
|
mainTableContainer,
|
|
103131
103136
|
mainSidebarContainer,
|
|
103132
103137
|
sidebarCloseIcon,
|
|
103133
|
-
"mainSidebarContainer--open": "_mainSidebarContainer--
|
|
103134
|
-
"mainSidebarContainer--close": "_mainSidebarContainer--
|
|
103135
|
-
"sidebarCloseIcon--show": "_sidebarCloseIcon--
|
|
103138
|
+
"mainSidebarContainer--open": "_mainSidebarContainer--open_1mwxr_84",
|
|
103139
|
+
"mainSidebarContainer--close": "_mainSidebarContainer--close_1mwxr_90",
|
|
103140
|
+
"sidebarCloseIcon--show": "_sidebarCloseIcon--show_1mwxr_98",
|
|
103136
103141
|
headerContainer,
|
|
103137
103142
|
searchContainer,
|
|
103138
103143
|
buttonList,
|
|
103139
103144
|
buttonItem,
|
|
103145
|
+
addReservationButton,
|
|
103140
103146
|
tableTopHeader,
|
|
103141
103147
|
tableTopHeaderContent,
|
|
103142
103148
|
tableTopHeaderContentText,
|
|
103143
103149
|
tableRowContainer,
|
|
103144
103150
|
tableRowCard,
|
|
103151
|
+
fadeInX,
|
|
103145
103152
|
noData,
|
|
103146
103153
|
tableRowHour,
|
|
103147
103154
|
tableRowHourText,
|
|
@@ -103152,6 +103159,7 @@ var styles$l = {
|
|
|
103152
103159
|
rowContactText,
|
|
103153
103160
|
rowContactPhone,
|
|
103154
103161
|
rowSectionContainer,
|
|
103162
|
+
rowSection,
|
|
103155
103163
|
rowSectionText,
|
|
103156
103164
|
rowSectionSecText,
|
|
103157
103165
|
rowActionButton,
|
|
@@ -103163,6 +103171,47 @@ var styles$l = {
|
|
|
103163
103171
|
bookingInfoCardTitle,
|
|
103164
103172
|
bookingInfoCardText
|
|
103165
103173
|
};
|
|
103174
|
+
const Spinner = () => /* @__PURE__ */ React__default.createElement("svg", {
|
|
103175
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
103176
|
+
width: "24",
|
|
103177
|
+
height: "24",
|
|
103178
|
+
viewBox: "0 0 24 24"
|
|
103179
|
+
}, /* @__PURE__ */ React__default.createElement("rect", {
|
|
103180
|
+
width: "24",
|
|
103181
|
+
height: "24",
|
|
103182
|
+
fill: "none"
|
|
103183
|
+
}), /* @__PURE__ */ React__default.createElement("g", {
|
|
103184
|
+
fill: "none",
|
|
103185
|
+
stroke: "currentColor",
|
|
103186
|
+
strokeLinecap: "round",
|
|
103187
|
+
strokeLinejoin: "round",
|
|
103188
|
+
strokeWidth: "2"
|
|
103189
|
+
}, /* @__PURE__ */ React__default.createElement("path", {
|
|
103190
|
+
strokeDasharray: "16",
|
|
103191
|
+
strokeDashoffset: "16",
|
|
103192
|
+
d: "M12 3c4.97 0 9 4.03 9 9"
|
|
103193
|
+
}, /* @__PURE__ */ React__default.createElement("animate", {
|
|
103194
|
+
fill: "freeze",
|
|
103195
|
+
attributeName: "stroke-dashoffset",
|
|
103196
|
+
dur: "0.3s",
|
|
103197
|
+
values: "16;0"
|
|
103198
|
+
}), /* @__PURE__ */ React__default.createElement("animateTransform", {
|
|
103199
|
+
attributeName: "transform",
|
|
103200
|
+
dur: "1.5s",
|
|
103201
|
+
repeatCount: "indefinite",
|
|
103202
|
+
type: "rotate",
|
|
103203
|
+
values: "0 12 12;360 12 12"
|
|
103204
|
+
})), /* @__PURE__ */ React__default.createElement("path", {
|
|
103205
|
+
strokeDasharray: "64",
|
|
103206
|
+
strokeDashoffset: "64",
|
|
103207
|
+
strokeOpacity: "0.3",
|
|
103208
|
+
d: "M12 3c4.97 0 9 4.03 9 9c0 4.97 -4.03 9 -9 9c-4.97 0 -9 -4.03 -9 -9c0 -4.97 4.03 -9 9 -9Z"
|
|
103209
|
+
}, /* @__PURE__ */ React__default.createElement("animate", {
|
|
103210
|
+
fill: "freeze",
|
|
103211
|
+
attributeName: "stroke-dashoffset",
|
|
103212
|
+
dur: "1.2s",
|
|
103213
|
+
values: "64;0"
|
|
103214
|
+
}))));
|
|
103166
103215
|
const LetterX = () => /* @__PURE__ */ React__default.createElement("svg", {
|
|
103167
103216
|
xmlns: "http://www.w3.org/2000/svg",
|
|
103168
103217
|
width: "24",
|
|
@@ -104556,6 +104605,7 @@ const clock = () => {
|
|
|
104556
104605
|
};
|
|
104557
104606
|
var icons = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
104558
104607
|
__proto__: null,
|
|
104608
|
+
Spinner,
|
|
104559
104609
|
LetterX,
|
|
104560
104610
|
TrashX,
|
|
104561
104611
|
EyeOff,
|
|
@@ -104636,14 +104686,14 @@ var icons = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty(
|
|
|
104636
104686
|
people,
|
|
104637
104687
|
clock
|
|
104638
104688
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
104639
|
-
const icon$2 = "
|
|
104689
|
+
const icon$2 = "_icon_lm3br_1";
|
|
104640
104690
|
var styles$k = {
|
|
104641
104691
|
icon: icon$2,
|
|
104642
|
-
"icon--xs": "_icon--
|
|
104643
|
-
"icon--small": "_icon--
|
|
104644
|
-
"icon--medium": "_icon--
|
|
104645
|
-
"icon--large": "_icon--
|
|
104646
|
-
"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"
|
|
104647
104697
|
};
|
|
104648
104698
|
const Icon = ({
|
|
104649
104699
|
size = "medium",
|
|
@@ -106810,9 +106860,17 @@ const useSelectedBookingContext = () => {
|
|
|
106810
106860
|
return useContext(SelectedBookingContext);
|
|
106811
106861
|
};
|
|
106812
106862
|
const SelectedBookingProvider = ({ children }) => {
|
|
106863
|
+
var _a2;
|
|
106813
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]);
|
|
106814
106872
|
return /* @__PURE__ */ React__default.createElement(SelectedBookingContext.Provider, {
|
|
106815
|
-
value: { selectedBooking, setSelectedBooking }
|
|
106873
|
+
value: { selectedBooking, setSelectedBooking, canEdit }
|
|
106816
106874
|
}, children);
|
|
106817
106875
|
};
|
|
106818
106876
|
const debounce = (func, delay) => {
|
|
@@ -106832,10 +106890,137 @@ const ShowSidebarProvider = ({ children }) => {
|
|
|
106832
106890
|
value: { showSidebar, setShowSidebar }
|
|
106833
106891
|
}, children);
|
|
106834
106892
|
};
|
|
106835
|
-
|
|
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 }) => {
|
|
106836
107020
|
const { t: t2 } = useTranslation();
|
|
106837
107021
|
const { showSidebar, setShowSidebar } = useShowSidebarContext();
|
|
106838
|
-
const { selectedBooking, setSelectedBooking } = useSelectedBookingContext();
|
|
107022
|
+
const { selectedBooking, setSelectedBooking, canEdit } = useSelectedBookingContext();
|
|
107023
|
+
const [showExportBookingConfirmationModal, setShowExportBookingConfirmationModal] = useState(false);
|
|
106839
107024
|
const [datePickerOpen, setDatePickerOpen] = useState(false);
|
|
106840
107025
|
const datePickerRef = useRef(null);
|
|
106841
107026
|
const defaultValue2 = {
|
|
@@ -106955,7 +107140,7 @@ const index$c = ({ filters: filters2, setFilters }) => {
|
|
|
106955
107140
|
className: styles$l.buttonItem,
|
|
106956
107141
|
onClick: () => selectDate("tomorrow")
|
|
106957
107142
|
}, t2("TOMORROW")), /* @__PURE__ */ React__default.createElement("div", {
|
|
106958
|
-
style: { display: "flex",
|
|
107143
|
+
style: { display: "flex", gap: 5, justifyContent: "center", alignItems: "center" }
|
|
106959
107144
|
}, /* @__PURE__ */ React__default.createElement(Button, {
|
|
106960
107145
|
mode: "primary",
|
|
106961
107146
|
onClick: () => setDatePickerOpen(true)
|
|
@@ -106993,17 +107178,39 @@ const index$c = ({ filters: filters2, setFilters }) => {
|
|
|
106993
107178
|
setDatePickerOpen(false);
|
|
106994
107179
|
}
|
|
106995
107180
|
}, t2("TOMORROW")))
|
|
106996
|
-
})
|
|
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,
|
|
106997
107189
|
mode: "success",
|
|
106998
107190
|
onClick: () => {
|
|
106999
107191
|
setSelectedBooking(null);
|
|
107000
107192
|
setShowSidebar(true);
|
|
107001
107193
|
}
|
|
107002
|
-
}, 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
|
+
}));
|
|
107003
107206
|
};
|
|
107004
107207
|
const injectStyles = () => {
|
|
107005
107208
|
const styleElement = document.createElement("style");
|
|
107006
107209
|
styleElement.innerHTML = `
|
|
107210
|
+
.ant-picker-range {
|
|
107211
|
+
background-color: #3A3D54 !important;
|
|
107212
|
+
}
|
|
107213
|
+
|
|
107007
107214
|
.ant-picker-panel {
|
|
107008
107215
|
background-color: #2F3349 !important;
|
|
107009
107216
|
border-radius: 6px !important;
|
|
@@ -107142,12 +107349,12 @@ const ReloadProvider = ({ children, reload }) => {
|
|
|
107142
107349
|
value: { reload }
|
|
107143
107350
|
}, children);
|
|
107144
107351
|
};
|
|
107145
|
-
const TableRow = ({ item: item2, filtersData, venueId }) => {
|
|
107352
|
+
const TableRow = ({ index: index2, item: item2, filtersData, venueId }) => {
|
|
107146
107353
|
var _a2, _b, _c, _d;
|
|
107147
107354
|
const { t: t2 } = useTranslation();
|
|
107148
107355
|
const { reload: reloadMainTable } = useReloadContext();
|
|
107149
107356
|
const { showSidebar, setShowSidebar } = useShowSidebarContext();
|
|
107150
|
-
const { selectedBooking, setSelectedBooking } = useSelectedBookingContext();
|
|
107357
|
+
const { selectedBooking, setSelectedBooking, canEdit } = useSelectedBookingContext();
|
|
107151
107358
|
const { execute } = useService(UpdateBookingStatusBooking, {
|
|
107152
107359
|
onSuccess: async () => {
|
|
107153
107360
|
reloadMainTable();
|
|
@@ -107210,12 +107417,17 @@ const TableRow = ({ item: item2, filtersData, venueId }) => {
|
|
|
107210
107417
|
}
|
|
107211
107418
|
};
|
|
107212
107419
|
return /* @__PURE__ */ React__default.createElement(Card, {
|
|
107213
|
-
className: styles$l.tableRowCard
|
|
107420
|
+
className: styles$l.tableRowCard,
|
|
107421
|
+
style: {
|
|
107422
|
+
animationDelay: `${index2 * 0.2}s`
|
|
107423
|
+
}
|
|
107214
107424
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
107215
|
-
style: { display: "flex", cursor: "pointer" },
|
|
107425
|
+
style: { display: "flex", cursor: window.innerWidth > 768 ? "pointer" : "default" },
|
|
107216
107426
|
onClick: () => {
|
|
107217
|
-
|
|
107218
|
-
|
|
107427
|
+
if (window.innerWidth > 768) {
|
|
107428
|
+
setSelectedBooking(item2);
|
|
107429
|
+
setShowSidebar(true);
|
|
107430
|
+
}
|
|
107219
107431
|
}
|
|
107220
107432
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
107221
107433
|
className: styles$l.tableRowHour
|
|
@@ -107237,17 +107449,19 @@ const TableRow = ({ item: item2, filtersData, venueId }) => {
|
|
|
107237
107449
|
className: styles$l.rowContactPhone
|
|
107238
107450
|
}, (_a2 = item2 == null ? void 0 : item2.contact) == null ? void 0 : _a2.telephone)), /* @__PURE__ */ React__default.createElement("div", {
|
|
107239
107451
|
className: styles$l.rowSectionContainer
|
|
107452
|
+
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
107453
|
+
className: styles$l.rowSection
|
|
107240
107454
|
}, /* @__PURE__ */ React__default.createElement("h4", {
|
|
107241
107455
|
className: styles$l.rowSectionText
|
|
107242
107456
|
}, item2 == null ? void 0 : item2.partySize), /* @__PURE__ */ React__default.createElement("p", {
|
|
107243
107457
|
className: styles$l.rowSectionSecText
|
|
107244
107458
|
}, t2("GUESTS"))), /* @__PURE__ */ React__default.createElement("div", {
|
|
107245
|
-
className: styles$l.
|
|
107459
|
+
className: styles$l.rowSection
|
|
107246
107460
|
}, /* @__PURE__ */ React__default.createElement("h4", {
|
|
107247
107461
|
className: styles$l.rowSectionText
|
|
107248
107462
|
}, (_b = item2 == null ? void 0 : item2.table) == null ? void 0 : _b.name), /* @__PURE__ */ React__default.createElement("p", {
|
|
107249
107463
|
className: styles$l.rowSectionSecText
|
|
107250
|
-
}, (_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", {
|
|
107251
107465
|
className: styles$l.rowActionButton
|
|
107252
107466
|
}, /* @__PURE__ */ React__default.createElement(Button, {
|
|
107253
107467
|
icon: statusBuilder(item2.status).icon,
|
|
@@ -107300,8 +107514,9 @@ const TableBody = ({ data: data2, filtersData, venueId }) => {
|
|
|
107300
107514
|
className: styles$l.tableTopHeaderContentText
|
|
107301
107515
|
}, group.length, " ", t2("RESERVATIONS"))), /* @__PURE__ */ React__default.createElement("div", {
|
|
107302
107516
|
className: styles$l.tableRowContainer
|
|
107303
|
-
}, group.map((item2) => {
|
|
107517
|
+
}, group.map((item2, index2) => {
|
|
107304
107518
|
return /* @__PURE__ */ React__default.createElement(TableRow, {
|
|
107519
|
+
index: index2,
|
|
107305
107520
|
key: item2.id,
|
|
107306
107521
|
item: item2,
|
|
107307
107522
|
filtersData,
|
|
@@ -107324,7 +107539,7 @@ const index$b = ({ data: data2, filters: filters2, filtersData, venueId }) => {
|
|
|
107324
107539
|
};
|
|
107325
107540
|
const container = "_container_ut3y7_1";
|
|
107326
107541
|
const tooltip = "_tooltip_ut3y7_5";
|
|
107327
|
-
var styles$
|
|
107542
|
+
var styles$c = {
|
|
107328
107543
|
container,
|
|
107329
107544
|
tooltip
|
|
107330
107545
|
};
|
|
@@ -107383,7 +107598,7 @@ const Select = ({
|
|
|
107383
107598
|
...props
|
|
107384
107599
|
}) => {
|
|
107385
107600
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
107386
|
-
className: styles$
|
|
107601
|
+
className: styles$c.container
|
|
107387
107602
|
}, label2 && /* @__PURE__ */ React__default.createElement(Label, {
|
|
107388
107603
|
htmlFor: id2
|
|
107389
107604
|
}, label2), /* @__PURE__ */ React__default.createElement("div", {
|
|
@@ -107414,7 +107629,7 @@ const SelectField = ({ control, name, ...props }) => {
|
|
|
107414
107629
|
});
|
|
107415
107630
|
};
|
|
107416
107631
|
const input$1 = "_input_zx6p9_1";
|
|
107417
|
-
var styles$
|
|
107632
|
+
var styles$b = {
|
|
107418
107633
|
input: input$1
|
|
107419
107634
|
};
|
|
107420
107635
|
const TextArea = React__default.forwardRef(
|
|
@@ -107447,7 +107662,7 @@ const TextArea = React__default.forwardRef(
|
|
|
107447
107662
|
}, label2), /* @__PURE__ */ React__default.createElement("div", {
|
|
107448
107663
|
style: { position: "relative" }
|
|
107449
107664
|
}, /* @__PURE__ */ React__default.createElement("textarea", {
|
|
107450
|
-
className: styles$
|
|
107665
|
+
className: styles$b.input,
|
|
107451
107666
|
onChange: handleChange,
|
|
107452
107667
|
id: id2,
|
|
107453
107668
|
name: id2,
|
|
@@ -107478,51 +107693,6 @@ const TextAreaField = ({ control, name, ...props }) => {
|
|
|
107478
107693
|
}))
|
|
107479
107694
|
});
|
|
107480
107695
|
};
|
|
107481
|
-
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")();
|
|
107482
|
-
const Modal2 = ({
|
|
107483
|
-
open,
|
|
107484
|
-
children,
|
|
107485
|
-
onClose: onClose2,
|
|
107486
|
-
title: title2,
|
|
107487
|
-
width
|
|
107488
|
-
}) => {
|
|
107489
|
-
return /* @__PURE__ */ React__default.createElement(ModalAntd, {
|
|
107490
|
-
className: "resbook-modal",
|
|
107491
|
-
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)),
|
|
107492
|
-
open,
|
|
107493
|
-
onCancel: onClose2,
|
|
107494
|
-
width: width || 1e3,
|
|
107495
|
-
footer: null,
|
|
107496
|
-
closeIcon: /* @__PURE__ */ React__default.createElement(Icon, {
|
|
107497
|
-
icon: "close",
|
|
107498
|
-
size: "small"
|
|
107499
|
-
}),
|
|
107500
|
-
centered: true,
|
|
107501
|
-
zIndex: 1032
|
|
107502
|
-
}, children);
|
|
107503
|
-
};
|
|
107504
|
-
const ConfirmationModal = ({ onAccept, isLoading, title: title2, text: text2 = "AREYOUSURE?", ...props }) => {
|
|
107505
|
-
const { t: t2 } = useTranslation();
|
|
107506
|
-
return /* @__PURE__ */ React__default.createElement(Modal2, {
|
|
107507
|
-
...props,
|
|
107508
|
-
title: title2,
|
|
107509
|
-
width: 500
|
|
107510
|
-
}, /* @__PURE__ */ React__default.createElement("h3", {
|
|
107511
|
-
style: { marginTop: 0, paddingTop: 20 }
|
|
107512
|
-
}, t2(text2)), /* @__PURE__ */ React__default.createElement("div", null, /* @__PURE__ */ React__default.createElement("div", {
|
|
107513
|
-
style: { display: "flex", justifyContent: "center", gap: 20, marginTop: 20 }
|
|
107514
|
-
}, /* @__PURE__ */ React__default.createElement(Button, {
|
|
107515
|
-
size: "small",
|
|
107516
|
-
mode: "tertiary",
|
|
107517
|
-
onClick: props.onClose,
|
|
107518
|
-
disabled: isLoading
|
|
107519
|
-
}, t2("CANCEL")), /* @__PURE__ */ React__default.createElement(Button, {
|
|
107520
|
-
size: "small",
|
|
107521
|
-
type: "submit",
|
|
107522
|
-
onClick: () => onAccept(),
|
|
107523
|
-
isLoading
|
|
107524
|
-
}, t2("ACCEPT")))));
|
|
107525
|
-
};
|
|
107526
107696
|
const ActionButtons = ({ onSubmit, venueId }) => {
|
|
107527
107697
|
const { t: t2 } = useTranslation();
|
|
107528
107698
|
const { selectedBooking, setSelectedBooking } = useSelectedBookingContext();
|
|
@@ -107662,7 +107832,7 @@ const Header = () => {
|
|
|
107662
107832
|
const index$a = ({ filtersData, venueId }) => {
|
|
107663
107833
|
const { t: t2 } = useTranslation();
|
|
107664
107834
|
const { reload: reloadMainTable } = useReloadContext();
|
|
107665
|
-
const { selectedBooking, setSelectedBooking } = useSelectedBookingContext();
|
|
107835
|
+
const { selectedBooking, setSelectedBooking, canEdit } = useSelectedBookingContext();
|
|
107666
107836
|
const { showMessageError } = useMessage();
|
|
107667
107837
|
const [currentTimeZone, setCurrentTimeZone] = useState("");
|
|
107668
107838
|
const [partySizeOptions2, setPartySizeOptions] = useState([]);
|
|
@@ -107685,7 +107855,7 @@ const index$a = ({ filtersData, venueId }) => {
|
|
|
107685
107855
|
const bookingSchema = () => create$1().shape({
|
|
107686
107856
|
source: create$4().test(
|
|
107687
107857
|
"is-valid-partySize",
|
|
107688
|
-
"
|
|
107858
|
+
"Source is required",
|
|
107689
107859
|
(value2) => value2 !== null && typeof value2 === "object" && !!value2.value
|
|
107690
107860
|
).required(),
|
|
107691
107861
|
date: create$2().required(),
|
|
@@ -107747,7 +107917,10 @@ const index$a = ({ filtersData, venueId }) => {
|
|
|
107747
107917
|
{
|
|
107748
107918
|
cacheId: "reservation0dashboard0table0availability",
|
|
107749
107919
|
venue_id: venueId,
|
|
107750
|
-
params: source2 && (source2 == null ? void 0 : source2.value) ? {
|
|
107920
|
+
params: source2 && (source2 == null ? void 0 : source2.value) ? {
|
|
107921
|
+
startSec: moment$1.tz(`${date4} ${time2 == null ? void 0 : time2.value}`, currentTimeZone ? currentTimeZone : "").valueOf() / 1e3,
|
|
107922
|
+
partySize: partySize == null ? void 0 : partySize.value
|
|
107923
|
+
} : {}
|
|
107751
107924
|
}
|
|
107752
107925
|
);
|
|
107753
107926
|
const { execute: executeCreate, data: responBookingCreate, isExecuting: loadingCreate } = useService(AddBooking);
|
|
@@ -107890,6 +108063,7 @@ const index$a = ({ filtersData, venueId }) => {
|
|
|
107890
108063
|
}, /* @__PURE__ */ React__default.createElement(Header, null), !selectedBooking && /* @__PURE__ */ React__default.createElement("div", {
|
|
107891
108064
|
style: { width: "100%" }
|
|
107892
108065
|
}, /* @__PURE__ */ React__default.createElement(SelectField, {
|
|
108066
|
+
isDisabled: !canEdit,
|
|
107893
108067
|
control,
|
|
107894
108068
|
id: "source",
|
|
107895
108069
|
name: "source",
|
|
@@ -107900,6 +108074,7 @@ const index$a = ({ filtersData, venueId }) => {
|
|
|
107900
108074
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
107901
108075
|
style: { width: "50%" }
|
|
107902
108076
|
}, /* @__PURE__ */ React__default.createElement(TextInputField, {
|
|
108077
|
+
disabled: !canEdit,
|
|
107903
108078
|
control,
|
|
107904
108079
|
id: "date",
|
|
107905
108080
|
name: "date",
|
|
@@ -107910,6 +108085,7 @@ const index$a = ({ filtersData, venueId }) => {
|
|
|
107910
108085
|
})), /* @__PURE__ */ React__default.createElement("div", {
|
|
107911
108086
|
style: { width: "50%" }
|
|
107912
108087
|
}, /* @__PURE__ */ React__default.createElement(SelectField, {
|
|
108088
|
+
isDisabled: !canEdit,
|
|
107913
108089
|
control,
|
|
107914
108090
|
isClearable: true,
|
|
107915
108091
|
id: "time",
|
|
@@ -107921,6 +108097,7 @@ const index$a = ({ filtersData, venueId }) => {
|
|
|
107921
108097
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
107922
108098
|
style: { width: "50%" }
|
|
107923
108099
|
}, /* @__PURE__ */ React__default.createElement(SelectField, {
|
|
108100
|
+
isDisabled: !canEdit,
|
|
107924
108101
|
control,
|
|
107925
108102
|
isClearable: true,
|
|
107926
108103
|
id: "partySize",
|
|
@@ -107930,6 +108107,7 @@ const index$a = ({ filtersData, venueId }) => {
|
|
|
107930
108107
|
})), /* @__PURE__ */ React__default.createElement("div", {
|
|
107931
108108
|
style: { width: "50%" }
|
|
107932
108109
|
}, /* @__PURE__ */ React__default.createElement(SelectField, {
|
|
108110
|
+
isDisabled: !canEdit,
|
|
107933
108111
|
control,
|
|
107934
108112
|
id: "table",
|
|
107935
108113
|
name: "table",
|
|
@@ -107940,7 +108118,7 @@ const index$a = ({ filtersData, venueId }) => {
|
|
|
107940
108118
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
107941
108119
|
style: { width: "50%" }
|
|
107942
108120
|
}, /* @__PURE__ */ React__default.createElement(TextInputField, {
|
|
107943
|
-
disabled: selectedBooking,
|
|
108121
|
+
disabled: selectedBooking || !canEdit,
|
|
107944
108122
|
control,
|
|
107945
108123
|
id: "firstName",
|
|
107946
108124
|
name: "firstName",
|
|
@@ -107951,7 +108129,7 @@ const index$a = ({ filtersData, venueId }) => {
|
|
|
107951
108129
|
})), /* @__PURE__ */ React__default.createElement("div", {
|
|
107952
108130
|
style: { width: "50%" }
|
|
107953
108131
|
}, /* @__PURE__ */ React__default.createElement(TextInputField, {
|
|
107954
|
-
disabled: selectedBooking,
|
|
108132
|
+
disabled: selectedBooking || !canEdit,
|
|
107955
108133
|
control,
|
|
107956
108134
|
id: "lastName",
|
|
107957
108135
|
name: "lastName",
|
|
@@ -107962,7 +108140,7 @@ const index$a = ({ filtersData, venueId }) => {
|
|
|
107962
108140
|
}))), /* @__PURE__ */ React__default.createElement("div", {
|
|
107963
108141
|
style: { width: "100%" }
|
|
107964
108142
|
}, /* @__PURE__ */ React__default.createElement(TextInputField, {
|
|
107965
|
-
disabled: selectedBooking,
|
|
108143
|
+
disabled: selectedBooking || !canEdit,
|
|
107966
108144
|
control,
|
|
107967
108145
|
id: "email",
|
|
107968
108146
|
name: "email",
|
|
@@ -107973,7 +108151,7 @@ const index$a = ({ filtersData, venueId }) => {
|
|
|
107973
108151
|
})), /* @__PURE__ */ React__default.createElement("div", {
|
|
107974
108152
|
style: { width: "100%" }
|
|
107975
108153
|
}, /* @__PURE__ */ React__default.createElement(TextInputField, {
|
|
107976
|
-
disabled: selectedBooking,
|
|
108154
|
+
disabled: selectedBooking || !canEdit,
|
|
107977
108155
|
control,
|
|
107978
108156
|
id: "phone",
|
|
107979
108157
|
name: "phone",
|
|
@@ -107984,7 +108162,7 @@ const index$a = ({ filtersData, venueId }) => {
|
|
|
107984
108162
|
})), /* @__PURE__ */ React__default.createElement("div", {
|
|
107985
108163
|
style: { width: "100%" }
|
|
107986
108164
|
}, /* @__PURE__ */ React__default.createElement(TextAreaField, {
|
|
107987
|
-
disabled: selectedBooking,
|
|
108165
|
+
disabled: selectedBooking || !canEdit,
|
|
107988
108166
|
control,
|
|
107989
108167
|
id: "notes",
|
|
107990
108168
|
name: "notes",
|
|
@@ -107992,7 +108170,7 @@ const index$a = ({ filtersData, venueId }) => {
|
|
|
107992
108170
|
placeholder: "Notes ..."
|
|
107993
108171
|
})), /* @__PURE__ */ React__default.createElement("hr", {
|
|
107994
108172
|
style: { width: "100%" }
|
|
107995
|
-
}), /* @__PURE__ */ React__default.createElement(ActionButtons, {
|
|
108173
|
+
}), canEdit && /* @__PURE__ */ React__default.createElement(ActionButtons, {
|
|
107996
108174
|
onSubmit,
|
|
107997
108175
|
venueId
|
|
107998
108176
|
}), selectedBooking && /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement("hr", {
|
|
@@ -108001,7 +108179,7 @@ const index$a = ({ filtersData, venueId }) => {
|
|
|
108001
108179
|
item: selectedBooking
|
|
108002
108180
|
})));
|
|
108003
108181
|
};
|
|
108004
|
-
function MainComponent({ venueId }) {
|
|
108182
|
+
function MainComponent({ venueId, userEmail, userFullName }) {
|
|
108005
108183
|
const [currentVenue, setCurrentVenue] = useState(null);
|
|
108006
108184
|
const { showSidebar, setShowSidebar } = useShowSidebarContext();
|
|
108007
108185
|
const [filters2, setFilters] = useState({
|
|
@@ -108063,6 +108241,14 @@ function MainComponent({ venueId }) {
|
|
|
108063
108241
|
document.removeEventListener("mousedown", handleOutsideClick);
|
|
108064
108242
|
};
|
|
108065
108243
|
}, [showSidebar, setShowSidebar]);
|
|
108244
|
+
useEffect(() => {
|
|
108245
|
+
const interval = setInterval(() => {
|
|
108246
|
+
reload();
|
|
108247
|
+
}, 6e4);
|
|
108248
|
+
return () => {
|
|
108249
|
+
clearInterval(interval);
|
|
108250
|
+
};
|
|
108251
|
+
}, [reload]);
|
|
108066
108252
|
return /* @__PURE__ */ React__default.createElement(ReloadProvider, {
|
|
108067
108253
|
reload
|
|
108068
108254
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
@@ -108071,7 +108257,10 @@ function MainComponent({ venueId }) {
|
|
|
108071
108257
|
className: styles$l.mainTableContainer
|
|
108072
108258
|
}, /* @__PURE__ */ React__default.createElement(index$c, {
|
|
108073
108259
|
filters: filters2,
|
|
108074
|
-
setFilters
|
|
108260
|
+
setFilters,
|
|
108261
|
+
currentVenue,
|
|
108262
|
+
userEmail,
|
|
108263
|
+
userFullName
|
|
108075
108264
|
}), /* @__PURE__ */ React__default.createElement(index$b, {
|
|
108076
108265
|
data: data2,
|
|
108077
108266
|
filters: filters2,
|
|
@@ -108087,9 +108276,11 @@ function MainComponent({ venueId }) {
|
|
|
108087
108276
|
venueId
|
|
108088
108277
|
}))));
|
|
108089
108278
|
}
|
|
108090
|
-
function Main$2({ venueId }) {
|
|
108279
|
+
function Main$2({ venueId, userEmail, userFullName }) {
|
|
108091
108280
|
return /* @__PURE__ */ React__default.createElement(SelectedBookingProvider, null, /* @__PURE__ */ React__default.createElement(ShowSidebarProvider, null, /* @__PURE__ */ React__default.createElement(MainComponent, {
|
|
108092
|
-
venueId
|
|
108281
|
+
venueId,
|
|
108282
|
+
userEmail,
|
|
108283
|
+
userFullName
|
|
108093
108284
|
})));
|
|
108094
108285
|
}
|
|
108095
108286
|
const mainConatiner$1 = "_mainConatiner_au98t_70";
|
|
@@ -108128,7 +108319,7 @@ var styles$a = {
|
|
|
108128
108319
|
scrollableForm: scrollableForm$1,
|
|
108129
108320
|
fixedActions: fixedActions$1
|
|
108130
108321
|
};
|
|
108131
|
-
const AreaManagementCard$1 = ({ isOpenDrawer, setIsOpenDrawer, data: data2 }) => {
|
|
108322
|
+
const AreaManagementCard$1 = ({ isOpenDrawer, setIsOpenDrawer, data: data2, canEdit }) => {
|
|
108132
108323
|
const { t: t2 } = useTranslation();
|
|
108133
108324
|
return /* @__PURE__ */ React__default.createElement(Card, {
|
|
108134
108325
|
className: styles$a.sectionCard
|
|
@@ -108152,7 +108343,7 @@ const AreaManagementCard$1 = ({ isOpenDrawer, setIsOpenDrawer, data: data2 }) =>
|
|
|
108152
108343
|
}, data2.areas.slice(0, 2).map((area, index2) => /* @__PURE__ */ React__default.createElement("p", {
|
|
108153
108344
|
key: index2,
|
|
108154
108345
|
style: { fontWeight: "bold" }
|
|
108155
|
-
}, area.name)))), /* @__PURE__ */ React__default.createElement("div", {
|
|
108346
|
+
}, area.name)))), canEdit && /* @__PURE__ */ React__default.createElement("div", {
|
|
108156
108347
|
className: styles$a.cardFooter
|
|
108157
108348
|
}, /* @__PURE__ */ React__default.createElement("hr", null), /* @__PURE__ */ React__default.createElement("div", {
|
|
108158
108349
|
className: styles$a.cardFooterContent,
|
|
@@ -108162,44 +108353,6 @@ const AreaManagementCard$1 = ({ isOpenDrawer, setIsOpenDrawer, data: data2 }) =>
|
|
|
108162
108353
|
}
|
|
108163
108354
|
}, "more")));
|
|
108164
108355
|
};
|
|
108165
|
-
const GetAreaManagement = async ({
|
|
108166
|
-
venue_id
|
|
108167
|
-
}) => {
|
|
108168
|
-
if (!venue_id)
|
|
108169
|
-
return;
|
|
108170
|
-
const responseData = await instance$1.get(
|
|
108171
|
-
`/v1/rms/venues/${venue_id}/areas`
|
|
108172
|
-
);
|
|
108173
|
-
const responseVenueData = await instance$1.get(`/v1/rms/venues/${venue_id}`);
|
|
108174
|
-
const data2 = {
|
|
108175
|
-
areas: formatData$1(responseData.data),
|
|
108176
|
-
...formatVenueData(responseVenueData)
|
|
108177
|
-
};
|
|
108178
|
-
return data2;
|
|
108179
|
-
};
|
|
108180
|
-
const GetAreasList = async ({
|
|
108181
|
-
venue_id
|
|
108182
|
-
}) => {
|
|
108183
|
-
if (!venue_id)
|
|
108184
|
-
return;
|
|
108185
|
-
const responseData = await instance$1.get(
|
|
108186
|
-
`/v1/rms/venues/${venue_id}/areas`
|
|
108187
|
-
);
|
|
108188
|
-
return formatData$1(responseData.data);
|
|
108189
|
-
};
|
|
108190
|
-
const formatData$1 = (data2) => {
|
|
108191
|
-
return data2.map((item2) => {
|
|
108192
|
-
var _a2;
|
|
108193
|
-
return {
|
|
108194
|
-
id: item2.id,
|
|
108195
|
-
name: item2.name,
|
|
108196
|
-
description: (_a2 = item2.description) != null ? _a2 : ""
|
|
108197
|
-
};
|
|
108198
|
-
});
|
|
108199
|
-
};
|
|
108200
|
-
const formatVenueData = (data2) => {
|
|
108201
|
-
return { bookableAreas: data2.bookableAreas };
|
|
108202
|
-
};
|
|
108203
108356
|
const drawer = "_drawer_1h00k_1";
|
|
108204
108357
|
const drawer__overlay = "_drawer__overlay_1h00k_18";
|
|
108205
108358
|
const drawer__content = "_drawer__content_1h00k_34";
|
|
@@ -108243,12 +108396,13 @@ const Drawer = ({ isOpen, onClose: onClose2, children, title: title2, titleDesc,
|
|
|
108243
108396
|
className: styles$9.drawer__body
|
|
108244
108397
|
}, children)));
|
|
108245
108398
|
};
|
|
108246
|
-
const label$1 = "
|
|
108247
|
-
const label__switch = "
|
|
108248
|
-
const input = "
|
|
108399
|
+
const label$1 = "_label_o8bxt_1";
|
|
108400
|
+
const label__switch = "_label__switch_o8bxt_8";
|
|
108401
|
+
const input = "_input_o8bxt_34";
|
|
108249
108402
|
var styles$8 = {
|
|
108250
108403
|
label: label$1,
|
|
108251
108404
|
label__switch,
|
|
108405
|
+
"label__switch--disabled": "_label__switch--disabled_o8bxt_18",
|
|
108252
108406
|
input
|
|
108253
108407
|
};
|
|
108254
108408
|
const Toggle = ({
|
|
@@ -108271,10 +108425,13 @@ const Toggle = ({
|
|
|
108271
108425
|
htmlFor: id2,
|
|
108272
108426
|
className: styles$8.label
|
|
108273
108427
|
}, /* @__PURE__ */ React__default.createElement("span", {
|
|
108274
|
-
className:
|
|
108428
|
+
className: classNames$2(
|
|
108429
|
+
styles$8.label__switch,
|
|
108430
|
+
disabled2 ? styles$8["label__switch--disabled"] : ""
|
|
108431
|
+
)
|
|
108275
108432
|
}), label2));
|
|
108276
108433
|
};
|
|
108277
|
-
const SwitchField = ({ control, name, onChangeEvent, ...props }) => {
|
|
108434
|
+
const SwitchField = ({ control, name, onChangeEvent, disabled: disabled2, ...props }) => {
|
|
108278
108435
|
return /* @__PURE__ */ React__default.createElement(Controller, {
|
|
108279
108436
|
control,
|
|
108280
108437
|
name,
|
|
@@ -108286,6 +108443,7 @@ const SwitchField = ({ control, name, onChangeEvent, ...props }) => {
|
|
|
108286
108443
|
name,
|
|
108287
108444
|
value: value2 || "",
|
|
108288
108445
|
label: props.label,
|
|
108446
|
+
disabled: disabled2,
|
|
108289
108447
|
onChange: (e3) => {
|
|
108290
108448
|
onChange3(e3);
|
|
108291
108449
|
if (onChangeEvent) {
|
|
@@ -108475,8 +108633,10 @@ const AreaEditDrawer = ({ isOpen, setIsOpen, venueId, data: data2, reload }) =>
|
|
|
108475
108633
|
type: "button",
|
|
108476
108634
|
onClick: () => append2({ name: "", description: "" })
|
|
108477
108635
|
}, t2("NEW_AREA")), isDirty && /* @__PURE__ */ React__default.createElement(Button, {
|
|
108636
|
+
isLoading: loadingDelete || loadingCreate || loadingUpdate,
|
|
108637
|
+
disabled: loadingDelete || loadingCreate || loadingUpdate,
|
|
108478
108638
|
mode: "success",
|
|
108479
|
-
icon: "check",
|
|
108639
|
+
icon: loadingDelete || loadingCreate || loadingUpdate ? "Spinner" : "check",
|
|
108480
108640
|
iconPosition: "right",
|
|
108481
108641
|
type: "button",
|
|
108482
108642
|
onClick: () => onSubmit()
|
|
@@ -108502,24 +108662,24 @@ const fieldChanged$3 = (currentValue, initialData) => {
|
|
|
108502
108662
|
}
|
|
108503
108663
|
return false;
|
|
108504
108664
|
};
|
|
108505
|
-
const index$9 = ({ venueId }) => {
|
|
108665
|
+
const index$9 = ({ venueId, reloadAreas, areas, canEdit }) => {
|
|
108506
108666
|
const [isOpenDrawer, setIsOpenDrawer] = useState(false);
|
|
108507
|
-
const { data: data2, isLoading, error: error3, reload } = useFetch(GetAreaManagement, { cacheId: "area0management", venue_id: venueId });
|
|
108508
108667
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
108509
108668
|
className: styles$a.sectionManagement
|
|
108510
108669
|
}, /* @__PURE__ */ React__default.createElement(AreaManagementCard$1, {
|
|
108511
108670
|
isOpenDrawer,
|
|
108512
108671
|
setIsOpenDrawer,
|
|
108513
|
-
data:
|
|
108672
|
+
data: areas,
|
|
108673
|
+
canEdit
|
|
108514
108674
|
}), /* @__PURE__ */ React__default.createElement(AreaEditDrawer, {
|
|
108515
|
-
data:
|
|
108675
|
+
data: areas,
|
|
108516
108676
|
isOpen: isOpenDrawer,
|
|
108517
108677
|
setIsOpen: setIsOpenDrawer,
|
|
108518
108678
|
venueId,
|
|
108519
|
-
reload
|
|
108679
|
+
reload: reloadAreas
|
|
108520
108680
|
}));
|
|
108521
108681
|
};
|
|
108522
|
-
const AreaManagementCard = ({ isOpenDrawer, setIsOpenDrawer, data: data2 }) => {
|
|
108682
|
+
const AreaManagementCard = ({ isOpenDrawer, setIsOpenDrawer, data: data2, canEdit }) => {
|
|
108523
108683
|
const { t: t2 } = useTranslation();
|
|
108524
108684
|
return /* @__PURE__ */ React__default.createElement(Card, {
|
|
108525
108685
|
className: styles$a.sectionCard
|
|
@@ -108543,7 +108703,7 @@ const AreaManagementCard = ({ isOpenDrawer, setIsOpenDrawer, data: data2 }) => {
|
|
|
108543
108703
|
}, table2.name), /* @__PURE__ */ React__default.createElement("p", null, table2.minCapacity, "-", table2.maxCapacity), /* @__PURE__ */ React__default.createElement("p", {
|
|
108544
108704
|
style: { flex: 1, textAlign: "center" }
|
|
108545
108705
|
}, (_b = (_a2 = table2.area) == null ? void 0 : _a2.name) != null ? _b : "---"));
|
|
108546
|
-
}))), /* @__PURE__ */ React__default.createElement("div", {
|
|
108706
|
+
}))), canEdit && /* @__PURE__ */ React__default.createElement("div", {
|
|
108547
108707
|
className: styles$a.cardFooter
|
|
108548
108708
|
}, /* @__PURE__ */ React__default.createElement("hr", null), /* @__PURE__ */ React__default.createElement("div", {
|
|
108549
108709
|
className: styles$a.cardFooterContent,
|
|
@@ -108694,6 +108854,7 @@ const TableEditDrawer = ({ isOpen, setIsOpen, venueId, data: data2, areasList, r
|
|
|
108694
108854
|
const [formattedAreaList, setFormattedAreaList] = useState([]);
|
|
108695
108855
|
const [showConfirmationModal, setShowConfirmationModal] = useState(false);
|
|
108696
108856
|
const [selectedTable, setSelectedTable] = useState(null);
|
|
108857
|
+
const scrollableRef = useRef(null);
|
|
108697
108858
|
const { isExecuting: loadingCreate, execute: executeCreator } = useService(CreateResbook, {});
|
|
108698
108859
|
const { isExecuting: loadingUpdate, execute: executeUpdater } = useService(UpdateResbook, {});
|
|
108699
108860
|
const { isExecuting: loadingDelete, execute: executeDeleter } = useService(DeleteResbook, {
|
|
@@ -108769,9 +108930,21 @@ const TableEditDrawer = ({ isOpen, setIsOpen, venueId, data: data2, areasList, r
|
|
|
108769
108930
|
remove(index2);
|
|
108770
108931
|
}
|
|
108771
108932
|
};
|
|
108933
|
+
const scrollToBottom = () => {
|
|
108934
|
+
if (scrollableRef.current) {
|
|
108935
|
+
scrollableRef.current.scrollTo({
|
|
108936
|
+
top: scrollableRef.current.scrollHeight,
|
|
108937
|
+
behavior: "smooth"
|
|
108938
|
+
});
|
|
108939
|
+
}
|
|
108940
|
+
};
|
|
108941
|
+
const handleAddNewTable = () => {
|
|
108942
|
+
append2({ name: "", minCapacity: "", maxCapacity: "", area: null });
|
|
108943
|
+
setTimeout(scrollToBottom, 0);
|
|
108944
|
+
};
|
|
108772
108945
|
useEffect(() => {
|
|
108773
|
-
if (areasList) {
|
|
108774
|
-
setFormattedAreaList(areasList.map((area) => ({ label: area.name, value: area.id })));
|
|
108946
|
+
if (areasList && (areasList == null ? void 0 : areasList.areas)) {
|
|
108947
|
+
setFormattedAreaList(areasList.areas.map((area) => ({ label: area.name, value: area.id })));
|
|
108775
108948
|
}
|
|
108776
108949
|
}, [areasList]);
|
|
108777
108950
|
useEffect(() => {
|
|
@@ -108811,7 +108984,8 @@ const TableEditDrawer = ({ isOpen, setIsOpen, venueId, data: data2, areasList, r
|
|
|
108811
108984
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
108812
108985
|
className: styles$a.drawerContent
|
|
108813
108986
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
108814
|
-
className: styles$a.scrollableForm
|
|
108987
|
+
className: styles$a.scrollableForm,
|
|
108988
|
+
ref: scrollableRef
|
|
108815
108989
|
}, fields.map((item2, index2) => /* @__PURE__ */ React__default.createElement("div", {
|
|
108816
108990
|
key: item2.id,
|
|
108817
108991
|
className: styles$a.sectionFormRow
|
|
@@ -108859,7 +109033,7 @@ const TableEditDrawer = ({ isOpen, setIsOpen, venueId, data: data2, areasList, r
|
|
|
108859
109033
|
id: `tables.${index2}.area`,
|
|
108860
109034
|
name: `tables.${index2}.area`,
|
|
108861
109035
|
label: "Area",
|
|
108862
|
-
options: areasList ? areasList.map((area) => ({ label: area.name, value: area.id })) : []
|
|
109036
|
+
options: areasList && (areasList == null ? void 0 : areasList.areas) ? areasList.areas.map((area) => ({ label: area.name, value: area.id })) : []
|
|
108863
109037
|
}))))), /* @__PURE__ */ React__default.createElement("div", {
|
|
108864
109038
|
className: styles$a.fixedActions
|
|
108865
109039
|
}, /* @__PURE__ */ React__default.createElement(Button, {
|
|
@@ -108867,10 +109041,12 @@ const TableEditDrawer = ({ isOpen, setIsOpen, venueId, data: data2, areasList, r
|
|
|
108867
109041
|
icon: "plus",
|
|
108868
109042
|
iconPosition: "right",
|
|
108869
109043
|
type: "button",
|
|
108870
|
-
onClick:
|
|
109044
|
+
onClick: handleAddNewTable
|
|
108871
109045
|
}, t2("NEW_TABLE")), isDirty && /* @__PURE__ */ React__default.createElement(Button, {
|
|
109046
|
+
isLoading: loadingDelete || loadingCreate || loadingUpdate,
|
|
109047
|
+
disabled: loadingDelete || loadingCreate || loadingUpdate,
|
|
108872
109048
|
mode: "success",
|
|
108873
|
-
icon: "check",
|
|
109049
|
+
icon: loadingDelete || loadingCreate || loadingUpdate ? "Spinner" : "check",
|
|
108874
109050
|
iconPosition: "right",
|
|
108875
109051
|
type: "button",
|
|
108876
109052
|
onClick: () => onSubmit()
|
|
@@ -108897,19 +109073,19 @@ const fieldChanged$2 = (currentValue, initialData) => {
|
|
|
108897
109073
|
}
|
|
108898
109074
|
return false;
|
|
108899
109075
|
};
|
|
108900
|
-
const index$8 = ({ venueId }) => {
|
|
109076
|
+
const index$8 = ({ venueId, areas, canEdit }) => {
|
|
108901
109077
|
const [isOpenDrawer, setIsOpenDrawer] = useState(false);
|
|
108902
109078
|
const { data: data2, isLoading, error: error3, reload } = useFetch(GetTableManagement, { cacheId: "table0management", venue_id: venueId });
|
|
108903
|
-
const { data: areasList, isLoading: isLoadingAreas, error: errorAreasList, reload: reloadAreasList } = useFetch(GetAreasList, { cacheId: "areas0list", venue_id: venueId });
|
|
108904
109079
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
108905
109080
|
className: styles$a.sectionManagement
|
|
108906
109081
|
}, /* @__PURE__ */ React__default.createElement(AreaManagementCard, {
|
|
108907
109082
|
isOpenDrawer,
|
|
108908
109083
|
setIsOpenDrawer,
|
|
108909
|
-
data: data2
|
|
109084
|
+
data: data2,
|
|
109085
|
+
canEdit
|
|
108910
109086
|
}), /* @__PURE__ */ React__default.createElement(TableEditDrawer, {
|
|
108911
109087
|
data: data2,
|
|
108912
|
-
areasList,
|
|
109088
|
+
areasList: areas,
|
|
108913
109089
|
isOpen: isOpenDrawer,
|
|
108914
109090
|
setIsOpen: setIsOpenDrawer,
|
|
108915
109091
|
venueId,
|
|
@@ -108926,7 +109102,7 @@ const TimeFormatter = ({ seconds: seconds2, type: type4 = "hours" }) => {
|
|
|
108926
109102
|
${minutes2 && minutes2 !== 0 ? minutes2 + "m" : ""}
|
|
108927
109103
|
`);
|
|
108928
109104
|
};
|
|
108929
|
-
const ReservationDurationCard = ({ isOpenDrawer, setIsOpenDrawer, data: data2 }) => {
|
|
109105
|
+
const ReservationDurationCard = ({ isOpenDrawer, setIsOpenDrawer, data: data2, canEdit }) => {
|
|
108930
109106
|
const { t: t2 } = useTranslation();
|
|
108931
109107
|
return /* @__PURE__ */ React__default.createElement(Card, {
|
|
108932
109108
|
className: styles$a.sectionCard
|
|
@@ -108961,7 +109137,7 @@ const ReservationDurationCard = ({ isOpenDrawer, setIsOpenDrawer, data: data2 })
|
|
|
108961
109137
|
}, (shift == null ? void 0 : shift.duration) ? /* @__PURE__ */ React__default.createElement(TimeFormatter, {
|
|
108962
109138
|
seconds: shift == null ? void 0 : shift.duration
|
|
108963
109139
|
}) : "---")));
|
|
108964
|
-
}))), /* @__PURE__ */ React__default.createElement("div", {
|
|
109140
|
+
}))), canEdit && /* @__PURE__ */ React__default.createElement("div", {
|
|
108965
109141
|
className: styles$a.cardFooter
|
|
108966
109142
|
}, /* @__PURE__ */ React__default.createElement("hr", null), /* @__PURE__ */ React__default.createElement("div", {
|
|
108967
109143
|
className: styles$a.cardFooterContent,
|
|
@@ -109008,10 +109184,10 @@ const ReservationDurationEditDrawer = ({ isOpen, setIsOpen, venueId, data: data2
|
|
|
109008
109184
|
try {
|
|
109009
109185
|
for (const shift of formData.shifts) {
|
|
109010
109186
|
if (shift.shift1Id && fieldChanged$1(shift, initialData)) {
|
|
109011
|
-
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" });
|
|
109012
109188
|
}
|
|
109013
109189
|
if (shift.shift2Id && fieldChanged$1(shift, initialData)) {
|
|
109014
|
-
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" });
|
|
109015
109191
|
}
|
|
109016
109192
|
}
|
|
109017
109193
|
reload();
|
|
@@ -109026,9 +109202,9 @@ const ReservationDurationEditDrawer = ({ isOpen, setIsOpen, venueId, data: data2
|
|
|
109026
109202
|
var _a3, _b, _c, _d;
|
|
109027
109203
|
return {
|
|
109028
109204
|
partySize: Number(partySize),
|
|
109029
|
-
shift1: `${(_a3 = shifts[0]) == null ? void 0 : _a3.duration}` || null,
|
|
109205
|
+
shift1: `${((_a3 = shifts[0]) == null ? void 0 : _a3.duration) / 60}` || null,
|
|
109030
109206
|
shift1Id: ((_b = shifts[0]) == null ? void 0 : _b.id) || null,
|
|
109031
|
-
shift2: `${(_c = shifts[1]) == null ? void 0 : _c.duration}` || null,
|
|
109207
|
+
shift2: `${((_c = shifts[1]) == null ? void 0 : _c.duration) / 60}` || null,
|
|
109032
109208
|
shift2Id: ((_d = shifts[1]) == null ? void 0 : _d.id) || null
|
|
109033
109209
|
};
|
|
109034
109210
|
});
|
|
@@ -109041,8 +109217,8 @@ const ReservationDurationEditDrawer = ({ isOpen, setIsOpen, venueId, data: data2
|
|
|
109041
109217
|
return /* @__PURE__ */ React__default.createElement(Drawer, {
|
|
109042
109218
|
isOpen,
|
|
109043
109219
|
onClose: () => setIsOpen(false),
|
|
109044
|
-
title: t2("
|
|
109045
|
-
titleDesc: t2("
|
|
109220
|
+
title: t2("RESERVATION_DURATION"),
|
|
109221
|
+
titleDesc: t2("RESERVATION_DURATION_DESC")
|
|
109046
109222
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
109047
109223
|
className: styles$a.drawerContent
|
|
109048
109224
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
@@ -109073,8 +109249,10 @@ const ReservationDurationEditDrawer = ({ isOpen, setIsOpen, venueId, data: data2
|
|
|
109073
109249
|
}))))), /* @__PURE__ */ React__default.createElement("div", {
|
|
109074
109250
|
className: styles$a.fixedActions
|
|
109075
109251
|
}, isDirty && /* @__PURE__ */ React__default.createElement(Button, {
|
|
109252
|
+
isLoading: loadingUpdate,
|
|
109253
|
+
disabled: loadingUpdate,
|
|
109076
109254
|
mode: "success",
|
|
109077
|
-
icon: "check",
|
|
109255
|
+
icon: loadingUpdate ? "Spinner" : "check",
|
|
109078
109256
|
iconPosition: "right",
|
|
109079
109257
|
type: "button",
|
|
109080
109258
|
onClick: () => onSubmit()
|
|
@@ -109087,7 +109265,7 @@ const fieldChanged$1 = (currentValue, initialData) => {
|
|
|
109087
109265
|
}
|
|
109088
109266
|
return true;
|
|
109089
109267
|
};
|
|
109090
|
-
const index$7 = ({ venueId }) => {
|
|
109268
|
+
const index$7 = ({ venueId, canEdit }) => {
|
|
109091
109269
|
const [isOpenDrawer, setIsOpenDrawer] = useState(false);
|
|
109092
109270
|
const { data: data2, isLoading, error: error3, reload } = useFetch(GetSeatingRules, { cacheId: "reservation0duration", venue_id: venueId });
|
|
109093
109271
|
const [formatedData, setformatedData] = useState(null);
|
|
@@ -109105,7 +109283,8 @@ const index$7 = ({ venueId }) => {
|
|
|
109105
109283
|
}, /* @__PURE__ */ React__default.createElement(ReservationDurationCard, {
|
|
109106
109284
|
isOpenDrawer,
|
|
109107
109285
|
setIsOpenDrawer,
|
|
109108
|
-
data: formatedData
|
|
109286
|
+
data: formatedData,
|
|
109287
|
+
canEdit
|
|
109109
109288
|
}), /* @__PURE__ */ React__default.createElement(ReservationDurationEditDrawer, {
|
|
109110
109289
|
data: formatedData,
|
|
109111
109290
|
isOpen: isOpenDrawer,
|
|
@@ -109114,7 +109293,7 @@ const index$7 = ({ venueId }) => {
|
|
|
109114
109293
|
reload
|
|
109115
109294
|
}));
|
|
109116
109295
|
};
|
|
109117
|
-
const SpecialDatesCard = ({ isOpenDrawer, setIsOpenDrawer, data: data2 }) => {
|
|
109296
|
+
const SpecialDatesCard = ({ isOpenDrawer, setIsOpenDrawer, data: data2, canEdit }) => {
|
|
109118
109297
|
const getOrdinal = (n2) => {
|
|
109119
109298
|
const s2 = ["th", "st", "nd", "rd"];
|
|
109120
109299
|
const v2 = n2 % 100;
|
|
@@ -109145,7 +109324,7 @@ const SpecialDatesCard = ({ isOpenDrawer, setIsOpenDrawer, data: data2 }) => {
|
|
|
109145
109324
|
style: { textAlign: "center" }
|
|
109146
109325
|
}, t2("CLOSED")) : /* @__PURE__ */ React__default.createElement("p", {
|
|
109147
109326
|
style: { textAlign: "center" }
|
|
109148
|
-
}, t2("SPECIAL_SHIFTS")))))), /* @__PURE__ */ React__default.createElement("div", {
|
|
109327
|
+
}, t2("SPECIAL_SHIFTS")))))), canEdit && /* @__PURE__ */ React__default.createElement("div", {
|
|
109149
109328
|
className: styles$a.cardFooter
|
|
109150
109329
|
}, /* @__PURE__ */ React__default.createElement("hr", null), /* @__PURE__ */ React__default.createElement("div", {
|
|
109151
109330
|
className: styles$a.cardFooterContent,
|
|
@@ -109211,6 +109390,7 @@ const SpecialDatesEditDrawer = ({ isOpen, setIsOpen, venueId, data: data2, reloa
|
|
|
109211
109390
|
const [initialData, setInitialData] = useState(null);
|
|
109212
109391
|
const [showConfirmationModal, setShowConfirmationModal] = useState(false);
|
|
109213
109392
|
const [selectedDate, setSelectedDate] = useState(null);
|
|
109393
|
+
const scrollableRef = useRef(null);
|
|
109214
109394
|
const { isExecuting: loadingUpdate, execute: executeUpdater } = useService(UpdateResbook, {});
|
|
109215
109395
|
const { isExecuting: loadingDelete, execute: executeDeleter } = useService(DeleteResbook, {
|
|
109216
109396
|
onSuccess: () => {
|
|
@@ -109292,6 +109472,14 @@ const SpecialDatesEditDrawer = ({ isOpen, setIsOpen, venueId, data: data2, reloa
|
|
|
109292
109472
|
remove(index2);
|
|
109293
109473
|
}
|
|
109294
109474
|
};
|
|
109475
|
+
const scrollToBottom = () => {
|
|
109476
|
+
if (scrollableRef.current) {
|
|
109477
|
+
scrollableRef.current.scrollTo({
|
|
109478
|
+
top: scrollableRef.current.scrollHeight,
|
|
109479
|
+
behavior: "smooth"
|
|
109480
|
+
});
|
|
109481
|
+
}
|
|
109482
|
+
};
|
|
109295
109483
|
useEffect(() => {
|
|
109296
109484
|
if (data2) {
|
|
109297
109485
|
const formatedData = data2.map((item2) => {
|
|
@@ -109318,7 +109506,8 @@ const SpecialDatesEditDrawer = ({ isOpen, setIsOpen, venueId, data: data2, reloa
|
|
|
109318
109506
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
109319
109507
|
className: styles$a.drawerContent
|
|
109320
109508
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
109321
|
-
className: styles$a.scrollableForm
|
|
109509
|
+
className: styles$a.scrollableForm,
|
|
109510
|
+
ref: scrollableRef
|
|
109322
109511
|
}, fields.map((item2, index2) => /* @__PURE__ */ React__default.createElement(React__default.Fragment, {
|
|
109323
109512
|
key: item2.id
|
|
109324
109513
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
@@ -109374,10 +109563,15 @@ const SpecialDatesEditDrawer = ({ isOpen, setIsOpen, venueId, data: data2, reloa
|
|
|
109374
109563
|
icon: "plus",
|
|
109375
109564
|
iconPosition: "right",
|
|
109376
109565
|
type: "button",
|
|
109377
|
-
onClick: () =>
|
|
109566
|
+
onClick: () => {
|
|
109567
|
+
append2({ closed: false, startDate: "", endDate: "" });
|
|
109568
|
+
setTimeout(scrollToBottom, 0);
|
|
109569
|
+
}
|
|
109378
109570
|
}, t2("ADD_SPECIAL_DATE")), isDirty && /* @__PURE__ */ React__default.createElement(Button, {
|
|
109571
|
+
isLoading: loadingDelete || loadingUpdate,
|
|
109572
|
+
disabled: loadingDelete || loadingUpdate,
|
|
109379
109573
|
mode: "success",
|
|
109380
|
-
icon: "check",
|
|
109574
|
+
icon: loadingDelete || loadingUpdate ? "Spinner" : "check",
|
|
109381
109575
|
iconPosition: "right",
|
|
109382
109576
|
type: "button",
|
|
109383
109577
|
onClick: () => onSubmit()
|
|
@@ -109411,7 +109605,7 @@ const fieldChanged = (currentValue, initialData) => {
|
|
|
109411
109605
|
}
|
|
109412
109606
|
return false;
|
|
109413
109607
|
};
|
|
109414
|
-
const index$6 = ({ venueId }) => {
|
|
109608
|
+
const index$6 = ({ venueId, canEdit }) => {
|
|
109415
109609
|
const [isOpenDrawer, setIsOpenDrawer] = useState(false);
|
|
109416
109610
|
const { data: data2, isLoading, error: error3, reload } = useFetch(GetSpecialDates, { cacheId: "special0dates", venue_id: venueId });
|
|
109417
109611
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
@@ -109419,7 +109613,8 @@ const index$6 = ({ venueId }) => {
|
|
|
109419
109613
|
}, /* @__PURE__ */ React__default.createElement(SpecialDatesCard, {
|
|
109420
109614
|
isOpenDrawer,
|
|
109421
109615
|
setIsOpenDrawer,
|
|
109422
|
-
data: data2
|
|
109616
|
+
data: data2,
|
|
109617
|
+
canEdit
|
|
109423
109618
|
}), /* @__PURE__ */ React__default.createElement(SpecialDatesEditDrawer, {
|
|
109424
109619
|
data: data2,
|
|
109425
109620
|
isOpen: isOpenDrawer,
|
|
@@ -109428,7 +109623,7 @@ const index$6 = ({ venueId }) => {
|
|
|
109428
109623
|
reload
|
|
109429
109624
|
}));
|
|
109430
109625
|
};
|
|
109431
|
-
const ShiftsCard = ({ isOpenDrawer, setIsOpenDrawer, data: data2 }) => {
|
|
109626
|
+
const ShiftsCard = ({ isOpenDrawer, setIsOpenDrawer, data: data2, canEdit }) => {
|
|
109432
109627
|
const { t: t2 } = useTranslation();
|
|
109433
109628
|
return /* @__PURE__ */ React__default.createElement(Card, {
|
|
109434
109629
|
className: styles$a.sectionCard
|
|
@@ -109455,7 +109650,7 @@ const ShiftsCard = ({ isOpenDrawer, setIsOpenDrawer, data: data2 }) => {
|
|
|
109455
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", {
|
|
109456
109651
|
style: { textAlign: "center" }
|
|
109457
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 : "--")));
|
|
109458
|
-
}))), /* @__PURE__ */ React__default.createElement("div", {
|
|
109653
|
+
}))), canEdit && /* @__PURE__ */ React__default.createElement("div", {
|
|
109459
109654
|
className: styles$a.cardFooter
|
|
109460
109655
|
}, /* @__PURE__ */ React__default.createElement("hr", null), /* @__PURE__ */ React__default.createElement("div", {
|
|
109461
109656
|
className: styles$a.cardFooterContent,
|
|
@@ -109612,14 +109807,15 @@ const ShiftsEditDrawer = ({ isOpen, setIsOpen, venueId, data: data2, reload }) =
|
|
|
109612
109807
|
})), /* @__PURE__ */ React__default.createElement("div", {
|
|
109613
109808
|
className: styles$a.fixedActions
|
|
109614
109809
|
}, isDirty && /* @__PURE__ */ React__default.createElement(Button, {
|
|
109810
|
+
isLoading: loadingUpdate,
|
|
109811
|
+
disabled: loadingUpdate,
|
|
109615
109812
|
mode: "success",
|
|
109616
|
-
icon: "check",
|
|
109617
|
-
iconPosition: "right",
|
|
109813
|
+
icon: loadingUpdate ? "Spinner" : "check",
|
|
109618
109814
|
type: "button",
|
|
109619
109815
|
onClick: () => onSubmit()
|
|
109620
109816
|
}, t2("SAVE")))));
|
|
109621
109817
|
};
|
|
109622
|
-
const index$5 = ({ venueId }) => {
|
|
109818
|
+
const index$5 = ({ venueId, canEdit }) => {
|
|
109623
109819
|
const [isOpenDrawer, setIsOpenDrawer] = useState(false);
|
|
109624
109820
|
const weekdayOrder = ["monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday"];
|
|
109625
109821
|
const { data: data2, isLoading, error: error3, reload } = useFetch(GetOpeningHours, { cacheId: "shifts0management", venue_id: venueId });
|
|
@@ -109638,7 +109834,8 @@ const index$5 = ({ venueId }) => {
|
|
|
109638
109834
|
}, /* @__PURE__ */ React__default.createElement(ShiftsCard, {
|
|
109639
109835
|
isOpenDrawer,
|
|
109640
109836
|
setIsOpenDrawer,
|
|
109641
|
-
data: formatedData
|
|
109837
|
+
data: formatedData,
|
|
109838
|
+
canEdit
|
|
109642
109839
|
}), /* @__PURE__ */ React__default.createElement(ShiftsEditDrawer, {
|
|
109643
109840
|
data: formatedData,
|
|
109644
109841
|
isOpen: isOpenDrawer,
|
|
@@ -109647,7 +109844,7 @@ const index$5 = ({ venueId }) => {
|
|
|
109647
109844
|
reload
|
|
109648
109845
|
}));
|
|
109649
109846
|
};
|
|
109650
|
-
const ReservationPreferencesCard = ({ isOpenDrawer, setIsOpenDrawer, data: data2 }) => {
|
|
109847
|
+
const ReservationPreferencesCard = ({ isOpenDrawer, setIsOpenDrawer, data: data2, canEdit }) => {
|
|
109651
109848
|
const { t: t2 } = useTranslation();
|
|
109652
109849
|
return /* @__PURE__ */ React__default.createElement(Card, {
|
|
109653
109850
|
className: styles$a.sectionCard
|
|
@@ -109673,7 +109870,7 @@ const ReservationPreferencesCard = ({ isOpenDrawer, setIsOpenDrawer, data: data2
|
|
|
109673
109870
|
style: { fontWeight: "bold" }
|
|
109674
109871
|
}, t2("TIMEOFFSETTOMEALTIME")), /* @__PURE__ */ React__default.createElement("p", {
|
|
109675
109872
|
style: { textAlign: "left" }
|
|
109676
|
-
}, 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", {
|
|
109677
109874
|
className: styles$a.cardFooter
|
|
109678
109875
|
}, /* @__PURE__ */ React__default.createElement("hr", null), /* @__PURE__ */ React__default.createElement("div", {
|
|
109679
109876
|
className: styles$a.cardFooterContent,
|
|
@@ -109764,14 +109961,16 @@ const ReservationPreferencesEditDrawer = ({ isOpen, setIsOpen, venueId, data: da
|
|
|
109764
109961
|
}))), /* @__PURE__ */ React__default.createElement("div", {
|
|
109765
109962
|
style: { display: "flex", justifyContent: "flex-end", gap: 10, marginTop: 30 }
|
|
109766
109963
|
}, isDirty && /* @__PURE__ */ React__default.createElement(Button, {
|
|
109964
|
+
isLoading: isExecuting,
|
|
109965
|
+
disabled: isExecuting,
|
|
109767
109966
|
mode: "success",
|
|
109768
|
-
icon: "check",
|
|
109967
|
+
icon: isExecuting ? "Spinner" : "check",
|
|
109769
109968
|
iconPosition: "right",
|
|
109770
109969
|
type: "button",
|
|
109771
109970
|
onClick: () => onSubmit()
|
|
109772
109971
|
}, t2("SAVE")))));
|
|
109773
109972
|
};
|
|
109774
|
-
const index$4 = ({ venueId }) => {
|
|
109973
|
+
const index$4 = ({ venueId, canEdit }) => {
|
|
109775
109974
|
const [isOpenDrawer, setIsOpenDrawer] = useState(false);
|
|
109776
109975
|
const { data: data2, isLoading, error: error3, reload } = useFetch(GetArrivalRules, { cacheId: "bookingArrivalRules", venue_id: venueId });
|
|
109777
109976
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
@@ -109779,7 +109978,8 @@ const index$4 = ({ venueId }) => {
|
|
|
109779
109978
|
}, /* @__PURE__ */ React__default.createElement(ReservationPreferencesCard, {
|
|
109780
109979
|
isOpenDrawer,
|
|
109781
109980
|
setIsOpenDrawer,
|
|
109782
|
-
data: data2
|
|
109981
|
+
data: data2,
|
|
109982
|
+
canEdit
|
|
109783
109983
|
}), /* @__PURE__ */ React__default.createElement(ReservationPreferencesEditDrawer, {
|
|
109784
109984
|
data: data2,
|
|
109785
109985
|
isOpen: isOpenDrawer,
|
|
@@ -109788,9 +109988,46 @@ const index$4 = ({ venueId }) => {
|
|
|
109788
109988
|
reload
|
|
109789
109989
|
}));
|
|
109790
109990
|
};
|
|
109991
|
+
const GetAreaManagement = async ({
|
|
109992
|
+
venue_id
|
|
109993
|
+
}) => {
|
|
109994
|
+
if (!venue_id)
|
|
109995
|
+
return;
|
|
109996
|
+
const responseData = await instance$1.get(
|
|
109997
|
+
`/v1/rms/venues/${venue_id}/areas?limit=100`
|
|
109998
|
+
);
|
|
109999
|
+
const responseVenueData = await instance$1.get(`/v1/rms/venues/${venue_id}`);
|
|
110000
|
+
const data2 = {
|
|
110001
|
+
areas: formatData$1(responseData.data),
|
|
110002
|
+
...formatVenueData(responseVenueData)
|
|
110003
|
+
};
|
|
110004
|
+
return data2;
|
|
110005
|
+
};
|
|
110006
|
+
const formatData$1 = (data2) => {
|
|
110007
|
+
return data2.map((item2) => {
|
|
110008
|
+
var _a2;
|
|
110009
|
+
return {
|
|
110010
|
+
id: item2.id,
|
|
110011
|
+
name: item2.name,
|
|
110012
|
+
description: (_a2 = item2.description) != null ? _a2 : ""
|
|
110013
|
+
};
|
|
110014
|
+
});
|
|
110015
|
+
};
|
|
110016
|
+
const formatVenueData = (data2) => {
|
|
110017
|
+
return { bookableAreas: data2.bookableAreas };
|
|
110018
|
+
};
|
|
109791
110019
|
function Main$1({ venueId }) {
|
|
110020
|
+
var _a2;
|
|
109792
110021
|
const { t: t2 } = useTranslation();
|
|
109793
110022
|
const [currentVenue, setCurrentVenue] = useState(null);
|
|
110023
|
+
const [canEdit, setCanEdit] = useState(false);
|
|
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]);
|
|
109794
110031
|
useEffect(() => {
|
|
109795
110032
|
setCurrentVenue(venueId);
|
|
109796
110033
|
}, [venueId]);
|
|
@@ -109801,19 +110038,28 @@ function Main$1({ venueId }) {
|
|
|
109801
110038
|
}, /* @__PURE__ */ React__default.createElement("h2", null, t2("RESTAURANTSETUP"))), /* @__PURE__ */ React__default.createElement("div", {
|
|
109802
110039
|
className: styles$a.content
|
|
109803
110040
|
}, /* @__PURE__ */ React__default.createElement(index$9, {
|
|
109804
|
-
|
|
110041
|
+
areas: data2,
|
|
110042
|
+
reloadAreas: reload,
|
|
110043
|
+
venueId: currentVenue,
|
|
110044
|
+
canEdit
|
|
109805
110045
|
}), /* @__PURE__ */ React__default.createElement(index$8, {
|
|
109806
|
-
|
|
110046
|
+
areas: data2,
|
|
110047
|
+
venueId: currentVenue,
|
|
110048
|
+
canEdit
|
|
109807
110049
|
}), /* @__PURE__ */ React__default.createElement(index$7, {
|
|
109808
|
-
venueId: currentVenue
|
|
110050
|
+
venueId: currentVenue,
|
|
110051
|
+
canEdit
|
|
109809
110052
|
})), /* @__PURE__ */ React__default.createElement("div", {
|
|
109810
110053
|
className: styles$a.content
|
|
109811
110054
|
}, /* @__PURE__ */ React__default.createElement(index$5, {
|
|
109812
|
-
venueId: currentVenue
|
|
110055
|
+
venueId: currentVenue,
|
|
110056
|
+
canEdit
|
|
109813
110057
|
}), /* @__PURE__ */ React__default.createElement(index$6, {
|
|
109814
|
-
venueId: currentVenue
|
|
110058
|
+
venueId: currentVenue,
|
|
110059
|
+
canEdit
|
|
109815
110060
|
}), /* @__PURE__ */ React__default.createElement(index$4, {
|
|
109816
|
-
venueId: currentVenue
|
|
110061
|
+
venueId: currentVenue,
|
|
110062
|
+
canEdit
|
|
109817
110063
|
})));
|
|
109818
110064
|
}
|
|
109819
110065
|
const mainConatiner = "_mainConatiner_kqq6g_70";
|
|
@@ -109852,7 +110098,7 @@ var styles$7 = {
|
|
|
109852
110098
|
scrollableForm,
|
|
109853
110099
|
fixedActions
|
|
109854
110100
|
};
|
|
109855
|
-
const EmailsCard = ({ isOpenDrawer, setIsOpenDrawer, data: data2 }) => {
|
|
110101
|
+
const EmailsCard = ({ isOpenDrawer, setIsOpenDrawer, data: data2, canEdit }) => {
|
|
109856
110102
|
var _a2;
|
|
109857
110103
|
const { t: t2 } = useTranslation();
|
|
109858
110104
|
return /* @__PURE__ */ React__default.createElement(Card, {
|
|
@@ -109875,7 +110121,7 @@ const EmailsCard = ({ isOpenDrawer, setIsOpenDrawer, data: data2 }) => {
|
|
|
109875
110121
|
style: { display: "flex", alignItems: "center<", gap: 10 }
|
|
109876
110122
|
}, /* @__PURE__ */ React__default.createElement("div", null, /* @__PURE__ */ React__default.createElement(Icon, {
|
|
109877
110123
|
icon: "mail"
|
|
109878
|
-
})), t2("NOTDEFINED"))), /* @__PURE__ */ React__default.createElement("div", {
|
|
110124
|
+
})), t2("NOTDEFINED"))), canEdit && /* @__PURE__ */ React__default.createElement("div", {
|
|
109879
110125
|
className: styles$7.cardFooter
|
|
109880
110126
|
}, /* @__PURE__ */ React__default.createElement("hr", null), /* @__PURE__ */ React__default.createElement("div", {
|
|
109881
110127
|
className: styles$7.cardFooterContent,
|
|
@@ -109969,14 +110215,15 @@ const EmailEditDrawer = ({ isOpen, setIsOpen, venueId, data: data2, reload }) =>
|
|
|
109969
110215
|
onClick: () => onSubmit()
|
|
109970
110216
|
}, t2("SAVE")))));
|
|
109971
110217
|
};
|
|
109972
|
-
const index$3 = ({ venueId, data: data2, reload }) => {
|
|
110218
|
+
const index$3 = ({ venueId, data: data2, reload, canEdit }) => {
|
|
109973
110219
|
const [isOpenDrawer, setIsOpenDrawer] = useState(false);
|
|
109974
110220
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
109975
110221
|
className: styles$7.sectionManagement
|
|
109976
110222
|
}, /* @__PURE__ */ React__default.createElement(EmailsCard, {
|
|
109977
110223
|
isOpenDrawer,
|
|
109978
110224
|
setIsOpenDrawer,
|
|
109979
|
-
data: data2
|
|
110225
|
+
data: data2,
|
|
110226
|
+
canEdit
|
|
109980
110227
|
}), /* @__PURE__ */ React__default.createElement(EmailEditDrawer, {
|
|
109981
110228
|
data: data2,
|
|
109982
110229
|
isOpen: isOpenDrawer,
|
|
@@ -109985,7 +110232,7 @@ const index$3 = ({ venueId, data: data2, reload }) => {
|
|
|
109985
110232
|
reload
|
|
109986
110233
|
}));
|
|
109987
110234
|
};
|
|
109988
|
-
const ReservationsCard = ({ data: data2, reload }) => {
|
|
110235
|
+
const ReservationsCard = ({ data: data2, reload, canEdit }) => {
|
|
109989
110236
|
const { t: t2 } = useTranslation();
|
|
109990
110237
|
const { isExecuting, execute } = useService(UpdateUserNotificationSettings, {
|
|
109991
110238
|
onSuccess: async () => {
|
|
@@ -110032,6 +110279,7 @@ const ReservationsCard = ({ data: data2, reload }) => {
|
|
|
110032
110279
|
id: "bookingCreation",
|
|
110033
110280
|
name: "bookingCreation",
|
|
110034
110281
|
label: t2("NEWBOOKINGS"),
|
|
110282
|
+
disabled: !canEdit,
|
|
110035
110283
|
onChangeEvent: (e3) => {
|
|
110036
110284
|
execute({ data: { ...getValues(), bookingCreation: e3.target.checked } });
|
|
110037
110285
|
}
|
|
@@ -110040,6 +110288,7 @@ const ReservationsCard = ({ data: data2, reload }) => {
|
|
|
110040
110288
|
id: "bookingAmendment",
|
|
110041
110289
|
name: "bookingAmendment",
|
|
110042
110290
|
label: t2("BOOKINGAMEND"),
|
|
110291
|
+
disabled: !canEdit,
|
|
110043
110292
|
onChangeEvent: (e3) => {
|
|
110044
110293
|
execute({ data: { ...getValues(), bookingAmendment: e3.target.checked } });
|
|
110045
110294
|
}
|
|
@@ -110048,20 +110297,22 @@ const ReservationsCard = ({ data: data2, reload }) => {
|
|
|
110048
110297
|
id: "bookingCancellation",
|
|
110049
110298
|
name: "bookingCancellation",
|
|
110050
110299
|
label: t2("CANCELLATIONS"),
|
|
110300
|
+
disabled: !canEdit,
|
|
110051
110301
|
onChangeEvent: (e3) => {
|
|
110052
110302
|
execute({ data: { ...getValues(), bookingCancellation: e3.target.checked } });
|
|
110053
110303
|
}
|
|
110054
110304
|
}))));
|
|
110055
110305
|
};
|
|
110056
|
-
const index$2 = ({ venueId, data: data2, reload }) => {
|
|
110306
|
+
const index$2 = ({ venueId, data: data2, reload, canEdit }) => {
|
|
110057
110307
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
110058
110308
|
className: styles$7.sectionManagement
|
|
110059
110309
|
}, /* @__PURE__ */ React__default.createElement(ReservationsCard, {
|
|
110060
110310
|
data: data2,
|
|
110061
|
-
reload
|
|
110311
|
+
reload,
|
|
110312
|
+
canEdit
|
|
110062
110313
|
}));
|
|
110063
110314
|
};
|
|
110064
|
-
const ReviewsCard = ({ data: data2, reload }) => {
|
|
110315
|
+
const ReviewsCard = ({ data: data2, reload, canEdit }) => {
|
|
110065
110316
|
const { t: t2 } = useTranslation();
|
|
110066
110317
|
const { isExecuting, execute } = useService(UpdateUserNotificationSettings, {
|
|
110067
110318
|
onSuccess: async () => {
|
|
@@ -110107,6 +110358,7 @@ const ReviewsCard = ({ data: data2, reload }) => {
|
|
|
110107
110358
|
id: "allReviewAlert",
|
|
110108
110359
|
name: "allReviewAlert",
|
|
110109
110360
|
label: t2("ALLREVIEWS"),
|
|
110361
|
+
disabled: !canEdit,
|
|
110110
110362
|
onChangeEvent: (e3) => {
|
|
110111
110363
|
execute({ data: { ...getValues(), allReviewAlert: e3.target.checked } });
|
|
110112
110364
|
}
|
|
@@ -110115,20 +110367,22 @@ const ReviewsCard = ({ data: data2, reload }) => {
|
|
|
110115
110367
|
id: "negativeReviewAlert",
|
|
110116
110368
|
name: "negativeReviewAlert",
|
|
110117
110369
|
label: t2("NEGATIVEREVIEWS1"),
|
|
110370
|
+
disabled: !canEdit,
|
|
110118
110371
|
onChangeEvent: (e3) => {
|
|
110119
110372
|
execute({ data: { ...getValues(), negativeReviewAlert: e3.target.checked } });
|
|
110120
110373
|
}
|
|
110121
110374
|
}))));
|
|
110122
110375
|
};
|
|
110123
|
-
const index$1 = ({ venueId, data: data2, reload }) => {
|
|
110376
|
+
const index$1 = ({ venueId, data: data2, reload, canEdit }) => {
|
|
110124
110377
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
110125
110378
|
className: styles$7.sectionManagement
|
|
110126
110379
|
}, /* @__PURE__ */ React__default.createElement(ReviewsCard, {
|
|
110127
110380
|
data: data2,
|
|
110128
|
-
reload
|
|
110381
|
+
reload,
|
|
110382
|
+
canEdit
|
|
110129
110383
|
}));
|
|
110130
110384
|
};
|
|
110131
|
-
const ReviewsReportCard = ({ data: data2, reload }) => {
|
|
110385
|
+
const ReviewsReportCard = ({ data: data2, reload, canEdit }) => {
|
|
110132
110386
|
const { t: t2 } = useTranslation();
|
|
110133
110387
|
const { isExecuting, execute } = useService(UpdateUserNotificationSettings, {
|
|
110134
110388
|
onSuccess: async () => {
|
|
@@ -110172,6 +110426,7 @@ const ReviewsReportCard = ({ data: data2, reload }) => {
|
|
|
110172
110426
|
style: { display: "flex", flexDirection: "column", gap: 20 }
|
|
110173
110427
|
}, /* @__PURE__ */ React__default.createElement(SwitchField, {
|
|
110174
110428
|
control,
|
|
110429
|
+
disabled: !canEdit,
|
|
110175
110430
|
id: "dailyReport",
|
|
110176
110431
|
name: "dailyReport",
|
|
110177
110432
|
label: t2("DAILYREPORT"),
|
|
@@ -110180,6 +110435,7 @@ const ReviewsReportCard = ({ data: data2, reload }) => {
|
|
|
110180
110435
|
}
|
|
110181
110436
|
}), /* @__PURE__ */ React__default.createElement(SwitchField, {
|
|
110182
110437
|
control,
|
|
110438
|
+
disabled: !canEdit,
|
|
110183
110439
|
id: "weeklyReport",
|
|
110184
110440
|
name: "weeklyReport",
|
|
110185
110441
|
label: t2("WEEKLYREPORT"),
|
|
@@ -110188,6 +110444,7 @@ const ReviewsReportCard = ({ data: data2, reload }) => {
|
|
|
110188
110444
|
}
|
|
110189
110445
|
}), /* @__PURE__ */ React__default.createElement(SwitchField, {
|
|
110190
110446
|
control,
|
|
110447
|
+
disabled: !canEdit,
|
|
110191
110448
|
id: "monthlyReport",
|
|
110192
110449
|
name: "monthlyReport",
|
|
110193
110450
|
label: t2("MONTHLYREPORT"),
|
|
@@ -110196,23 +110453,32 @@ const ReviewsReportCard = ({ data: data2, reload }) => {
|
|
|
110196
110453
|
}
|
|
110197
110454
|
}))));
|
|
110198
110455
|
};
|
|
110199
|
-
const index = ({ venueId, data: data2, reload }) => {
|
|
110456
|
+
const index = ({ venueId, data: data2, reload, canEdit }) => {
|
|
110200
110457
|
return /* @__PURE__ */ React__default.createElement("div", {
|
|
110201
110458
|
className: styles$7.sectionManagement
|
|
110202
110459
|
}, /* @__PURE__ */ React__default.createElement(ReviewsReportCard, {
|
|
110203
110460
|
data: data2,
|
|
110204
|
-
reload
|
|
110461
|
+
reload,
|
|
110462
|
+
canEdit
|
|
110205
110463
|
}));
|
|
110206
110464
|
};
|
|
110207
110465
|
function Main({ venueId }) {
|
|
110466
|
+
var _a2;
|
|
110208
110467
|
const { t: t2 } = useTranslation();
|
|
110209
110468
|
const [currentVenue, setCurrentVenue] = useState(null);
|
|
110469
|
+
const [canEdit, setCanEdit] = useState(false);
|
|
110470
|
+
const roles = (_a2 = userData == null ? void 0 : userData.roles) != null ? _a2 : [];
|
|
110210
110471
|
const { data: data2, isLoading, error: error3, reload } = useFetch(
|
|
110211
110472
|
GetUserNotificationSettings,
|
|
110212
110473
|
{
|
|
110213
110474
|
cacheId: `user-notifications-settings`
|
|
110214
110475
|
}
|
|
110215
110476
|
);
|
|
110477
|
+
useEffect(() => {
|
|
110478
|
+
if (!roles.includes("COMPANY_USER")) {
|
|
110479
|
+
setCanEdit(true);
|
|
110480
|
+
}
|
|
110481
|
+
}, [roles]);
|
|
110216
110482
|
useEffect(() => {
|
|
110217
110483
|
setCurrentVenue(venueId);
|
|
110218
110484
|
}, [venueId]);
|
|
@@ -110225,19 +110491,23 @@ function Main({ venueId }) {
|
|
|
110225
110491
|
}, /* @__PURE__ */ React__default.createElement(index$3, {
|
|
110226
110492
|
venueId: currentVenue,
|
|
110227
110493
|
data: data2,
|
|
110228
|
-
reload
|
|
110494
|
+
reload,
|
|
110495
|
+
canEdit
|
|
110229
110496
|
}), /* @__PURE__ */ React__default.createElement(index$2, {
|
|
110230
110497
|
venueId: currentVenue,
|
|
110231
110498
|
data: data2,
|
|
110232
|
-
reload
|
|
110499
|
+
reload,
|
|
110500
|
+
canEdit
|
|
110233
110501
|
}), /* @__PURE__ */ React__default.createElement(index$1, {
|
|
110234
110502
|
venueId: currentVenue,
|
|
110235
110503
|
data: data2,
|
|
110236
|
-
reload
|
|
110504
|
+
reload,
|
|
110505
|
+
canEdit
|
|
110237
110506
|
}), /* @__PURE__ */ React__default.createElement(index, {
|
|
110238
110507
|
venueId: currentVenue,
|
|
110239
110508
|
data: data2,
|
|
110240
|
-
reload
|
|
110509
|
+
reload,
|
|
110510
|
+
canEdit
|
|
110241
110511
|
})));
|
|
110242
110512
|
}
|
|
110243
110513
|
const defaultValue = {
|