@ammarkhalidfarooq/dashboard-package 0.4.85 → 0.4.87
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/dist/index.cjs.js +30 -5
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +30 -5
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -3685,7 +3685,34 @@ var DonationTypeBarChart = function DonationTypeBarChart(_ref) {
|
|
|
3685
3685
|
var summaries = [];
|
|
3686
3686
|
var title = "Donation Type";
|
|
3687
3687
|
var isDistributed = false;
|
|
3688
|
-
if (
|
|
3688
|
+
if (donationTypeData && donationTypeData.data && Array.isArray(donationTypeData.data)) {
|
|
3689
|
+
// Time series recurring vs one-time format
|
|
3690
|
+
categories = donationTypeData.data.map(function (item) {
|
|
3691
|
+
return item.label || "";
|
|
3692
|
+
});
|
|
3693
|
+
series = [{
|
|
3694
|
+
name: "Recurring",
|
|
3695
|
+
data: donationTypeData.data.map(function (item) {
|
|
3696
|
+
return item.recurring || 0;
|
|
3697
|
+
})
|
|
3698
|
+
}, {
|
|
3699
|
+
name: "One-time",
|
|
3700
|
+
data: donationTypeData.data.map(function (item) {
|
|
3701
|
+
return item.oneTime || 0;
|
|
3702
|
+
})
|
|
3703
|
+
}];
|
|
3704
|
+
summaries = [{
|
|
3705
|
+
label: "Recurring",
|
|
3706
|
+
total: donationTypeData.totalRecurringDonations || 0,
|
|
3707
|
+
color: recurringColor
|
|
3708
|
+
}, {
|
|
3709
|
+
label: "One-time",
|
|
3710
|
+
total: donationTypeData.totalOneTimeDonations || 0,
|
|
3711
|
+
color: oneTimeColor
|
|
3712
|
+
}];
|
|
3713
|
+
title = "Recurring vs One-time";
|
|
3714
|
+
isDistributed = false;
|
|
3715
|
+
} else if (Array.isArray(donationTypeData) && donationTypeData.length > 0 && donationTypeData[0].totalAmount !== undefined) {
|
|
3689
3716
|
// New array format
|
|
3690
3717
|
categories = donationTypeData.map(function (item) {
|
|
3691
3718
|
return item.type || "";
|
|
@@ -5214,7 +5241,7 @@ var OverallSection = function OverallSection(_ref) {
|
|
|
5214
5241
|
_useState2 = _slicedToArray(_useState, 2),
|
|
5215
5242
|
activeMetric = _useState2[0],
|
|
5216
5243
|
setActiveMetric = _useState2[1];
|
|
5217
|
-
var donationTypeData = (apiData === null || apiData === void 0 ? void 0 : apiData.
|
|
5244
|
+
var donationTypeData = (apiData === null || apiData === void 0 ? void 0 : apiData.recurringBarChartData) || [];
|
|
5218
5245
|
var donorGeographyData = (apiData === null || apiData === void 0 ? void 0 : apiData.donorGeography1) || [];
|
|
5219
5246
|
var trafficSourceData = (apiData === null || apiData === void 0 ? void 0 : apiData.trafficSource1) || [];
|
|
5220
5247
|
var orderBumpData = (apiData === null || apiData === void 0 ? void 0 : apiData.orderBumpData1) || [];
|
|
@@ -5315,7 +5342,6 @@ var OverallSection = function OverallSection(_ref) {
|
|
|
5315
5342
|
}
|
|
5316
5343
|
};
|
|
5317
5344
|
var activeCampaignsData = (apiData === null || apiData === void 0 ? void 0 : apiData.activeCampaigns) || [];
|
|
5318
|
-
console.log("ACtive campaigns", activeCampaignsData);
|
|
5319
5345
|
var donorMix = apiData === null || apiData === void 0 ? void 0 : apiData.donorPieChartData;
|
|
5320
5346
|
var newDonorsCount = 0;
|
|
5321
5347
|
var returningDonorsCount = 0;
|
|
@@ -5348,6 +5374,7 @@ var OverallSection = function OverallSection(_ref) {
|
|
|
5348
5374
|
avgGift = donorMix.avgGift || 0;
|
|
5349
5375
|
donorMixPrev = donorMix.donorMixPrev || 0;
|
|
5350
5376
|
}
|
|
5377
|
+
console.log("DONOR MIX", donorMix);
|
|
5351
5378
|
var renderCard = function renderCard(title) {
|
|
5352
5379
|
return /*#__PURE__*/jsxRuntime.jsx(MetricCard
|
|
5353
5380
|
// key={title}
|
|
@@ -5667,8 +5694,6 @@ var OverallSection = function OverallSection(_ref) {
|
|
|
5667
5694
|
value: selectedInfo.value,
|
|
5668
5695
|
trend: selectedInfo.subValue
|
|
5669
5696
|
});
|
|
5670
|
-
console.log("Donation Type Data", donationTypeData);
|
|
5671
|
-
console.log("API DATA", apiData);
|
|
5672
5697
|
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
5673
5698
|
children: [/*#__PURE__*/jsxRuntime.jsx(material.Box, {
|
|
5674
5699
|
sx: {
|