diff --git a/client/src/pages/settings/About.tsx b/client/src/pages/settings/About.tsx index 2fc7d94b..11648fff 100644 --- a/client/src/pages/settings/About.tsx +++ b/client/src/pages/settings/About.tsx @@ -38,7 +38,7 @@ export default function About() { and Yu-Ting ('23), who originally wrote the backend.{' '} Roger ('24) helped immensely with Schoology integration, as well as maintaining the backend and scripts. Julia ('24) maintained{' '} - WATT in the 2023-24 school year, and Leo ('26) is now maintaining the app. + WATT in the 2023-24 school year, and Leo ('27) is now maintaining the app. Special thanks to Mylie who designed our lovely logo.

diff --git a/client/src/pages/settings/Features.tsx b/client/src/pages/settings/Features.tsx index e47a418d..fca4ea83 100644 --- a/client/src/pages/settings/Features.tsx +++ b/client/src/pages/settings/Features.tsx @@ -44,7 +44,7 @@ export default function Features() { await updateUserData('options.clock', value, auth, firestore); } - const years = [2024, 2025, 2026, 2027, 0]; + const years = [2025, 2026, 2027, 2028, 0]; return ( diff --git a/functions/src/sgyfetch.ts b/functions/src/sgyfetch.ts index a4ef73ca..ed1f0925 100644 --- a/functions/src/sgyfetch.ts +++ b/functions/src/sgyfetch.ts @@ -18,16 +18,9 @@ async function getSgyInfo(uid: string) { } function getClassInfo(info: string) { - const words = info.split(' '); - const pRegex = info.match(/\((.+)\)/); - let term = null; - if(pRegex) { - const parenblock = pRegex[1]; // 2696 1 FY - const items = parenblock.split(' '); // [2696, 1, FY] - term = items[items.length - 1]; // FY - } - - return { pName: words[0], pTeacher: words[1], term }; + // Period (#### # Course) Teacher + const [, pName, pTeacher] = info.match(/(\d) \(\d{4} \d .*\) (.*)/) || []; + return { pName, pTeacher, term: null } // course names no longer contain the semester } type SgyPeriodData = {n: string, c: string, l: string, o: string, s: string}; @@ -54,6 +47,7 @@ export const init = functions.https.onCall(async (data, context) => { classes[p[0]] = { n: '', c: '', l: '', o: '', s: '' }; } + const sgyPeriods: string[] = [] const teachers: {[key: string]: [string, string]} = {}; for (const element of sgyClasses) { let {pName, pTeacher, term} = getClassInfo(element['section_title']); @@ -69,10 +63,7 @@ export const init = functions.https.onCall(async (data, context) => { s: element.id } - if (['0', '8'].includes(pName)) - await firestore.collection('users').doc(uid) - .update({ [`options.period${pName}`]: true }) - .catch(e => console.log(e)) + sgyPeriods.push(pName) // Zoom is deprecated @@ -89,7 +80,13 @@ export const init = functions.https.onCall(async (data, context) => { } await firestore.collection('users').doc(uid) - .update({classes: classes}) + .update({ + classes, + options: { + period0: sgyPeriods.includes('0'), + period8: sgyPeriods.includes('8') + } + }) .catch(e => console.log(e)) return teachers; diff --git a/scripts/input/alternatesOverrides.json b/scripts/input/alternatesOverrides.json index 9e26dfee..6b0adcd7 100644 --- a/scripts/input/alternatesOverrides.json +++ b/scripts/input/alternatesOverrides.json @@ -1 +1,75 @@ -{} \ No newline at end of file +{ + "08-15": [ + { + "n": "0", + "s": 475, + "e": 530 + }, + { + "n": "1", + "s": 540, + "e": 615 + }, + { + "n": "B", + "s": 615, + "e": 620 + }, + { + "n": "2", + "s": 630, + "e": 700 + }, + { + "n": "S", + "s": 710, + "e": 740, + "grades": [ + 9, + 10 + ] + }, + { + "n": "Assembly", + "s": 710, + "e": 740, + "grades": [ + 11, + 12 + ] + }, + { + "n": "L", + "s": 740, + "e": 770 + }, + { + "n": "Assembly", + "s": 780, + "e": 810, + "grades": [ + 9, + 10 + ] + }, + { + "n": "S", + "s": 780, + "e": 810, + "grades": [ + 11, + 12 + ] + }, + { + "n": "3", + "s": 820, + "e": 890 + }, + { + "n": "4", + "s": 900, + "e": 970 + } + ] +} \ No newline at end of file