mozrest-sdk-react-dev 0.1.97 → 0.1.99
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 +235 -135
- package/package.json +1 -1
- package/style.css +1 -1
package/mozrest-sdk.es.js
CHANGED
|
@@ -6350,6 +6350,10 @@ const ComparedPeriod = "Compared period";
|
|
|
6350
6350
|
const CLOSE = "Close";
|
|
6351
6351
|
const NoChannelsConnected = "No channels connected";
|
|
6352
6352
|
const NoChannelsConnectedDesc = "You do not have channels connected, as soon as you connect them the changes will be reflected in the channels.";
|
|
6353
|
+
const AddWalKin = "Add a walk-in";
|
|
6354
|
+
const ConfirmCreateWalkInReservation = "Please confirm that you want to create a walk-in reservation for {{value}}";
|
|
6355
|
+
const NoBookingAvailability = "No booking availability";
|
|
6356
|
+
const NoAvailabilityForPartySize = "Sorry we have not availability for this party size: {{value}}";
|
|
6353
6357
|
var en = {
|
|
6354
6358
|
errors,
|
|
6355
6359
|
SPECIALCLOSINGDATES,
|
|
@@ -6657,7 +6661,11 @@ var en = {
|
|
|
6657
6661
|
ComparedPeriod,
|
|
6658
6662
|
CLOSE,
|
|
6659
6663
|
NoChannelsConnected,
|
|
6660
|
-
NoChannelsConnectedDesc
|
|
6664
|
+
NoChannelsConnectedDesc,
|
|
6665
|
+
AddWalKin,
|
|
6666
|
+
ConfirmCreateWalkInReservation,
|
|
6667
|
+
NoBookingAvailability,
|
|
6668
|
+
NoAvailabilityForPartySize
|
|
6661
6669
|
};
|
|
6662
6670
|
instance.use(initReactI18next).init({
|
|
6663
6671
|
resources: {
|
|
@@ -43432,9 +43440,6 @@ const NewSelect = ({
|
|
|
43432
43440
|
}, label2), /* @__PURE__ */ React__default.createElement("div", {
|
|
43433
43441
|
style: { position: "relative" }
|
|
43434
43442
|
}, /* @__PURE__ */ React__default.createElement(Select$1, {
|
|
43435
|
-
className: clsx([
|
|
43436
|
-
heigth && heigth !== "md" ? "h-12" : "h-7"
|
|
43437
|
-
]),
|
|
43438
43443
|
styles: customStyles,
|
|
43439
43444
|
...props,
|
|
43440
43445
|
id: id2,
|
|
@@ -97200,40 +97205,39 @@ const formatData = (data2) => {
|
|
|
97200
97205
|
};
|
|
97201
97206
|
});
|
|
97202
97207
|
};
|
|
97203
|
-
const mainConatiner = "
|
|
97204
|
-
const
|
|
97205
|
-
const
|
|
97206
|
-
const
|
|
97207
|
-
const
|
|
97208
|
-
const
|
|
97209
|
-
const
|
|
97210
|
-
const
|
|
97211
|
-
const
|
|
97212
|
-
const
|
|
97213
|
-
const
|
|
97214
|
-
const
|
|
97215
|
-
const
|
|
97216
|
-
const
|
|
97217
|
-
const
|
|
97218
|
-
const
|
|
97219
|
-
const
|
|
97220
|
-
const
|
|
97221
|
-
const
|
|
97222
|
-
const
|
|
97223
|
-
const
|
|
97224
|
-
const
|
|
97225
|
-
const
|
|
97226
|
-
const
|
|
97227
|
-
const
|
|
97228
|
-
const
|
|
97208
|
+
const mainConatiner = "_mainConatiner_1x9ia_1";
|
|
97209
|
+
const btnWarning = "_btnWarning_1x9ia_5";
|
|
97210
|
+
const btnSuccess = "_btnSuccess_1x9ia_10";
|
|
97211
|
+
const container$3 = "_container_1x9ia_15";
|
|
97212
|
+
const button$1 = "_button_1x9ia_47";
|
|
97213
|
+
const skeleton$1 = "_skeleton_1x9ia_55";
|
|
97214
|
+
const pulse$3 = "_pulse_1x9ia_1";
|
|
97215
|
+
const item$4 = "_item_1x9ia_58";
|
|
97216
|
+
const icons = "_icons_1x9ia_64";
|
|
97217
|
+
const column = "_column_1x9ia_69";
|
|
97218
|
+
const row = "_row_1x9ia_99";
|
|
97219
|
+
const cards = "_cards_1x9ia_111";
|
|
97220
|
+
const cardActive = "_cardActive_1x9ia_122";
|
|
97221
|
+
const cards1 = "_cards1_1x9ia_127";
|
|
97222
|
+
const dot$1 = "_dot_1x9ia_138";
|
|
97223
|
+
const formInline = "_formInline_1x9ia_150";
|
|
97224
|
+
const header = "_header_1x9ia_156";
|
|
97225
|
+
const datesSectionContainer = "_datesSectionContainer_1x9ia_173";
|
|
97226
|
+
const datesSectionActionButtons1 = "_datesSectionActionButtons1_1x9ia_184";
|
|
97227
|
+
const datesSectionActionButtons2 = "_datesSectionActionButtons2_1x9ia_195";
|
|
97228
|
+
const tableFiltersContainer = "_tableFiltersContainer_1x9ia_208";
|
|
97229
|
+
const tableFiltersFilterButton = "_tableFiltersFilterButton_1x9ia_220";
|
|
97230
|
+
const tableDesktopFilters = "_tableDesktopFilters_1x9ia_230";
|
|
97231
|
+
const mainTableDesktop = "_mainTableDesktop_1x9ia_241";
|
|
97232
|
+
const mainTableTablet = "_mainTableTablet_1x9ia_250";
|
|
97233
|
+
const walkingButton = "_walkingButton_1x9ia_260";
|
|
97229
97234
|
var styles$f = {
|
|
97230
97235
|
mainConatiner,
|
|
97231
|
-
btnDanger,
|
|
97232
97236
|
btnWarning,
|
|
97233
97237
|
btnSuccess,
|
|
97234
97238
|
container: container$3,
|
|
97235
97239
|
button: button$1,
|
|
97236
|
-
"button-disable": "_button-
|
|
97240
|
+
"button-disable": "_button-disable_1x9ia_50",
|
|
97237
97241
|
skeleton: skeleton$1,
|
|
97238
97242
|
pulse: pulse$3,
|
|
97239
97243
|
item: item$4,
|
|
@@ -97253,7 +97257,8 @@ var styles$f = {
|
|
|
97253
97257
|
tableFiltersFilterButton,
|
|
97254
97258
|
tableDesktopFilters,
|
|
97255
97259
|
mainTableDesktop,
|
|
97256
|
-
mainTableTablet
|
|
97260
|
+
mainTableTablet,
|
|
97261
|
+
walkingButton
|
|
97257
97262
|
};
|
|
97258
97263
|
const SelectedDateDisplay = ({ initialDate, selectedDate, onSelectDate, datesSummary }) => {
|
|
97259
97264
|
const [summary, setSummary] = useState([]);
|
|
@@ -97576,82 +97581,6 @@ const FormFields = ({ onFilter: onFilter2, partyOptions, hoursOptions, currentDa
|
|
|
97576
97581
|
partyOptions
|
|
97577
97582
|
}));
|
|
97578
97583
|
};
|
|
97579
|
-
const GetCreateBookingSelectsData = async ({
|
|
97580
|
-
venue_id
|
|
97581
|
-
}) => {
|
|
97582
|
-
const responseVenueData = await instance$1.get(`/v1/rms/venues/${venue_id}`);
|
|
97583
|
-
const responseAreas = await instance$1.get(`/v1/rms/venues/${venue_id}/areas`);
|
|
97584
|
-
const responseHours = await instance$1.get(`/resbook/venue/${venue_id}/opening-hours`);
|
|
97585
|
-
const responseTables = await instance$1.get(`/resbook/venue/${venue_id}/tables?sortby[orderPriority]=ASC`);
|
|
97586
|
-
const data2 = {
|
|
97587
|
-
partySizes: formatPartySizeData(responseVenueData),
|
|
97588
|
-
areas: formatAreasData(responseAreas),
|
|
97589
|
-
hours: formatHoursData(responseHours),
|
|
97590
|
-
tables: formatTableData(responseTables),
|
|
97591
|
-
channels: formatChannelsData(responseVenueData),
|
|
97592
|
-
timeZone: formatTimezone(responseVenueData)
|
|
97593
|
-
};
|
|
97594
|
-
return data2;
|
|
97595
|
-
};
|
|
97596
|
-
const formatAreasData = (data2) => {
|
|
97597
|
-
return data2.data ? [{ id: null, label: "All" }, ...data2.data.map((d2) => ({ id: d2.id, label: d2.name }))] : [{ id: null, label: "All" }];
|
|
97598
|
-
};
|
|
97599
|
-
const formatPartySizeData = (data2) => {
|
|
97600
|
-
const { minCovers, maxCovers } = data2;
|
|
97601
|
-
const array4 = createObjectArray(minCovers, maxCovers);
|
|
97602
|
-
return [{ id: null, label: "All" }, ...array4];
|
|
97603
|
-
};
|
|
97604
|
-
const formatTimezone = (data2) => {
|
|
97605
|
-
const { timezone } = data2;
|
|
97606
|
-
return timezone;
|
|
97607
|
-
};
|
|
97608
|
-
const formatChannelsData = (data2) => {
|
|
97609
|
-
const { reservationPortals } = data2;
|
|
97610
|
-
return [{ id: null, label: "All" }, ...reservationPortals.map((p2) => ({ id: p2.id, label: p2.name }))];
|
|
97611
|
-
};
|
|
97612
|
-
const formatHoursData = (data2) => {
|
|
97613
|
-
if (!data2 || typeof data2 !== "object") {
|
|
97614
|
-
console.error("Error fetching opening hours data: Invalid response data");
|
|
97615
|
-
return [];
|
|
97616
|
-
}
|
|
97617
|
-
const formattedData = data2.data.map((d2) => {
|
|
97618
|
-
const weekday2 = d2.weekday;
|
|
97619
|
-
let hours2 = [{ id: null, label: "All" }];
|
|
97620
|
-
if (d2.timeSlots && d2.timeSlots.length && d2.timeSlots.length > 0 && !d2.closed) {
|
|
97621
|
-
d2.timeSlots.map((ts) => {
|
|
97622
|
-
const startTime = hooks(ts.start, "HH:mm");
|
|
97623
|
-
const endTime = hooks(ts.end, "HH:mm");
|
|
97624
|
-
while (startTime.isSameOrBefore(endTime)) {
|
|
97625
|
-
hours2.push({ id: startTime.format("HH:mm"), label: startTime.format("HH:mm") });
|
|
97626
|
-
startTime.add(15, "minutes");
|
|
97627
|
-
}
|
|
97628
|
-
});
|
|
97629
|
-
} else if (!d2.closed) {
|
|
97630
|
-
const startTime = hooks().startOf("day");
|
|
97631
|
-
while (startTime.isSameOrBefore(hooks().endOf("day"))) {
|
|
97632
|
-
hours2.push({ id: startTime.format("HH:mm"), label: startTime.format("HH:mm") });
|
|
97633
|
-
startTime.add(15, "minutes");
|
|
97634
|
-
}
|
|
97635
|
-
} else {
|
|
97636
|
-
hours2.push({ label: "Closed", id: null });
|
|
97637
|
-
}
|
|
97638
|
-
return { weekday: weekday2, hours: hours2 };
|
|
97639
|
-
});
|
|
97640
|
-
return formattedData;
|
|
97641
|
-
};
|
|
97642
|
-
const formatTableData = (data2) => {
|
|
97643
|
-
return data2.data ? [{ id: null, label: "All" }, ...data2.data.map((d2) => ({ id: d2.id, label: d2.name }))] : [{ id: null, label: "All" }];
|
|
97644
|
-
};
|
|
97645
|
-
const createObjectArray = (start, end) => {
|
|
97646
|
-
if (start > end) {
|
|
97647
|
-
return [];
|
|
97648
|
-
}
|
|
97649
|
-
const objectArray = [];
|
|
97650
|
-
for (let i = start; i <= end; i++) {
|
|
97651
|
-
objectArray.push({ id: i, label: i });
|
|
97652
|
-
}
|
|
97653
|
-
return objectArray;
|
|
97654
|
-
};
|
|
97655
97584
|
const pulse$2 = "_pulse_egqe1_1";
|
|
97656
97585
|
const container$2 = "_container_egqe1_13";
|
|
97657
97586
|
const item$3 = "_item_egqe1_19";
|
|
@@ -97672,15 +97601,7 @@ const SkeletonFilters = () => {
|
|
|
97672
97601
|
className: styles$e.item
|
|
97673
97602
|
})));
|
|
97674
97603
|
};
|
|
97675
|
-
const TableFilters$2 = ({ handleSearch, venueId, currentDate
|
|
97676
|
-
const {
|
|
97677
|
-
data: data2,
|
|
97678
|
-
isLoading,
|
|
97679
|
-
error: error3
|
|
97680
|
-
} = useFetch(GetCreateBookingSelectsData, {
|
|
97681
|
-
cacheId: "venueCapacity",
|
|
97682
|
-
venue_id: venueId
|
|
97683
|
-
});
|
|
97604
|
+
const TableFilters$2 = ({ data: data2, isLoading, error: error3, handleSearch, venueId, currentDate }) => {
|
|
97684
97605
|
if (error3) {
|
|
97685
97606
|
return /* @__PURE__ */ React__default.createElement(Error$1, {
|
|
97686
97607
|
error: error3
|
|
@@ -97689,7 +97610,6 @@ const TableFilters$2 = ({ handleSearch, venueId, currentDate, setCurrentTimeZone
|
|
|
97689
97610
|
if (isLoading) {
|
|
97690
97611
|
return /* @__PURE__ */ React__default.createElement(SkeletonFilters, null);
|
|
97691
97612
|
}
|
|
97692
|
-
setCurrentTimeZone(data2.timeZone);
|
|
97693
97613
|
const initialState2 = {
|
|
97694
97614
|
status: statusOptions ? statusOptions[0] : { label: t$3("ALL"), id: null },
|
|
97695
97615
|
channel: data2.channels ? data2.channels[0] : { label: t$3("ALL"), id: null },
|
|
@@ -97913,6 +97833,82 @@ const FilterForm$1 = ({ partyOptions, areasOptions, hoursOptions, setBookingValu
|
|
|
97913
97833
|
onClick: () => handleSubmit()
|
|
97914
97834
|
}, "")));
|
|
97915
97835
|
};
|
|
97836
|
+
const GetCreateBookingSelectsData = async ({
|
|
97837
|
+
venue_id
|
|
97838
|
+
}) => {
|
|
97839
|
+
const responseVenueData = await instance$1.get(`/v1/rms/venues/${venue_id}`);
|
|
97840
|
+
const responseAreas = await instance$1.get(`/v1/rms/venues/${venue_id}/areas`);
|
|
97841
|
+
const responseHours = await instance$1.get(`/resbook/venue/${venue_id}/opening-hours`);
|
|
97842
|
+
const responseTables = await instance$1.get(`/resbook/venue/${venue_id}/tables?sortby[orderPriority]=ASC`);
|
|
97843
|
+
const data2 = {
|
|
97844
|
+
partySizes: formatPartySizeData(responseVenueData),
|
|
97845
|
+
areas: formatAreasData(responseAreas),
|
|
97846
|
+
hours: formatHoursData(responseHours),
|
|
97847
|
+
tables: formatTableData(responseTables),
|
|
97848
|
+
channels: formatChannelsData(responseVenueData),
|
|
97849
|
+
timeZone: formatTimezone(responseVenueData)
|
|
97850
|
+
};
|
|
97851
|
+
return data2;
|
|
97852
|
+
};
|
|
97853
|
+
const formatAreasData = (data2) => {
|
|
97854
|
+
return data2.data ? [{ id: null, label: "All" }, ...data2.data.map((d2) => ({ id: d2.id, label: d2.name }))] : [{ id: null, label: "All" }];
|
|
97855
|
+
};
|
|
97856
|
+
const formatPartySizeData = (data2) => {
|
|
97857
|
+
const { minCovers, maxCovers } = data2;
|
|
97858
|
+
const array4 = createObjectArray(minCovers, maxCovers);
|
|
97859
|
+
return [{ id: null, label: "All" }, ...array4];
|
|
97860
|
+
};
|
|
97861
|
+
const formatTimezone = (data2) => {
|
|
97862
|
+
const { timezone } = data2;
|
|
97863
|
+
return timezone;
|
|
97864
|
+
};
|
|
97865
|
+
const formatChannelsData = (data2) => {
|
|
97866
|
+
const { reservationPortals } = data2;
|
|
97867
|
+
return [{ id: null, label: "All" }, ...reservationPortals.map((p2) => ({ id: p2.id, label: p2.name }))];
|
|
97868
|
+
};
|
|
97869
|
+
const formatHoursData = (data2) => {
|
|
97870
|
+
if (!data2 || typeof data2 !== "object") {
|
|
97871
|
+
console.error("Error fetching opening hours data: Invalid response data");
|
|
97872
|
+
return [];
|
|
97873
|
+
}
|
|
97874
|
+
const formattedData = data2.data.map((d2) => {
|
|
97875
|
+
const weekday2 = d2.weekday;
|
|
97876
|
+
let hours2 = [{ id: null, label: "All" }];
|
|
97877
|
+
if (d2.timeSlots && d2.timeSlots.length && d2.timeSlots.length > 0 && !d2.closed) {
|
|
97878
|
+
d2.timeSlots.map((ts) => {
|
|
97879
|
+
const startTime = hooks(ts.start, "HH:mm");
|
|
97880
|
+
const endTime = hooks(ts.end, "HH:mm");
|
|
97881
|
+
while (startTime.isSameOrBefore(endTime)) {
|
|
97882
|
+
hours2.push({ id: startTime.format("HH:mm"), label: startTime.format("HH:mm") });
|
|
97883
|
+
startTime.add(15, "minutes");
|
|
97884
|
+
}
|
|
97885
|
+
});
|
|
97886
|
+
} else if (!d2.closed) {
|
|
97887
|
+
const startTime = hooks().startOf("day");
|
|
97888
|
+
while (startTime.isSameOrBefore(hooks().endOf("day"))) {
|
|
97889
|
+
hours2.push({ id: startTime.format("HH:mm"), label: startTime.format("HH:mm") });
|
|
97890
|
+
startTime.add(15, "minutes");
|
|
97891
|
+
}
|
|
97892
|
+
} else {
|
|
97893
|
+
hours2.push({ label: "Closed", id: null });
|
|
97894
|
+
}
|
|
97895
|
+
return { weekday: weekday2, hours: hours2 };
|
|
97896
|
+
});
|
|
97897
|
+
return formattedData;
|
|
97898
|
+
};
|
|
97899
|
+
const formatTableData = (data2) => {
|
|
97900
|
+
return data2.data ? [{ id: null, label: "All" }, ...data2.data.map((d2) => ({ id: d2.id, label: d2.name }))] : [{ id: null, label: "All" }];
|
|
97901
|
+
};
|
|
97902
|
+
const createObjectArray = (start, end) => {
|
|
97903
|
+
if (start > end) {
|
|
97904
|
+
return [];
|
|
97905
|
+
}
|
|
97906
|
+
const objectArray = [];
|
|
97907
|
+
for (let i = start; i <= end; i++) {
|
|
97908
|
+
objectArray.push({ id: i, label: i });
|
|
97909
|
+
}
|
|
97910
|
+
return objectArray;
|
|
97911
|
+
};
|
|
97916
97912
|
var momentTimezone$1 = { exports: {} };
|
|
97917
97913
|
var momentTimezone = { exports: {} };
|
|
97918
97914
|
var require$$0 = /* @__PURE__ */ getAugmentedNamespace(moment$2);
|
|
@@ -99398,6 +99394,19 @@ const GetTableAvailability = async ({
|
|
|
99398
99394
|
}
|
|
99399
99395
|
return [];
|
|
99400
99396
|
};
|
|
99397
|
+
const GetTableWalkInAvailability = async ({
|
|
99398
|
+
venue_id,
|
|
99399
|
+
params
|
|
99400
|
+
}) => {
|
|
99401
|
+
if (params && params.startSec) {
|
|
99402
|
+
const responseData = await instance$1.get(`/resbook/venue/${venue_id}/table-availablity/walk-in`, {
|
|
99403
|
+
params: { ...params, limit: 100 }
|
|
99404
|
+
});
|
|
99405
|
+
const data2 = responseData != null ? responseData : [];
|
|
99406
|
+
return data2;
|
|
99407
|
+
}
|
|
99408
|
+
return [];
|
|
99409
|
+
};
|
|
99401
99410
|
const TableAvailability = ({ venueId, setSelectedTable, setBookingValues, params, setParams, currentTimeZone, currentDate }) => {
|
|
99402
99411
|
const { data: data2, reload } = useFetch(GetTableAvailability, { cacheId: "reservation0dashboard0table0availability", venue_id: venueId, params });
|
|
99403
99412
|
const handleOnSelectTable = (row2) => {
|
|
@@ -99512,7 +99521,7 @@ const ContactDetailsForm = ({ venueId, selectedTable, setSelectedTable, setCreat
|
|
|
99512
99521
|
lastname: values.lastname,
|
|
99513
99522
|
email: values.email,
|
|
99514
99523
|
telephone: values.telephone,
|
|
99515
|
-
locale: "
|
|
99524
|
+
locale: "en"
|
|
99516
99525
|
}
|
|
99517
99526
|
};
|
|
99518
99527
|
await execute({
|
|
@@ -100033,6 +100042,65 @@ const formatDateToYYYYMMDD = (date4) => {
|
|
|
100033
100042
|
const day2 = String(date4.getDate()).padStart(2, "0");
|
|
100034
100043
|
return `${year2}-${month2}-${day2}`;
|
|
100035
100044
|
};
|
|
100045
|
+
const WalkinButton = ({ partyOptions, onOpenCreateWalkInReservation, walkInPartySize, setWalkInPartySize }) => {
|
|
100046
|
+
const { t: t2 } = useTranslation();
|
|
100047
|
+
return /* @__PURE__ */ React__default.createElement("select", {
|
|
100048
|
+
className: styles$f.walkingButton,
|
|
100049
|
+
value: walkInPartySize != null ? walkInPartySize : "",
|
|
100050
|
+
onChange: (e3) => {
|
|
100051
|
+
const selectedValue = e3.target.value;
|
|
100052
|
+
setWalkInPartySize(selectedValue);
|
|
100053
|
+
onOpenCreateWalkInReservation();
|
|
100054
|
+
}
|
|
100055
|
+
}, /* @__PURE__ */ React__default.createElement("option", {
|
|
100056
|
+
value: ""
|
|
100057
|
+
}, t2("AddWalKin")), partyOptions.filter((p2) => p2.id).map((p2, i) => /* @__PURE__ */ React__default.createElement("option", {
|
|
100058
|
+
key: i,
|
|
100059
|
+
value: p2.id
|
|
100060
|
+
}, p2.label)));
|
|
100061
|
+
};
|
|
100062
|
+
const CreateWalkInReservation = ({ open, onClose: onClose2, venueId, reloadMainTable, currentTimeZone, currentDate, partySize }) => {
|
|
100063
|
+
const { t: t2 } = useTranslation();
|
|
100064
|
+
const params = {
|
|
100065
|
+
partySize,
|
|
100066
|
+
startSec: moment$1.tz(`${currentDate} 12:00`, currentTimeZone ? currentTimeZone : "").valueOf() / 1e3
|
|
100067
|
+
};
|
|
100068
|
+
const { data: data2, isLoading, reload } = useFetch(GetTableWalkInAvailability, { cacheId: "walkIntableAvailability", venue_id: venueId, params });
|
|
100069
|
+
const { execute, isExecuting } = useService(AddBooking);
|
|
100070
|
+
const handleOnSubmit = async () => {
|
|
100071
|
+
const toSend = {
|
|
100072
|
+
partySize,
|
|
100073
|
+
table: data2.id,
|
|
100074
|
+
date: params.startSec,
|
|
100075
|
+
notes: "Walk-in reservation",
|
|
100076
|
+
contact: {
|
|
100077
|
+
firstname: "Walk-in",
|
|
100078
|
+
lastname: "reservation",
|
|
100079
|
+
email: "walkin@walkin.com",
|
|
100080
|
+
telephone: "Walk-in reservation",
|
|
100081
|
+
locale: "en"
|
|
100082
|
+
}
|
|
100083
|
+
};
|
|
100084
|
+
await execute({
|
|
100085
|
+
venueId,
|
|
100086
|
+
data: toSend
|
|
100087
|
+
});
|
|
100088
|
+
reloadMainTable();
|
|
100089
|
+
onClose2();
|
|
100090
|
+
};
|
|
100091
|
+
return /* @__PURE__ */ React__default.createElement(ModalConfirmation, {
|
|
100092
|
+
title: data2 && data2.id ? t2("AREYOUSURE?") : t2("NoBookingAvailability"),
|
|
100093
|
+
icon: data2 && data2.id ? "calendar" : "no",
|
|
100094
|
+
message: data2 && data2.id ? t2("ConfirmCreateWalkInReservation", { value: partySize }) : t2("NoAvailabilityForPartySize", { value: partySize }),
|
|
100095
|
+
showSubmitButton: data2 && data2.id ? true : false,
|
|
100096
|
+
cancelButtonText: data2 && data2.id ? void 0 : t2("CLOSE"),
|
|
100097
|
+
onAccept: () => handleOnSubmit(),
|
|
100098
|
+
open,
|
|
100099
|
+
onClose: onClose2,
|
|
100100
|
+
isLoading: isLoading || isExecuting,
|
|
100101
|
+
width: 500
|
|
100102
|
+
});
|
|
100103
|
+
};
|
|
100036
100104
|
const ReservationDashboard = ({
|
|
100037
100105
|
Header: Header2,
|
|
100038
100106
|
classNameConatiner,
|
|
@@ -100049,12 +100117,21 @@ const ReservationDashboard = ({
|
|
|
100049
100117
|
"filters[tillZ]": `${dateString}T23:59:59.999`
|
|
100050
100118
|
};
|
|
100051
100119
|
});
|
|
100052
|
-
const
|
|
100120
|
+
const currentTimeZone = useRef(null);
|
|
100053
100121
|
const [currentDate, setCurrentDate] = useState(hooks().format("YYYY-MM-DD"));
|
|
100054
100122
|
const [initialDate, setInitialDate] = useState(hooks().format("YYYY-MM-DD"));
|
|
100055
100123
|
const [openCreateReservation, setOpenCreateReservation] = useState(false);
|
|
100056
100124
|
const onOpenCreateReservation = () => setOpenCreateReservation(true);
|
|
100057
100125
|
const onCloseCreateReservation = () => setOpenCreateReservation(false);
|
|
100126
|
+
const [walkInPartySize, setWalkInPartySize] = useState("");
|
|
100127
|
+
const [openCreateWalkInReservation, setOpenCreateWalkInReservation] = useState(false);
|
|
100128
|
+
const onOpenCreateWalkInReservation = () => {
|
|
100129
|
+
setOpenCreateWalkInReservation(true);
|
|
100130
|
+
};
|
|
100131
|
+
const onCloseCreateWalkInReservation = () => {
|
|
100132
|
+
setWalkInPartySize("");
|
|
100133
|
+
setOpenCreateWalkInReservation(false);
|
|
100134
|
+
};
|
|
100058
100135
|
const [openDetailReservation, setOpenDetailReservation] = useState(false);
|
|
100059
100136
|
const onOpenDetailReservation = () => setOpenDetailReservation(true);
|
|
100060
100137
|
const onCloseDetailReservation = () => setOpenDetailReservation(false);
|
|
@@ -100064,6 +100141,10 @@ const ReservationDashboard = ({
|
|
|
100064
100141
|
const [selectedRow, setSelectedRow] = useState(null);
|
|
100065
100142
|
const { data: data2, isLoading, error: error3, reload } = useFetch(GetBookings, { cacheId: "reservation0dashboard", venue_id: venueId, params });
|
|
100066
100143
|
const { data: bookingSumary, isLoading: bookingSumaryLoading, error: bookingSumaryError, reload: bookingSumaryReload } = useFetch(GetBookingSummary, { cacheId: "bookingSummary", venue_id: venueId, date: initialDate });
|
|
100144
|
+
const { data: filtersData, isLoading: filtersLoading, error: filtersError } = useFetch(GetCreateBookingSelectsData, {
|
|
100145
|
+
cacheId: "venueCapacity",
|
|
100146
|
+
venue_id: venueId
|
|
100147
|
+
});
|
|
100067
100148
|
if (error3 || bookingSumaryError) {
|
|
100068
100149
|
return /* @__PURE__ */ React__default.createElement(Error$1, {
|
|
100069
100150
|
error: error3
|
|
@@ -100079,8 +100160,8 @@ const ReservationDashboard = ({
|
|
|
100079
100160
|
if (values && values.time && values.time.id) {
|
|
100080
100161
|
const utcDate2 = hooks(currentDate).add(values.time.id, "hours").format("YYYY-MM-DDTHH:mm:ss");
|
|
100081
100162
|
const timeZone = new Date(utcDate2).toLocaleTimeString([], {
|
|
100082
|
-
...currentTimeZone ? {
|
|
100083
|
-
timeZone: currentTimeZone
|
|
100163
|
+
...currentTimeZone.current ? {
|
|
100164
|
+
timeZone: currentTimeZone.current
|
|
100084
100165
|
} : {},
|
|
100085
100166
|
hour: "2-digit",
|
|
100086
100167
|
minute: "2-digit",
|
|
@@ -100101,6 +100182,14 @@ const ReservationDashboard = ({
|
|
|
100101
100182
|
useEffect(() => {
|
|
100102
100183
|
bookingSumaryReload();
|
|
100103
100184
|
}, [data2]);
|
|
100185
|
+
useEffect(() => {
|
|
100186
|
+
if (filtersData && filtersData.timeZone) {
|
|
100187
|
+
currentTimeZone.current = filtersData.timeZone;
|
|
100188
|
+
}
|
|
100189
|
+
}, [filtersData]);
|
|
100190
|
+
if (filtersLoading || !filtersData && !filtersData.timeZone) {
|
|
100191
|
+
return /* @__PURE__ */ React__default.createElement(SkeletonPage, null);
|
|
100192
|
+
}
|
|
100104
100193
|
return /* @__PURE__ */ React__default.createElement(LayoutPage$1, {
|
|
100105
100194
|
containerClassName: styles$f.mainConatiner
|
|
100106
100195
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
@@ -100117,24 +100206,27 @@ const ReservationDashboard = ({
|
|
|
100117
100206
|
className: styles$f.datesSectionActionButtons2
|
|
100118
100207
|
}, /* @__PURE__ */ React__default.createElement(Button$3, {
|
|
100119
100208
|
size: "small",
|
|
100120
|
-
|
|
100209
|
+
mode: "danger",
|
|
100121
100210
|
onClick: () => onOpenCreateReservation()
|
|
100122
|
-
}, "Add a reservation"), /* @__PURE__ */ React__default.createElement(
|
|
100123
|
-
|
|
100124
|
-
|
|
100125
|
-
|
|
100126
|
-
|
|
100211
|
+
}, "Add a reservation"), /* @__PURE__ */ React__default.createElement(WalkinButton, {
|
|
100212
|
+
walkInPartySize,
|
|
100213
|
+
setWalkInPartySize,
|
|
100214
|
+
onOpenCreateWalkInReservation,
|
|
100215
|
+
partyOptions: !filtersLoading && filtersData && filtersData.partySizes ? filtersData.partySizes : []
|
|
100216
|
+
}))), /* @__PURE__ */ React__default.createElement("br", null), /* @__PURE__ */ React__default.createElement(Card, {
|
|
100127
100217
|
className: classNameConatiner,
|
|
100128
100218
|
header: Header2
|
|
100129
100219
|
}, /* @__PURE__ */ React__default.createElement("div", {
|
|
100130
100220
|
style: { marginBottom: 40 }
|
|
100131
100221
|
}, /* @__PURE__ */ React__default.createElement(TableFilters$2, {
|
|
100222
|
+
data: filtersData,
|
|
100223
|
+
error: filtersError,
|
|
100224
|
+
isLoading: filtersLoading,
|
|
100132
100225
|
handleSearch: onFilter2,
|
|
100133
100226
|
venueId,
|
|
100134
|
-
currentDate
|
|
100135
|
-
setCurrentTimeZone
|
|
100227
|
+
currentDate
|
|
100136
100228
|
})), isLoading ? /* @__PURE__ */ React__default.createElement(SkeletonPage, null) : /* @__PURE__ */ React__default.createElement(Table$2, {
|
|
100137
|
-
currentTimeZone,
|
|
100229
|
+
currentTimeZone: currentTimeZone.current,
|
|
100138
100230
|
data: data2,
|
|
100139
100231
|
setSelectedRow: (row2) => {
|
|
100140
100232
|
onOpenDetailReservation();
|
|
@@ -100143,22 +100235,30 @@ const ReservationDashboard = ({
|
|
|
100143
100235
|
})), /* @__PURE__ */ React__default.createElement(HoursAvailability, {
|
|
100144
100236
|
open: openHoursAvailability,
|
|
100145
100237
|
onClose: onCloseHoursAvailability,
|
|
100146
|
-
currentTimeZone,
|
|
100238
|
+
currentTimeZone: currentTimeZone.current,
|
|
100147
100239
|
currentDate,
|
|
100148
100240
|
venueId
|
|
100149
100241
|
}), /* @__PURE__ */ React__default.createElement(CreateReservation, {
|
|
100150
100242
|
open: openCreateReservation,
|
|
100151
100243
|
onClose: onCloseCreateReservation,
|
|
100152
|
-
currentTimeZone,
|
|
100244
|
+
currentTimeZone: currentTimeZone.current,
|
|
100153
100245
|
currentDate,
|
|
100154
100246
|
venueId,
|
|
100155
100247
|
reloadMainTable: reload
|
|
100248
|
+
}), walkInPartySize && /* @__PURE__ */ React__default.createElement(CreateWalkInReservation, {
|
|
100249
|
+
open: openCreateWalkInReservation,
|
|
100250
|
+
onClose: onCloseCreateWalkInReservation,
|
|
100251
|
+
currentTimeZone: currentTimeZone.current,
|
|
100252
|
+
currentDate,
|
|
100253
|
+
venueId,
|
|
100254
|
+
reloadMainTable: reload,
|
|
100255
|
+
partySize: walkInPartySize
|
|
100156
100256
|
}), /* @__PURE__ */ React__default.createElement(ReservationDetail, {
|
|
100157
100257
|
open: openDetailReservation,
|
|
100158
100258
|
onClose: onCloseDetailReservation,
|
|
100159
100259
|
selectedRow,
|
|
100160
100260
|
setSelectedRow,
|
|
100161
|
-
currentTimeZone,
|
|
100261
|
+
currentTimeZone: currentTimeZone.current,
|
|
100162
100262
|
venueId,
|
|
100163
100263
|
reloadMainTable: reload
|
|
100164
100264
|
}));
|