Skip to content

Commit 7a40731

Browse files
authored
Merge pull request #749 from cornell-dti/master
Fall 2022 Pre-Enroll Release
2 parents f6a4f3e + c3f309c commit 7a40731

File tree

205 files changed

+46102
-24873
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

205 files changed

+46102
-24873
lines changed

.eslintignore

-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,3 @@
22
/config/
33
dist/
44
/*.js
5-
functions/deployment-template/index.js

.eslintrc.js

+2
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ module.exports = {
7575
'no-use-before-define': ['off'],
7676
// allow debugger during development
7777
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
78+
'no-shadow': 'off',
79+
'@typescript-eslint/no-shadow': 'error',
7880
},
7981
settings: {
8082
'import/resolver': {

.github/workflows/release.yml .github/workflows/cd-production.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@ on:
33
push:
44
branches:
55
- beta-release
6+
- release
67

78
jobs:
89
deploy:
910
runs-on: ubuntu-latest
1011
steps:
11-
- uses: actions/checkout@master
12+
- uses: actions/checkout@v2
1213
- name: Set up Node
1314
uses: actions/setup-node@v2
1415
with:

.github/workflows/cd-snapshot.yml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Deploy PR Snapshot
2+
on: pull_request
3+
4+
jobs:
5+
deploy:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@v2
9+
- name: Set up Node
10+
uses: actions/setup-node@v2
11+
with:
12+
node-version: '16'
13+
cache: 'npm'
14+
- name: NPM Install
15+
run: npm install
16+
- name: Build
17+
run: npm run build:staging
18+
- name: Deploy
19+
uses: FirebaseExtended/action-hosting-deploy@v0
20+
if: env.SECRET != null
21+
with:
22+
repoToken: '${{ secrets.GITHUB_TOKEN }}'
23+
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_CORNELLDTI_COURSEPLAN_DEV }}'
24+
projectId: cornelldti-courseplan-dev
25+
expires: 30d
26+
env:
27+
FIREBASE_CLI_PREVIEWS: hostingchannels
28+
SECRET: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_CORNELLDTI_COURSEPLAN_DEV }}

.github/workflows/cd.yml .github/workflows/cd-staging.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: CD
1+
name: Deploy to Staging
22
on:
33
push:
44
branches:
@@ -8,7 +8,7 @@ jobs:
88
deploy:
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/checkout@master
11+
- uses: actions/checkout@v2
1212
- name: Set up Node
1313
uses: actions/setup-node@v2
1414
with:

.github/workflows/ci-build.yml

+18-13
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,31 @@ name: CI Build
22
on: pull_request
33

44
jobs:
5-
build:
5+
check-lockfile:
66
runs-on: ubuntu-latest
77
steps:
8-
- uses: actions/checkout@master
8+
- uses: actions/checkout@v2
99
- name: Set up Node
1010
uses: actions/setup-node@v2
1111
with:
1212
node-version: '16'
1313
cache: 'npm'
1414
- name: NPM Install
1515
run: npm install
16-
- name: Build
17-
run: npm run build:staging
18-
- uses: FirebaseExtended/action-hosting-deploy@v0
19-
if: env.SECRET != null
16+
- name: Check that package-lock.json has no changes
17+
run: exit $(git status --porcelain | wc -l)
18+
check-req-json:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v2
22+
- name: Set up Node
23+
uses: actions/setup-node@v2
2024
with:
21-
repoToken: '${{ secrets.GITHUB_TOKEN }}'
22-
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_CORNELLDTI_COURSEPLAN_DEV }}'
23-
projectId: cornelldti-courseplan-dev
24-
expires: 30d
25-
env:
26-
FIREBASE_CLI_PREVIEWS: hostingchannels
27-
SECRET: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_CORNELLDTI_COURSEPLAN_DEV }}
25+
node-version: '16'
26+
cache: 'npm'
27+
- name: NPM Install
28+
run: npm install
29+
- name: Run req-gen
30+
run: npm run req-gen
31+
- name: Check that the requirements json has no changes
32+
run: exit $(git status --porcelain | wc -l)

.github/workflows/ci-check.yml

+8-34
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,33 @@
11
name: CI Check
2-
on: push
2+
on:
3+
push:
4+
workflow_dispatch:
35

46
jobs:
57
check:
68
runs-on: ubuntu-latest
79
steps:
8-
- uses: actions/checkout@master
10+
- uses: actions/checkout@v2
911
- name: Set up Node
1012
uses: actions/setup-node@v2
1113
with:
1214
node-version: '16'
1315
cache: 'npm'
1416
- name: NPM Clean Install
15-
run: npm ci && cd functions && npm ci
17+
run: npm ci
1618
- name: Run Prettier Check
1719
run: npm run format:check
1820
- name: Run Linter
1921
run: npm run lint
20-
- name: Type Check
22+
- name: Run Type Check
2123
run: npm run type-check
22-
- name: Jest Test
24+
- name: Run Unit Tests
2325
run: npm run test
24-
check-lockfile:
25-
runs-on: ubuntu-latest
26-
steps:
27-
- uses: actions/checkout@master
28-
- name: Set up Node
29-
uses: actions/setup-node@v2
30-
with:
31-
node-version: '16'
32-
cache: 'npm'
33-
- name: NPM Install
34-
run: npm install && cd functions && npm install
35-
- name: Check that package-lock.json has no changes
36-
run: exit $(git status --porcelain | wc -l)
37-
check-req-json:
38-
runs-on: ubuntu-latest
39-
steps:
40-
- uses: actions/checkout@master
41-
- name: Set up Node
42-
uses: actions/setup-node@v2
43-
with:
44-
node-version: '16'
45-
cache: 'npm'
46-
- name: NPM Install
47-
run: npm install
48-
- name: Run req-gen
49-
run: npm run req-gen
50-
- name: Check that the requirements json has no changes
51-
run: exit $(git status --porcelain | wc -l)
5226
frontend-tests:
5327
runs-on: ubuntu-latest
5428
concurrency: cypress-tests
5529
steps:
56-
- uses: actions/checkout@master
30+
- uses: actions/checkout@v2
5731
- name: Set up Node
5832
uses: actions/setup-node@v2
5933
with:

.github/workflows/ci-policies.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,20 @@ jobs:
55
enforce-release-workflow:
66
runs-on: ubuntu-latest
77
steps:
8-
- uses: actions/checkout@master
8+
- uses: actions/checkout@v2
99
- name: Print base ref and head ref
1010
run: |
1111
echo "Your head ref is ${{ github.head_ref }}."
1212
echo "Your base ref is ${{ github.base_ref }}."
1313
- name: Fail if try to push release from non-master branch
14-
if: github.base_ref == 'beta-release' && github.head_ref != 'master'
14+
if: (github.base_ref == 'beta-release' || github.base_ref == 'release') && github.head_ref != 'master'
1515
run: |
1616
echo "Head ref must be master for release. Everything should go through staging first!"
1717
exit 1
1818
warn-big-diff:
1919
runs-on: ubuntu-latest
2020
steps:
21-
- uses: actions/checkout@master
21+
- uses: actions/checkout@v2
2222
- uses: cornell-dti/big-diff-warning@master
2323
env:
2424
BOT_TOKEN: '${{ secrets.BOT_TOKEN }}'

.github/workflows/track-users.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
name: TrackUsers
1+
name: Track User Analytics
22
on:
33
schedule:
4-
- cron: '0 4 * * *'
4+
- cron: '0 4 * * *'
55

66
jobs:
77
track-users:
88
runs-on: ubuntu-latest
99
steps:
10-
- uses: actions/checkout@master
10+
- uses: actions/checkout@v2
1111
- name: Set up Node
1212
uses: actions/setup-node@v2
1313
with:
1414
node-version: '16'
1515
cache: 'npm'
1616
- name: NPM Clean Install
1717
run: npm ci
18-
- name: Run TrackUsers
18+
- name: Run TrackUsers Script
1919
run: npm run track-users
2020
env:
2121
PROD: true

.github/workflows/update-courses.yml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Update Courses Data
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
semester:
6+
description: 'Semester-Tag (eg. FA22-Nov1)' # ensure there are no spaces
7+
required: true
8+
9+
jobs:
10+
update-courses:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
- name: Set up Node
15+
uses: actions/setup-node@v2
16+
with:
17+
node-version: '16'
18+
cache: 'npm'
19+
- name: NPM Clean Install
20+
run: npm ci
21+
- name: Generate Courses Json
22+
run: npm run courses-gen
23+
- name: Generate Requirements Json
24+
run: npm run req-gen
25+
- name: Check Diff
26+
id: diff
27+
run: if [[ $(git status --porcelain | wc -l) -gt 0 ]]; then exit 0; else exit 1; fi;
28+
- name: Log No Diff
29+
if: ${{ failure() && steps.diff.conclusion == 'failure' }}
30+
run: echo "Courses and requirements json are up to date."
31+
- name: Create Pull Request
32+
id: cpr
33+
uses: peter-evans/create-pull-request@v4
34+
with:
35+
title: "[Automated] Update Courses (${{ github.event.inputs.semester }})"
36+
body: "Ran `npm run courses-gen` and `npm run req-gen`, as part of the update-courses workflow."
37+
commit-message: "[Automated] Update Courses (${{ github.event.inputs.semester }})"
38+
committer: Cornell DTI GitHub Bot <[email protected]>
39+
branch: update-courses/${{ github.event.inputs.semester }}
40+
delete-branch: true
41+
- name: Log Pull Request URL
42+
run: echo "Created pull request - ${{ steps.cpr.outputs.pull-request-url }}"

.gitignore

+9-3
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ node_modules
33
dist
44
.vscode
55
.firebase
6-
requirement-generator-dist/
7-
functions/deployment-template/index.js
86
.eslintcache
97

108
# local env files
@@ -16,6 +14,9 @@ npm-debug.log*
1614
yarn-debug.log*
1715
yarn-error.log*
1816

17+
# Cypress files
18+
cypress/videos
19+
1920
# Editor directories and files
2021
.idea
2122
.vscode
@@ -25,6 +26,11 @@ yarn-error.log*
2526
*.sln
2627
*.sw?
2728

28-
# Firebase service account, used for things like logging in for Cypress tests
29+
# Firebase service account, used for things like running scripts and logging in for e2e tests
30+
serviceAccount**
2931
serviceAccount.json
32+
serviceAccountDev.json
3033
serviceAccountProd.json
34+
35+
# App-specific output files that should be ignored
36+
scripts/out

README.md

+16-8
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# CoursePlan
22

3-
Access CoursePlan at [courseplan.io](http://courseplan.io 'courseplan.io')
3+
Access CoursePlan at [courseplan.io](https://courseplan.io)!
44

55
CoursePlan is a four-year academic planner for Cornell undergraduates developed by the Design & Tech Initiative. CoursePlan helps undergraduates track their courses and their requirements automatically depending on their college, major, and minor. It aims to allow students view the big picture of their time at Cornell.
66

7-
View documentation on updating requirements data.
7+
View documentation in our [wiki](https://github.com/cornell-dti/course-plan/wiki).
88

9-
## Project installation
9+
## Project setup
1010

1111
```shell
1212
npm install
@@ -20,12 +20,20 @@ npm run serve
2020

2121
Then access http://localhost:8080/
2222

23-
## Docs
23+
## Contributors
2424

25-
- [Requirements](./src/requirements/README.md)
26-
- [Feature Flags](./src/feature-flags.md)
25+
### FA22
2726

28-
## Contributors
27+
- **Ben Shen** - Developer
28+
- **Noah Schiff** - Developer
29+
- **Jerry Wang** - Developer
30+
- **Andrew Xu** - Developer
31+
- **Vaishnavi Gupta** - Developer
32+
- **Kehui Guo** - Designer
33+
- **Noorejehan Umarn** - Designer
34+
- **Miranda Yu** - PMM
35+
- **Zak Kent** - TPM
36+
- **Michael Farkouh** - PM
2937

3038
### SP22
3139

@@ -76,7 +84,7 @@ Then access http://localhost:8080/
7684
- **Theresa Cho** - TPM
7785
- **Ein Chang** - PM
7886

79-
### FA2020
87+
### FA20
8088

8189
- **Hahnbee Lee** - Developer
8290
- **Theresa Cho** - Developer

cypress/integration/accessibility-spec.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,16 @@ it('Check navbar accessibility', () => {
3838
// Check the accessibility of the requirements sidebar with all toggles fully open
3939
// Note that the selector in checkA11y ensures only the sidebar is inspected
4040
it('Check accessibility of the requirements sidebar', () => {
41+
// Note that there must a completed requirement (i.e. swim test)
42+
cy.get('[data-cyId=semester-addCourse]').click();
43+
cy.get('[data-cyId=newCourse-dropdown]').type('PE 1100');
44+
cy.get('[data-cyId=newCourse-searchResult]').first().click();
45+
cy.get('[data-cyId=modal-button]').click();
46+
4147
// open all dropdowns in the sidebar
4248
cy.get('[data-cyId=requirements-viewMore]').click({ multiple: true });
4349
cy.get('[data-cyId=requirements-showCompleted]').click({ multiple: true });
44-
cy.get('[data-cyId=requirements-displayToggle]').click({ multiple: true });
50+
cy.get('[data-cyId=requirements-displayToggle]').click({ multiple: true, force: true });
4551

4652
cy.checkA11y('[data-cyId=reqsSidebar]');
4753
});

cypress/support/commands.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@
2424
// -- This will overwrite an existing command --
2525
// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... })
2626

27-
import firebase from 'firebase/app';
28-
import 'firebase/auth';
29-
import 'firebase/database';
30-
import 'firebase/firestore';
27+
import firebase from 'firebase/compat/app';
28+
import 'firebase/compat/auth';
29+
import 'firebase/compat/database';
30+
import 'firebase/compat/firestore';
3131
import { attachCustomCommands } from 'cypress-firebase';
3232

3333
// Development firebase config copied from firebaseConfig.ts

0 commit comments

Comments
 (0)