From a19894369bc759c31cde45493f1c41548c0e55d8 Mon Sep 17 00:00:00 2001 From: Furkan Sahin Date: Sat, 30 Jul 2022 17:21:29 -0500 Subject: parsing labs for faculty information, begin displaying lab's faculuty information (in Labs page for example) --- src/components/Labs.svelte | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'src/components') diff --git a/src/components/Labs.svelte b/src/components/Labs.svelte index 9f6e781..4df2184 100644 --- a/src/components/Labs.svelte +++ b/src/components/Labs.svelte @@ -7,7 +7,16 @@ $: labs = [...$labStore.values()].sort((a, b) => a.id - b.id); - let headers = ["", "Course", "Sec", "Time", "Location", "Assigned PT", ""]; + let headers = [ + "", + "Course", + "Sec", + "Time", + "Location", + "Instructor", + "Assigned PT", + "", + ]; $: pts = [...$ptStore.values()]; @@ -23,6 +32,17 @@ ]; }); + function displayFaculty(lab: Lab): string { + if (lab.faculty.length > 0) { + let s: string[] = []; + lab.faculty.forEach((f) => { + s.push(f.displayName); + }); + return s.join(","); + } else { + return "N/A"; + } + } function download() { // prepare data in CSV format let cols = headers.slice(1, -1); @@ -78,6 +98,7 @@ {l.lab?.section} {l.lab?.time} {l.lab?.location} + {displayFaculty(l.lab)} {l.pt?.name ?? "UNASSIGNED"} -- cgit v1.2.3