Skip to content

Commit

Permalink
Merge pull request #749 from cornell-dti/master
Browse files Browse the repository at this point in the history
Fall 2022 Pre-Enroll Release
  • Loading branch information
noschiff authored Nov 4, 2022
2 parents f6a4f3e + c3f309c commit 7a40731
Show file tree
Hide file tree
Showing 205 changed files with 46,102 additions and 24,873 deletions.
1 change: 0 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@
/config/
dist/
/*.js
functions/deployment-template/index.js
2 changes: 2 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ module.exports = {
'no-use-before-define': ['off'],
// allow debugger during development
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-shadow': 'off',
'@typescript-eslint/no-shadow': 'error',
},
settings: {
'import/resolver': {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ on:
push:
branches:
- beta-release
- release

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/checkout@v2
- name: Set up Node
uses: actions/setup-node@v2
with:
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/cd-snapshot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Deploy PR Snapshot
on: pull_request

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Node
uses: actions/setup-node@v2
with:
node-version: '16'
cache: 'npm'
- name: NPM Install
run: npm install
- name: Build
run: npm run build:staging
- name: Deploy
uses: FirebaseExtended/action-hosting-deploy@v0
if: env.SECRET != null
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_CORNELLDTI_COURSEPLAN_DEV }}'
projectId: cornelldti-courseplan-dev
expires: 30d
env:
FIREBASE_CLI_PREVIEWS: hostingchannels
SECRET: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_CORNELLDTI_COURSEPLAN_DEV }}
4 changes: 2 additions & 2 deletions .github/workflows/cd.yml → .github/workflows/cd-staging.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CD
name: Deploy to Staging
on:
push:
branches:
Expand All @@ -8,7 +8,7 @@ jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/checkout@v2
- name: Set up Node
uses: actions/setup-node@v2
with:
Expand Down
31 changes: 18 additions & 13 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,31 @@ name: CI Build
on: pull_request

jobs:
build:
check-lockfile:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/checkout@v2
- name: Set up Node
uses: actions/setup-node@v2
with:
node-version: '16'
cache: 'npm'
- name: NPM Install
run: npm install
- name: Build
run: npm run build:staging
- uses: FirebaseExtended/action-hosting-deploy@v0
if: env.SECRET != null
- name: Check that package-lock.json has no changes
run: exit $(git status --porcelain | wc -l)
check-req-json:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Node
uses: actions/setup-node@v2
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_CORNELLDTI_COURSEPLAN_DEV }}'
projectId: cornelldti-courseplan-dev
expires: 30d
env:
FIREBASE_CLI_PREVIEWS: hostingchannels
SECRET: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_CORNELLDTI_COURSEPLAN_DEV }}
node-version: '16'
cache: 'npm'
- name: NPM Install
run: npm install
- name: Run req-gen
run: npm run req-gen
- name: Check that the requirements json has no changes
run: exit $(git status --porcelain | wc -l)
42 changes: 8 additions & 34 deletions .github/workflows/ci-check.yml
Original file line number Diff line number Diff line change
@@ -1,59 +1,33 @@
name: CI Check
on: push
on:
push:
workflow_dispatch:

jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/checkout@v2
- name: Set up Node
uses: actions/setup-node@v2
with:
node-version: '16'
cache: 'npm'
- name: NPM Clean Install
run: npm ci && cd functions && npm ci
run: npm ci
- name: Run Prettier Check
run: npm run format:check
- name: Run Linter
run: npm run lint
- name: Type Check
- name: Run Type Check
run: npm run type-check
- name: Jest Test
- name: Run Unit Tests
run: npm run test
check-lockfile:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Set up Node
uses: actions/setup-node@v2
with:
node-version: '16'
cache: 'npm'
- name: NPM Install
run: npm install && cd functions && npm install
- name: Check that package-lock.json has no changes
run: exit $(git status --porcelain | wc -l)
check-req-json:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Set up Node
uses: actions/setup-node@v2
with:
node-version: '16'
cache: 'npm'
- name: NPM Install
run: npm install
- name: Run req-gen
run: npm run req-gen
- name: Check that the requirements json has no changes
run: exit $(git status --porcelain | wc -l)
frontend-tests:
runs-on: ubuntu-latest
concurrency: cypress-tests
steps:
- uses: actions/checkout@master
- uses: actions/checkout@v2
- name: Set up Node
uses: actions/setup-node@v2
with:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ci-policies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@ jobs:
enforce-release-workflow:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/checkout@v2
- name: Print base ref and head ref
run: |
echo "Your head ref is ${{ github.head_ref }}."
echo "Your base ref is ${{ github.base_ref }}."
- name: Fail if try to push release from non-master branch
if: github.base_ref == 'beta-release' && github.head_ref != 'master'
if: (github.base_ref == 'beta-release' || github.base_ref == 'release') && github.head_ref != 'master'
run: |
echo "Head ref must be master for release. Everything should go through staging first!"
exit 1
warn-big-diff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/checkout@v2
- uses: cornell-dti/big-diff-warning@master
env:
BOT_TOKEN: '${{ secrets.BOT_TOKEN }}'
8 changes: 4 additions & 4 deletions .github/workflows/track-users.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
name: TrackUsers
name: Track User Analytics
on:
schedule:
- cron: '0 4 * * *'
- cron: '0 4 * * *'

jobs:
track-users:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/checkout@v2
- name: Set up Node
uses: actions/setup-node@v2
with:
node-version: '16'
cache: 'npm'
- name: NPM Clean Install
run: npm ci
- name: Run TrackUsers
- name: Run TrackUsers Script
run: npm run track-users
env:
PROD: true
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/update-courses.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Update Courses Data
on:
workflow_dispatch:
inputs:
semester:
description: 'Semester-Tag (eg. FA22-Nov1)' # ensure there are no spaces
required: true

jobs:
update-courses:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Node
uses: actions/setup-node@v2
with:
node-version: '16'
cache: 'npm'
- name: NPM Clean Install
run: npm ci
- name: Generate Courses Json
run: npm run courses-gen
- name: Generate Requirements Json
run: npm run req-gen
- name: Check Diff
id: diff
run: if [[ $(git status --porcelain | wc -l) -gt 0 ]]; then exit 0; else exit 1; fi;
- name: Log No Diff
if: ${{ failure() && steps.diff.conclusion == 'failure' }}
run: echo "Courses and requirements json are up to date."
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v4
with:
title: "[Automated] Update Courses (${{ github.event.inputs.semester }})"
body: "Ran `npm run courses-gen` and `npm run req-gen`, as part of the update-courses workflow."
commit-message: "[Automated] Update Courses (${{ github.event.inputs.semester }})"
committer: Cornell DTI GitHub Bot <[email protected]>
branch: update-courses/${{ github.event.inputs.semester }}
delete-branch: true
- name: Log Pull Request URL
run: echo "Created pull request - ${{ steps.cpr.outputs.pull-request-url }}"
12 changes: 9 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ node_modules
dist
.vscode
.firebase
requirement-generator-dist/
functions/deployment-template/index.js
.eslintcache

# local env files
Expand All @@ -16,6 +14,9 @@ npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Cypress files
cypress/videos

# Editor directories and files
.idea
.vscode
Expand All @@ -25,6 +26,11 @@ yarn-error.log*
*.sln
*.sw?

# Firebase service account, used for things like logging in for Cypress tests
# Firebase service account, used for things like running scripts and logging in for e2e tests
serviceAccount**
serviceAccount.json
serviceAccountDev.json
serviceAccountProd.json

# App-specific output files that should be ignored
scripts/out
24 changes: 16 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# CoursePlan

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

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.

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

## Project installation
## Project setup

```shell
npm install
Expand All @@ -20,12 +20,20 @@ npm run serve

Then access http://localhost:8080/

## Docs
## Contributors

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

## Contributors
- **Ben Shen** - Developer
- **Noah Schiff** - Developer
- **Jerry Wang** - Developer
- **Andrew Xu** - Developer
- **Vaishnavi Gupta** - Developer
- **Kehui Guo** - Designer
- **Noorejehan Umarn** - Designer
- **Miranda Yu** - PMM
- **Zak Kent** - TPM
- **Michael Farkouh** - PM

### SP22

Expand Down Expand Up @@ -76,7 +84,7 @@ Then access http://localhost:8080/
- **Theresa Cho** - TPM
- **Ein Chang** - PM

### FA2020
### FA20

- **Hahnbee Lee** - Developer
- **Theresa Cho** - Developer
Expand Down
8 changes: 7 additions & 1 deletion cypress/integration/accessibility-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,16 @@ it('Check navbar accessibility', () => {
// Check the accessibility of the requirements sidebar with all toggles fully open
// Note that the selector in checkA11y ensures only the sidebar is inspected
it('Check accessibility of the requirements sidebar', () => {
// Note that there must a completed requirement (i.e. swim test)
cy.get('[data-cyId=semester-addCourse]').click();
cy.get('[data-cyId=newCourse-dropdown]').type('PE 1100');
cy.get('[data-cyId=newCourse-searchResult]').first().click();
cy.get('[data-cyId=modal-button]').click();

// open all dropdowns in the sidebar
cy.get('[data-cyId=requirements-viewMore]').click({ multiple: true });
cy.get('[data-cyId=requirements-showCompleted]').click({ multiple: true });
cy.get('[data-cyId=requirements-displayToggle]').click({ multiple: true });
cy.get('[data-cyId=requirements-displayToggle]').click({ multiple: true, force: true });

cy.checkA11y('[data-cyId=reqsSidebar]');
});
Expand Down
8 changes: 4 additions & 4 deletions cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
// -- This will overwrite an existing command --
// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... })

import firebase from 'firebase/app';
import 'firebase/auth';
import 'firebase/database';
import 'firebase/firestore';
import firebase from 'firebase/compat/app';
import 'firebase/compat/auth';
import 'firebase/compat/database';
import 'firebase/compat/firestore';
import { attachCustomCommands } from 'cypress-firebase';

// Development firebase config copied from firebaseConfig.ts
Expand Down
Loading

0 comments on commit 7a40731

Please sign in to comment.