From 441b3085fab7f0c83e8eb2df388661d6e18c0120 Mon Sep 17 00:00:00 2001
From: Furkan Sahin <furkan-dev@proton.me>
Date: Mon, 1 Aug 2022 18:13:53 -0500
Subject: WiP parsing of office hours

---
 src/components/FileUploads.svelte | 24 ++++++++++++++++++++++--
 1 file changed, 22 insertions(+), 2 deletions(-)

(limited to 'src/components/FileUploads.svelte')

diff --git a/src/components/FileUploads.svelte b/src/components/FileUploads.svelte
index e5df56f..5f072ea 100644
--- a/src/components/FileUploads.svelte
+++ b/src/components/FileUploads.svelte
@@ -7,8 +7,9 @@
   import {
     parseDatabaseFile,
     parseLabScheduleFile,
+    parseOfficeHoursFile,
     parsePTFile,
-    readQuestionairre,
+    readQuestionnaire,
   } from "../logic/EditorActions";
   import { labStore, ptStore } from "../stores";
 
@@ -16,6 +17,7 @@
   let labSchedule: FileList | null;
   let dbFile: FileList | null;
   let questionairreFile: FileList | null;
+  let officehoursFiles: FileList | null;
   let snackbar: Snackbar;
   let snackbarText;
 
@@ -85,7 +87,13 @@
 
   $: {
     if (questionairreFile?.length) {
-      readQuestionairre(questionairreFile[0]);
+      readQuestionnaire(questionairreFile[0]);
+    }
+  }
+
+  $: {
+    if (officehoursFiles?.length) {
+      parseOfficeHoursFile(officehoursFiles[0]);
     }
   }
 
@@ -193,6 +201,18 @@
       bind:files={questionairreFile}
     />
   </Card>
+
+  <Card
+    title="Office Hours"
+    desc="Upload the office hours output file for it to be parsed. Currently we accept a CSV file representation of a Strawpoll output"
+  >
+    <UploadButton
+      color="btn-warn"
+      accept="text/csv"
+      multiple={false}
+      bind:files={officehoursFiles}
+    /></Card
+  >
 </div>
 
 <!-- https://github.com/saadeghi/daisyui/issues/221 -->
-- 
cgit v1.2.3

