@churchapps/apphelper 0.3.40 → 0.3.41
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReportOutput.d.ts","sourceRoot":"","sources":["../../../src/components/reporting/ReportOutput.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAgC,eAAe,EAAyB,MAAM,qBAAqB,CAAC;AAW3G,UAAU,KAAK;IAAG,OAAO,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,eAAe,CAAA;CAAE;AAE5D,eAAO,MAAM,YAAY,GAAI,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"ReportOutput.d.ts","sourceRoot":"","sources":["../../../src/components/reporting/ReportOutput.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAgC,eAAe,EAAyB,MAAM,qBAAqB,CAAC;AAW3G,UAAU,KAAK;IAAG,OAAO,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,eAAe,CAAA;CAAE;AAE5D,eAAO,MAAM,YAAY,GAAI,OAAO,KAAK,4CAuJxC,CAAA"}
|
|
@@ -93,10 +93,13 @@ const ReportOutput = (props) => {
|
|
|
93
93
|
};
|
|
94
94
|
result.push(obj);
|
|
95
95
|
}
|
|
96
|
-
//
|
|
97
|
-
const
|
|
98
|
-
|
|
99
|
-
|
|
96
|
+
// Collect all unique keys across all objects
|
|
97
|
+
const allKeys = new Set();
|
|
98
|
+
result.forEach(obj => {
|
|
99
|
+
Object.keys(obj).forEach(key => allKeys.add(key));
|
|
100
|
+
});
|
|
101
|
+
// Create headers for all unique keys
|
|
102
|
+
allKeys.forEach(key => headers.push({ label: key, key: key }));
|
|
100
103
|
setCustomHeaders(headers);
|
|
101
104
|
setDetailedPersonSummary(result);
|
|
102
105
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReportOutput.js","sourceRoot":"","sources":["../../../src/components/reporting/ReportOutput.tsx"],"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AAG,EAAE,UAAU,EAAE,EAAE,EAAC,YAAY,EAAC,UAAU,EAAC,WAAW,EAAC,UAAU,EAAE,gBAAM,CAAC,KAAK,CAAC,qBAAqB,CAAC,EAAE,WAAW,EAAE,cAAc,EAAE,YAAE,wCAAI,gBAAM,CAAC,KAAK,CAAC,qBAAqB,CAAC,GAAK,GAAa,CAAC,CAAC;aAErO,IAAI,CAAC,YAAY;YAAE,OAAO,uBAAC,WAAO,KAAG,CAAA;aACrC,CAAC;YACL,OAAO,CAAC,uBAAC,cAAU,IAAC,GAAG,EAAE,UAAU,EAAE,EAAE,EAAC,YAAY,EAAC,UAAU,EAAC,WAAW,EAAC,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,WAAW,EAAE,WAAW,EAAE,cAAc,EAAE,YAC7I,UAAU,EAAE,GACD,CAAC,CAAC;QAChB,CAAC;IACF,CAAC,CAAA;IAED,OAAO,CACN,2DACE,UAAU,EAAE,GACX,CACH,CAAC;AACH,CAAC,CAAA;AAvJY,QAAA,YAAY,gBAuJxB"}
|
package/package.json
CHANGED
|
@@ -15,150 +15,154 @@ import { Link } from "react-router-dom";
|
|
|
15
15
|
interface Props { keyName: string, report: ReportInterface }
|
|
16
16
|
|
|
17
17
|
export const ReportOutput = (props: Props) => {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
18
|
+
const [reportResult, setReportResult] = React.useState<ReportResultInterface>(null);
|
|
19
|
+
const [detailedPersonSummary, setDetailedPersonSummary] = React.useState<any[]>(null);
|
|
20
|
+
const [customHeaders, setCustomHeaders] = React.useState([]);
|
|
21
|
+
const [anchorEl, setAnchorEl] = React.useState<null | HTMLElement>(null);
|
|
22
|
+
const [downloadData, setDownloadData] = React.useState<ReportResultInterface>(null);
|
|
23
|
+
const open = Boolean(anchorEl);
|
|
24
|
+
const contentRef = useRef<HTMLDivElement>(null);
|
|
25
|
+
const isMounted = useMountedState();
|
|
26
|
+
|
|
27
|
+
const handlePrint = useReactToPrint({
|
|
28
|
+
content: () => contentRef.current
|
|
29
|
+
})
|
|
30
|
+
|
|
31
|
+
const populatePeople = async (data: any[]) => {
|
|
32
|
+
let result: any[] = [];
|
|
33
|
+
let headers: { label: string, key: string }[] = [];
|
|
34
|
+
const peopleIds = ArrayHelper.getIds(data, "personId");
|
|
35
|
+
if (peopleIds.length > 0) {
|
|
36
|
+
const people = await ApiHelper.get("/people/ids?ids=" + peopleIds.join(","), "MembershipApi");
|
|
37
|
+
const filteredData = data.filter((d) => d.personId !== null);
|
|
38
|
+
filteredData.forEach((d) => {
|
|
39
|
+
const person: PersonInterface = ArrayHelper.getOne(people, "id", d.personId);
|
|
40
|
+
const funds = Object.assign({}, ...d.funds);
|
|
41
|
+
const obj = {
|
|
42
|
+
firstName: person.name.first,
|
|
43
|
+
lastName: person.name.last,
|
|
44
|
+
email: person.contactInfo?.email,
|
|
45
|
+
address: person.contactInfo.address1 + (person.contactInfo.address2 ? `, ${person.contactInfo.address2}` : ""),
|
|
46
|
+
city: person.contactInfo.city,
|
|
47
|
+
state: person.contactInfo.state,
|
|
48
|
+
zip: person.contactInfo.zip,
|
|
49
|
+
totalDonation: d.totalAmount,
|
|
50
|
+
...funds
|
|
51
|
+
};
|
|
52
|
+
result.push(obj);
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
//for anonymous donations
|
|
57
|
+
const anonDonations = ArrayHelper.getOne(data, "personId", null);
|
|
58
|
+
if (anonDonations) {
|
|
59
|
+
const funds = Object.assign({}, ...anonDonations.funds);
|
|
60
|
+
const obj = {
|
|
61
|
+
firstName: "Anonymous",
|
|
62
|
+
totalDonation: anonDonations.totalAmount,
|
|
63
|
+
...funds
|
|
64
|
+
}
|
|
65
|
+
result.push(obj);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// Collect all unique keys across all objects
|
|
69
|
+
const allKeys = new Set<string>();
|
|
70
|
+
result.forEach(obj => {
|
|
71
|
+
Object.keys(obj).forEach(key => allKeys.add(key));
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
// Create headers for all unique keys
|
|
75
|
+
allKeys.forEach(key => headers.push({ label: key, key: key }));
|
|
76
|
+
|
|
77
|
+
setCustomHeaders(headers);
|
|
78
|
+
setDetailedPersonSummary(result);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
const runReport = () => {
|
|
82
|
+
if (props.report) {
|
|
83
|
+
const queryParams: string[] = [];
|
|
84
|
+
props.report.parameters.forEach(p => {
|
|
85
|
+
if (p.value) queryParams.push(p.keyName + "=" + p.value);
|
|
86
|
+
});
|
|
87
|
+
let url = "/reports/" + props.report.keyName + "/run";
|
|
88
|
+
if (queryParams) url += "?" + queryParams.join("&");
|
|
89
|
+
|
|
90
|
+
ApiHelper.get(url, "ReportingApi").then((data: ReportResultInterface) => {
|
|
91
|
+
if (isMounted()) {
|
|
92
|
+
setReportResult(data);
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
const donationUrl = "/donations/summary?type=person&" + queryParams.join("&");
|
|
97
|
+
ApiHelper.get(donationUrl, "GivingApi").then((data) => { populatePeople(data); });
|
|
98
|
+
|
|
99
|
+
if (props.keyName === "groupAttendance") {
|
|
100
|
+
let url = "/reports/groupAttendanceDownload/run";
|
|
101
|
+
if (queryParams) url += "?" + queryParams.join("&");
|
|
102
|
+
ApiHelper.get(url, "ReportingApi").then((data: ReportResultInterface) => {
|
|
103
|
+
setDownloadData(data);
|
|
104
|
+
})
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
const getExportMenu = (key: number) => {
|
|
110
|
+
const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {
|
|
111
|
+
setAnchorEl(event.currentTarget);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
const handleClose = () => {
|
|
115
|
+
setAnchorEl(null);
|
|
116
|
+
}
|
|
117
|
+
return (<>
|
|
118
|
+
<Button size="small" title={Locale.label("reporting.downloadOptions")} onClick={handleClick} key={key}><Icon>download</Icon></Button>
|
|
119
|
+
<Menu anchorEl={anchorEl} open={open} onClose={handleClose}>
|
|
120
|
+
{reportResult?.table?.length > 0 && <MenuItem sx={{ padding: "5px" }} onClick={handleClose}><ExportLink data={props.keyName === "groupAttendance" ? downloadData?.table : reportResult.table} filename={props.report.displayName.replace(" ", "_") + ".csv"} text={Locale.label("reporting.summary")} icon={props.keyName === "attendanceTrend" ? "calendar_month" : "volunteer_activism"} /></MenuItem>}
|
|
121
|
+
{(props.keyName === "donationSummary" && detailedPersonSummary?.length > 0) && <MenuItem sx={{ padding: "5px" }} onClick={handleClose}><ExportLink data={detailedPersonSummary} filename="Detailed_Donation_Summary.csv" text={Locale.label("reporting.detailed")} icon="person" customHeaders={customHeaders} spaceAfter={true} /></MenuItem>}
|
|
122
|
+
{(props.keyName === "donationSummary" && detailedPersonSummary?.length > 0) && <MenuItem sx={{ padding: "5px" }} onClick={handleClose}><Button onClick={() => { window.open("/downloads/DonationTemplate.docx") }}><Icon sx={{ marginRight: 1 }}>description</Icon>{Locale.label("reporting.sampleTemplate")}</Button></MenuItem>}
|
|
123
|
+
</Menu>
|
|
124
|
+
</>)
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
React.useEffect(runReport, [props.report, isMounted]);
|
|
128
|
+
|
|
129
|
+
const getEditContent = () => {
|
|
130
|
+
const result: JSX.Element[] = [];
|
|
131
|
+
|
|
132
|
+
if (reportResult) {
|
|
133
|
+
result.push(<button type="button" className="no-default-style" key={result.length - 2} onClick={handlePrint} title="print"><Icon>print</Icon></button>);
|
|
134
|
+
}
|
|
135
|
+
if (reportResult?.table.length > 0 || detailedPersonSummary?.length > 0) {
|
|
136
|
+
result.push(getExportMenu(result.length - 1))
|
|
137
|
+
}
|
|
138
|
+
return result;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
const getOutputs = () => {
|
|
142
|
+
const result: JSX.Element[] = [];
|
|
143
|
+
reportResult.outputs.forEach(o => {
|
|
144
|
+
if (o.outputType === "table") result.push(<TableReport key={o.outputType} reportResult={reportResult} output={o} />)
|
|
145
|
+
if (o.outputType === "tree") result.push(<TreeReport key={o.outputType} reportResult={reportResult} output={o} />)
|
|
146
|
+
else if (o.outputType === "barChart") result.push(<ChartReport key={o.outputType} reportResult={reportResult} output={o} />)
|
|
147
|
+
})
|
|
148
|
+
|
|
149
|
+
return result;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
const getResults = () => {
|
|
153
|
+
if (!props.report) return (<DisplayBox ref={contentRef} id="reportsBox" headerIcon="summarize" headerText={Locale.label("reporting.runReport")} editContent={getEditContent()}><p>{Locale.label("reporting.useFilter")}</p></DisplayBox>);
|
|
154
|
+
|
|
155
|
+
else if (!reportResult) return <Loading />
|
|
156
|
+
else {
|
|
157
|
+
return (<DisplayBox ref={contentRef} id="reportsBox" headerIcon="summarize" headerText={props.report.displayName} editContent={getEditContent()}>
|
|
158
|
+
{getOutputs()}
|
|
159
|
+
</DisplayBox>);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
return (
|
|
164
|
+
<>
|
|
165
|
+
{getResults()}
|
|
166
|
+
</>
|
|
167
|
+
);
|
|
164
168
|
}
|