mozrest-sdk-react-dev 0.2.41 → 0.2.43
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 +21 -21
- package/package.json +1 -1
package/mozrest-sdk.es.js
CHANGED
|
@@ -78840,7 +78840,7 @@ const LoadingStat$1 = ({ data: data2, type: type4, period }) => {
|
|
|
78840
78840
|
return isLoading;
|
|
78841
78841
|
};
|
|
78842
78842
|
const DasboardBookingAnalytics = ({ data: data2 }) => {
|
|
78843
|
-
var _a2, _b, _c, _d, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I;
|
|
78843
|
+
var _a2, _b, _c, _d, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L;
|
|
78844
78844
|
const { t: t2 } = useTranslation();
|
|
78845
78845
|
const isLoadingTodayBookings = LoadingStat$1({
|
|
78846
78846
|
data: data2,
|
|
@@ -78924,7 +78924,7 @@ const DasboardBookingAnalytics = ({ data: data2 }) => {
|
|
|
78924
78924
|
sm: 12,
|
|
78925
78925
|
md: 8
|
|
78926
78926
|
}, /* @__PURE__ */ React__default.createElement(StatsCard, {
|
|
78927
|
-
value: data2.bookings.today,
|
|
78927
|
+
value: (_a2 = data2.bookings.today) != null ? _a2 : 0,
|
|
78928
78928
|
title: t2("BOOKINGS"),
|
|
78929
78929
|
loading: false,
|
|
78930
78930
|
loadingValue: isLoadingTodayBookings,
|
|
@@ -78935,23 +78935,23 @@ const DasboardBookingAnalytics = ({ data: data2 }) => {
|
|
|
78935
78935
|
params: [
|
|
78936
78936
|
{
|
|
78937
78937
|
title: t2("SAMETIMEYESTERDAY"),
|
|
78938
|
-
value: (
|
|
78938
|
+
value: (_d = (_c = (_b = data2 == null ? void 0 : data2.bookings) == null ? void 0 : _b.yesterday) == null ? void 0 : _c.toLocaleString()) != null ? _d : "0",
|
|
78939
78939
|
loadingValue: isLoadingYesterdayBookings
|
|
78940
78940
|
},
|
|
78941
78941
|
{
|
|
78942
78942
|
title: t2("SAMETIMELASTWEEK"),
|
|
78943
|
-
value: (
|
|
78943
|
+
value: (_g = (_f = (_e2 = data2 == null ? void 0 : data2.bookings) == null ? void 0 : _e2.lastWeek) == null ? void 0 : _f.toLocaleString()) != null ? _g : "0",
|
|
78944
78944
|
loadingValue: isLoadingLastWeekBookings
|
|
78945
78945
|
},
|
|
78946
78946
|
{
|
|
78947
78947
|
title: t2("SAMETIMELASTMONTH"),
|
|
78948
|
-
value: (
|
|
78948
|
+
value: (_j = (_i = (_h = data2 == null ? void 0 : data2.bookings) == null ? void 0 : _h.lastMonth) == null ? void 0 : _i.toLocaleString()) != null ? _j : "0",
|
|
78949
78949
|
loadingValue: isLoadingLastMonthBookings,
|
|
78950
78950
|
tooltip: t2("SAMETIMELASTMONTH")
|
|
78951
78951
|
},
|
|
78952
78952
|
{
|
|
78953
78953
|
title: t2("SAMETIMELASTYEAR"),
|
|
78954
|
-
value: (
|
|
78954
|
+
value: (_m = (_l = (_k = data2 == null ? void 0 : data2.bookings) == null ? void 0 : _k.lastYear) == null ? void 0 : _l.toLocaleString()) != null ? _m : "0",
|
|
78955
78955
|
loadingValue: isLoadingLastYearBookings
|
|
78956
78956
|
}
|
|
78957
78957
|
].filter((param2, i) => i === 0 || parseInt(param2.value) > 0)
|
|
@@ -78960,7 +78960,7 @@ const DasboardBookingAnalytics = ({ data: data2 }) => {
|
|
|
78960
78960
|
sm: 12,
|
|
78961
78961
|
md: 8
|
|
78962
78962
|
}, /* @__PURE__ */ React__default.createElement(StatsCard, {
|
|
78963
|
-
value: data2.covers.today,
|
|
78963
|
+
value: (_n = data2.covers.today) != null ? _n : 0,
|
|
78964
78964
|
title: t2("COVERS"),
|
|
78965
78965
|
loadingValue: isLoadingTodayCovers,
|
|
78966
78966
|
icon: /* @__PURE__ */ React__default.createElement(CircleIcon, {
|
|
@@ -78971,23 +78971,23 @@ const DasboardBookingAnalytics = ({ data: data2 }) => {
|
|
|
78971
78971
|
params: [
|
|
78972
78972
|
{
|
|
78973
78973
|
title: t2("SAMETIMEYESTERDAY"),
|
|
78974
|
-
value: (
|
|
78974
|
+
value: (_q = (_p = (_o = data2 == null ? void 0 : data2.covers) == null ? void 0 : _o.yesterday) == null ? void 0 : _p.toLocaleString()) != null ? _q : "0",
|
|
78975
78975
|
loadingValue: isLoadingYesterdayCovers
|
|
78976
78976
|
},
|
|
78977
78977
|
{
|
|
78978
78978
|
title: t2("SAMETIMELASTWEEK"),
|
|
78979
|
-
value: (
|
|
78979
|
+
value: (_t = (_s = (_r = data2 == null ? void 0 : data2.covers) == null ? void 0 : _r.lastWeek) == null ? void 0 : _s.toLocaleString()) != null ? _t : "0",
|
|
78980
78980
|
loadingValue: isLoadingLastWeekCovers
|
|
78981
78981
|
},
|
|
78982
78982
|
{
|
|
78983
78983
|
title: t2("SAMETIMELASTMONTH"),
|
|
78984
|
-
value: (
|
|
78984
|
+
value: (_w = (_v = (_u = data2 == null ? void 0 : data2.covers) == null ? void 0 : _u.lastMonth) == null ? void 0 : _v.toLocaleString()) != null ? _w : "0",
|
|
78985
78985
|
loadingValue: isLoadingLastMonthCovers,
|
|
78986
78986
|
tooltip: t2("SAMETIMELASTMONTH")
|
|
78987
78987
|
},
|
|
78988
78988
|
{
|
|
78989
78989
|
title: t2("SAMETIMELASTYEAR"),
|
|
78990
|
-
value: (
|
|
78990
|
+
value: (_z = (_y = (_x = data2 == null ? void 0 : data2.covers) == null ? void 0 : _x.lastYear) == null ? void 0 : _y.toLocaleString()) != null ? _z : "0",
|
|
78991
78991
|
loadingValue: isLoadingLastYearCovers
|
|
78992
78992
|
}
|
|
78993
78993
|
].filter((param2, i) => i === 0 || parseInt(param2.value) > 0)
|
|
@@ -78996,7 +78996,7 @@ const DasboardBookingAnalytics = ({ data: data2 }) => {
|
|
|
78996
78996
|
sm: 24,
|
|
78997
78997
|
md: 8
|
|
78998
78998
|
}, /* @__PURE__ */ React__default.createElement(StatsCard, {
|
|
78999
|
-
value: data2.cancelations.today,
|
|
78999
|
+
value: (_A = data2.cancelations.today) != null ? _A : 0,
|
|
79000
79000
|
title: t2("CANCELATIONS"),
|
|
79001
79001
|
loadingValue: isLoadingTodayCancelations,
|
|
79002
79002
|
icon: /* @__PURE__ */ React__default.createElement(CircleIcon, {
|
|
@@ -79007,23 +79007,23 @@ const DasboardBookingAnalytics = ({ data: data2 }) => {
|
|
|
79007
79007
|
params: [
|
|
79008
79008
|
{
|
|
79009
79009
|
title: t2("SAMETIMEYESTERDAY"),
|
|
79010
|
-
value: (
|
|
79010
|
+
value: (_D = (_C = (_B = data2 == null ? void 0 : data2.cancelations) == null ? void 0 : _B.yesterday) == null ? void 0 : _C.toLocaleString()) != null ? _D : "0",
|
|
79011
79011
|
loadingValue: isLoadingYesterdayCancelations
|
|
79012
79012
|
},
|
|
79013
79013
|
{
|
|
79014
79014
|
title: t2("SAMETIMELASTWEEK"),
|
|
79015
|
-
value: (
|
|
79015
|
+
value: (_G = (_F = (_E = data2 == null ? void 0 : data2.cancelations) == null ? void 0 : _E.lastWeek) == null ? void 0 : _F.toLocaleString()) != null ? _G : "0",
|
|
79016
79016
|
loadingValue: isLoadingLastWeekCancelations
|
|
79017
79017
|
},
|
|
79018
79018
|
{
|
|
79019
79019
|
title: t2("SAMETIMELASTMONTH"),
|
|
79020
|
-
value: (
|
|
79020
|
+
value: (_I = (_H = data2 == null ? void 0 : data2.cancelations.lastMonth) == null ? void 0 : _H.toLocaleString()) != null ? _I : "0",
|
|
79021
79021
|
loadingValue: isLoadingLastMonthCancelations,
|
|
79022
79022
|
tooltip: t2("SAMETIMELASTMONTH")
|
|
79023
79023
|
},
|
|
79024
79024
|
{
|
|
79025
79025
|
title: t2("SAMETIMELASTYEAR"),
|
|
79026
|
-
value: (
|
|
79026
|
+
value: (_L = (_K = (_J = data2 == null ? void 0 : data2.cancelations) == null ? void 0 : _J.lastYear) == null ? void 0 : _K.toLocaleString()) != null ? _L : "0",
|
|
79027
79027
|
loadingValue: isLoadingLastYearCancelations
|
|
79028
79028
|
}
|
|
79029
79029
|
].filter((param2, i) => i === 0 || parseInt(param2.value) > 0)
|
|
@@ -79038,7 +79038,7 @@ const DashboardBookingAnalyticsContainer = ({ venueId }) => {
|
|
|
79038
79038
|
lastMonth: [now2.clone().subtract(1, "months").startOf("day").toISOString(), now2.clone().subtract(1, "months").endOf("day").toISOString()],
|
|
79039
79039
|
lastYear: [now2.clone().subtract(1, "years").startOf("day").toISOString(), now2.clone().subtract(1, "years").endOf("day").toISOString()]
|
|
79040
79040
|
};
|
|
79041
|
-
const [bookingStats, setBookingStats] = useState(
|
|
79041
|
+
const [bookingStats, setBookingStats] = useState(getDefaultBookingData());
|
|
79042
79042
|
const fetchBookingStat = async (payload, cancellations, dateType) => {
|
|
79043
79043
|
const params = { ...payload };
|
|
79044
79044
|
if (cancellations) {
|
|
@@ -79073,7 +79073,7 @@ const DashboardBookingAnalyticsContainer = ({ venueId }) => {
|
|
|
79073
79073
|
};
|
|
79074
79074
|
useEffect(() => {
|
|
79075
79075
|
if (venueId) {
|
|
79076
|
-
setBookingStats(
|
|
79076
|
+
setBookingStats(getDefaultBookingData());
|
|
79077
79077
|
const params = venueId !== "all" ? {
|
|
79078
79078
|
"filters[venues][]": venueId
|
|
79079
79079
|
} : {};
|
|
@@ -79085,7 +79085,7 @@ const DashboardBookingAnalyticsContainer = ({ venueId }) => {
|
|
|
79085
79085
|
data: bookingStats
|
|
79086
79086
|
});
|
|
79087
79087
|
};
|
|
79088
|
-
const
|
|
79088
|
+
const getDefaultBookingData = () => ({
|
|
79089
79089
|
bookings: {
|
|
79090
79090
|
today: null,
|
|
79091
79091
|
yesterday: null,
|
|
@@ -79107,7 +79107,7 @@ const defaultBookingData = {
|
|
|
79107
79107
|
lastMonth: null,
|
|
79108
79108
|
lastYear: null
|
|
79109
79109
|
}
|
|
79110
|
-
};
|
|
79110
|
+
});
|
|
79111
79111
|
const formatStats = (stat) => {
|
|
79112
79112
|
var _a2;
|
|
79113
79113
|
let sum = 0;
|
|
@@ -85894,7 +85894,7 @@ const FormToolBar = ({
|
|
|
85894
85894
|
venueId,
|
|
85895
85895
|
onDisconnect,
|
|
85896
85896
|
isDisconnecting: facebookPublishing === "in_progress"
|
|
85897
|
-
}),
|
|
85897
|
+
}), /* @__PURE__ */ React__default.createElement(TripadvisorButton, {
|
|
85898
85898
|
venueId,
|
|
85899
85899
|
isConnected: TripadvisorConnected,
|
|
85900
85900
|
reload: reloadConnect,
|