Repository: icssc/AntAlmanac (ts)

Issue:
WebSOC goes live 2/10
## To-Dos
- [ ] Update `termData.ts` with the [correct start date](https://www.reg.uci.edu/calendars/quarterly/2023-2024/quarterly23-24.html)
- [ ] Update test snapshots to reflect the current term, similar to [this](https://github.com/icssc/AntAlmanac/pull/809/files)
- [ ] After adding a new term, use `termData[defaultTerm+1]` for the function `getFinalsStartDate()` (also in `termData.ts`), since we don't want it to start using spring's finals calendar

## Future Followup
- Figure out how to not do this `defaultTerm-1` shenanigan; @adcockdalton, thoughts on diving into this one? Open a new issue and write a nice workaround (maybe check that the current time is after the current term, else go down the list (?))

Pull request:
chore: add spring 2024 to termData
## Summary
1. Added Spring 2024
2. Updated tests
3. Added workaround for default finals start, offsetting by one so that it displays the right dates for *this* Winter 2024 quarter. This should be resolved ASAP.

## Test Plan
1. Just trust me bro

## Issues
Closes #893

## Future Followup
As noted above, I really would like to figure out how to deal with this current term / finals date nonsense.


Patch:
diff --git a/.github/workflows/deploy_staging.yml b/.github/workflows/deploy_staging.yml
index b514eea3..a094ff16 100644
--- a/.github/workflows/deploy_staging.yml
+++ b/.github/workflows/deploy_staging.yml
@@ -48,8 +48,6 @@ jobs:
     get_staging_configuration:
         name: Get staging configuration
 
-        if: (!contains(github.event.pull_request.labels.*.name, 'no deploy'))
-
         runs-on: ubuntu-latest
 
         outputs:
@@ -82,8 +80,6 @@ jobs:
     deploy_staging_frontend:
         name: Deploy frontend staging CloudFormation stack and environment
 
-        if: (!contains(github.event.pull_request.labels.*.name, 'no deploy'))
-
         needs: get_staging_configuration
 
         runs-on: ubuntu-latest
@@ -142,7 +138,7 @@ jobs:
 
         needs: get_staging_configuration
 
-        if: needs.get_staging_configuration.outputs.should-deploy-backend == 'true' && (!contains(github.event.pull_request.labels.*.name, 'no deploy'))
+        if: ${{ needs.get_staging_configuration.outputs.should-deploy-backend == 'true' }}
 
         runs-on: ubuntu-latest
 
diff --git a/apps/antalmanac/src/actions/AppStoreActions.ts b/apps/antalmanac/src/actions/AppStoreActions.ts
index 4bf8caea..4b0ba2e4 100644
--- a/apps/antalmanac/src/actions/AppStoreActions.ts
+++ b/apps/antalmanac/src/actions/AppStoreActions.ts
@@ -139,7 +139,6 @@ export const loadSchedule = async (userId: string, rememberMe: boolean) => {
                     );
                 }
             } catch (e) {
-                console.error(e);
                 openSnackbar(
                     'error',
                     `Failed to load schedules. If this continues to happen, please submit a feedback form.`
diff --git a/apps/antalmanac/src/lib/termData.ts b/apps/antalmanac/src/lib/termData.ts
index 008f45ae..0ea1a2dc 100644
--- a/apps/antalmanac/src/lib/termData.ts
+++ b/apps/antalmanac/src/lib/termData.ts
@@ -27,6 +27,7 @@ class Term {
  * Months are 0-indexed
  */
 const termData = [
+    new Term('2024 Spring', '2024 Spring Quarter', [2024, 3, 1], [2024, 5, 8]),
     new Term('2024 Winter', '2024 Winter Quarter', [2024, 0, 8], [2024, 2, 16]),
     new Term('2023 Fall', '2023 Fall Quarter', [2023, 8, 28]),
     new Term('2023 Summer2', '2023 Summer Session 2', [2023, 7, 7]),
@@ -92,7 +93,8 @@ function getDefaultTerm() {
 
 // Returns the default finals start as array
 function getDefaultFinalsStart() {
-    return termData[defaultTerm].finalsStartDate;
+    // FIXME: Un-offset once Spring starts, or figure out a proper fix
+    return termData[defaultTerm + 1].finalsStartDate;
 }
 
 /**
@@ -100,7 +102,8 @@ function getDefaultFinalsStart() {
  * Days offset by 1 to accomodate toggling with Saturday finals
  */
 function getDefaultFinalsStartDate() {
-    const [year, month, day] = termData[defaultTerm].finalsStartDate || [];
+    // FIXME: Un-offset once Spring starts, or figure out a proper fix
+    const [year, month, day] = termData[defaultTerm + 1].finalsStartDate || [];
     return year && month && day ? new Date(year, month, day + 1) : undefined;
 }
 
diff --git a/apps/antalmanac/src/stores/Schedules.ts b/apps/antalmanac/src/stores/Schedules.ts
index 1179bb16..8fc35461 100644
--- a/apps/antalmanac/src/stores/Schedules.ts
+++ b/apps/antalmanac/src/stores/Schedules.ts
@@ -530,7 +530,6 @@ export class Schedules {
                 });
             }
         } catch (e) {
-            console.error(e);
             this.revertState();
             throw new Error('Unable to load schedule');
         }


Test patch:
diff --git a/apps/antalmanac/tests/__snapshots__/download-ics.test.ts.snap b/apps/antalmanac/tests/__snapshots__/download-ics.test.ts.snap
index d5672bc7..5e21461e 100644
--- a/apps/antalmanac/tests/__snapshots__/download-ics.test.ts.snap
+++ b/apps/antalmanac/tests/__snapshots__/download-ics.test.ts.snap
@@ -50,8 +50,8 @@ Taught by placeholderInstructor1/placeholderInstructor2",
   {
     "end": [
       2024,
+      4,
       1,
-      8,
       3,
       4,
     ],
@@ -60,8 +60,8 @@ Taught by placeholderInstructor1/placeholderInstructor2",
     "recurrenceRule": "FREQ=WEEKLY;BYDAY=MO,WE,FR;INTERVAL=1;COUNT=30",
     "start": [
       2024,
+      4,
       1,
-      8,
       1,
       2,
     ],
diff --git a/apps/antalmanac/tests/calendarize-helpers.test.ts b/apps/antalmanac/tests/calendarize-helpers.test.ts
index 883eccee..785b789b 100644
--- a/apps/antalmanac/tests/calendarize-helpers.test.ts
+++ b/apps/antalmanac/tests/calendarize-helpers.test.ts
@@ -166,7 +166,7 @@ describe('calendarize-helpers', () => {
             instructors: [],
             sectionCode: 'placeholderSectionCode',
             sectionType: 'Fin',
-            start: new Date(2024, 2, 17, 1, 2), // Predicated on default term being Winter 2024
+            start: new Date(2024, 2, 17, 1, 2), // Predicated on default term being Spring 2024
             end: new Date(2024, 2, 17, 3, 4), // ...
             finalExam: {
                 examStatus: 'SCHEDULED_FINAL',