@ammarkhalidfarooq/dashboard-package 0.4.86 → 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 +29 -2
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +29 -2
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -3683,7 +3683,34 @@ var DonationTypeBarChart = function DonationTypeBarChart(_ref) {
|
|
|
3683
3683
|
var summaries = [];
|
|
3684
3684
|
var title = "Donation Type";
|
|
3685
3685
|
var isDistributed = false;
|
|
3686
|
-
if (
|
|
3686
|
+
if (donationTypeData && donationTypeData.data && Array.isArray(donationTypeData.data)) {
|
|
3687
|
+
// Time series recurring vs one-time format
|
|
3688
|
+
categories = donationTypeData.data.map(function (item) {
|
|
3689
|
+
return item.label || "";
|
|
3690
|
+
});
|
|
3691
|
+
series = [{
|
|
3692
|
+
name: "Recurring",
|
|
3693
|
+
data: donationTypeData.data.map(function (item) {
|
|
3694
|
+
return item.recurring || 0;
|
|
3695
|
+
})
|
|
3696
|
+
}, {
|
|
3697
|
+
name: "One-time",
|
|
3698
|
+
data: donationTypeData.data.map(function (item) {
|
|
3699
|
+
return item.oneTime || 0;
|
|
3700
|
+
})
|
|
3701
|
+
}];
|
|
3702
|
+
summaries = [{
|
|
3703
|
+
label: "Recurring",
|
|
3704
|
+
total: donationTypeData.totalRecurringDonations || 0,
|
|
3705
|
+
color: recurringColor
|
|
3706
|
+
}, {
|
|
3707
|
+
label: "One-time",
|
|
3708
|
+
total: donationTypeData.totalOneTimeDonations || 0,
|
|
3709
|
+
color: oneTimeColor
|
|
3710
|
+
}];
|
|
3711
|
+
title = "Recurring vs One-time";
|
|
3712
|
+
isDistributed = false;
|
|
3713
|
+
} else if (Array.isArray(donationTypeData) && donationTypeData.length > 0 && donationTypeData[0].totalAmount !== undefined) {
|
|
3687
3714
|
// New array format
|
|
3688
3715
|
categories = donationTypeData.map(function (item) {
|
|
3689
3716
|
return item.type || "";
|
|
@@ -5212,7 +5239,7 @@ var OverallSection = function OverallSection(_ref) {
|
|
|
5212
5239
|
_useState2 = _slicedToArray(_useState, 2),
|
|
5213
5240
|
activeMetric = _useState2[0],
|
|
5214
5241
|
setActiveMetric = _useState2[1];
|
|
5215
|
-
var donationTypeData = (apiData === null || apiData === void 0 ? void 0 : apiData.
|
|
5242
|
+
var donationTypeData = (apiData === null || apiData === void 0 ? void 0 : apiData.recurringBarChartData) || [];
|
|
5216
5243
|
var donorGeographyData = (apiData === null || apiData === void 0 ? void 0 : apiData.donorGeography1) || [];
|
|
5217
5244
|
var trafficSourceData = (apiData === null || apiData === void 0 ? void 0 : apiData.trafficSource1) || [];
|
|
5218
5245
|
var orderBumpData = (apiData === null || apiData === void 0 ? void 0 : apiData.orderBumpData1) || [];
|