From 1ef38ce38bc2823ad603fe42f4b918cfab04683c Mon Sep 17 00:00:00 2001 From: Furkan Sahin Date: Sun, 7 Aug 2022 22:41:41 -0500 Subject: Display assigned PT's emails as well as output it to CSV --- src/components/Labs.svelte | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'src/components/Labs.svelte') diff --git a/src/components/Labs.svelte b/src/components/Labs.svelte index bddf607..680c6f1 100644 --- a/src/components/Labs.svelte +++ b/src/components/Labs.svelte @@ -14,6 +14,7 @@ "Location", "Instructor", "Assigned PT", + "PT Email", "", ]; @@ -43,13 +44,19 @@ } function download() { // prepare data in CSV format - let cols = headers.slice(1, -1); + let cols = headers.slice(1); let csv = cols.join(",") + "\n"; labsAndPts.forEach((row) => { let l = row.lab; - csv += `${l.course} - ${l.section},${l.time},${ - l.location - },${displayFaculty(l)},${row.pt?.name ?? "UNASSIGNED"}\n`; + csv += + [ + `${l.course} - ${l.section}`, + l.time, + l.location, + displayFaculty(l), + row.pt?.name ?? "UNASSIGNED", + row.pt?.email ?? "N/A", + ].join(",") + "\n"; }); const blob = new Blob([csv], { type: "text/csv" }); @@ -102,6 +109,7 @@ {l.lab?.location} {displayFaculty(l.lab)} {l.pt?.name ?? "UNASSIGNED"} + {l.pt?.email ?? "N/A"} {/each} -- cgit v1.2.3