Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backend Update #721

Merged
merged 99 commits into from
Aug 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
99 commits
Select commit Hold shift + click to select a range
2edbde4
Set up testing infrastructure
Freeassassin Jul 19, 2023
3db6af0
set up testing docker containers
Freeassassin Jul 19, 2023
0ec7793
Update automated tests
Freeassassin Jul 20, 2023
f75ec4e
Update packages and linter
Freeassassin Jul 20, 2023
0572378
Update announcementServices
Freeassassin Jul 20, 2023
9c12966
Update FaqServices
Freeassassin Jul 20, 2023
2effe15
Updated FroshServices
Freeassassin Jul 20, 2023
176232b
Update LeadurServices.js
Freeassassin Jul 20, 2023
d2e0f4c
Update ScuntServices
Freeassassin Jul 20, 2023
8d0929f
Update TimelineServices
Freeassassin Jul 20, 2023
5999def
Update passport services
Freeassassin Jul 20, 2023
b5d4b3d
Update PaymentServices
Freeassassin Jul 20, 2023
aacdc61
Update UserServices
Freeassassin Jul 20, 2023
f6248eb
Merge pull request #688 from UofT-Frosh-Orientation/637-update-packag…
Freeassassin Jul 20, 2023
4a63f6c
Merge branch '687-refactor-testing' of https://github.com/UofT-Frosh-…
Freeassassin Jul 21, 2023
f827348
Merge pull request #689 from UofT-Frosh-Orientation/55-set-up-automat…
Freeassassin Jul 21, 2023
bc0d09c
Added AnnouncementServices tests
Freeassassin Jul 21, 2023
b396d0c
quick fix
Freeassassin Jul 22, 2023
50b02cd
Update automated_tests.yml
Freeassassin Jul 22, 2023
c9ad24b
drafted test scripts for scunt game settings
uzFer Aug 4, 2023
626ef5f
made draft for testing scunt team services, missing some transaction …
uzFer Aug 4, 2023
8867cd2
Update automated testing
Freeassassin Aug 6, 2023
6cea34e
Update testing config
Freeassassin Aug 6, 2023
2262038
Updated announcement tests
Freeassassin Aug 6, 2023
58ea963
Updated function name and fix undefs
Freeassassin Aug 6, 2023
7d9cc07
Added continuous testing
Freeassassin Aug 6, 2023
1b8485b
WIP adding user services tests
Freeassassin Aug 6, 2023
503df59
Merge branch '687-refactor-testing' of https://github.com/UofT-Frosh-…
Freeassassin Aug 6, 2023
bd6698b
was able to pass tests, could not figure out one invalid setting check
uzFer Aug 9, 2023
3628054
all tests pass, some functions missing due to invalid settings or unc…
uzFer Aug 9, 2023
d1a2fd3
checkTransaction test works and one test for viewRecentTransactions
uzFer Aug 10, 2023
732b09d
commented out failing one + added an error check for deleteTransaction
uzFer Aug 10, 2023
f2b776c
tests pass for addTransaction and subtractTransaction
uzFer Aug 13, 2023
41acc76
touch ups to test cases (adding more fields to check for)
uzFer Aug 13, 2023
bab78ab
Changing Scunt Mission Function to reflect new functionality from oth…
Tanushanth Aug 13, 2023
89cdfd2
Draft for cases written (Not fully functional)
Tanushanth Aug 13, 2023
a9e2d8f
Update test workflow
Freeassassin Aug 14, 2023
52c3778
testing badge
Freeassassin Aug 14, 2023
8870240
testing badge
Freeassassin Aug 14, 2023
52a7d23
Update workflows
Freeassassin Aug 14, 2023
4c0d57f
testing badge
Freeassassin Aug 14, 2023
2f6e091
testing badge
Freeassassin Aug 14, 2023
6bbb485
Update to tests (UpdateMissionVisibility still not working)
Tanushanth Aug 14, 2023
62f051d
Merge pull request #714 from UofT-Frosh-Orientation/705-scunt-game-se…
Freeassassin Aug 14, 2023
a53eb1c
Merge branch 'dev' into 687-refactor-testing
Freeassassin Aug 14, 2023
cacd2ee
idk if this is right but deleteTransaction works??
uzFer Aug 15, 2023
0e3e703
just pushing whatever passed
uzFer Aug 16, 2023
8748913
Tests for initFroshGroups and getNewFroshGroup
Tanushanth Aug 17, 2023
3c3f8b0
Changes for frosh services (option to pass in array in getNewFroshGroup)
Tanushanth Aug 17, 2023
e356588
Created tests for all frosh service functions
Tanushanth Aug 17, 2023
8cddc06
Small Fixes
Tanushanth Aug 17, 2023
3a72c01
Fixed testing for the visibility function (returns a matchedCount fou…
Tanushanth Aug 17, 2023
3946534
pushing wtv works
uzFer Aug 17, 2023
c1c87bd
Clean up
Tanushanth Aug 17, 2023
fc2ef54
Altering Visibility function to use modifiedcount to throw error corr…
Tanushanth Aug 17, 2023
a40475d
quick fixes
Freeassassin Aug 18, 2023
d2ac684
Merge pull request #726 from UofT-Frosh-Orientation/702-frosh-service…
Freeassassin Aug 18, 2023
84c1499
quick fixes and formatting
Freeassassin Aug 18, 2023
be2cb6e
Merge branch '687-refactor-testing' of https://github.com/UofT-Frosh-…
Freeassassin Aug 18, 2023
476aaa5
Merge pull request #727 from UofT-Frosh-Orientation/706-scunt-mission…
Freeassassin Aug 18, 2023
347cf40
quick fixes
Freeassassin Aug 20, 2023
725d2eb
Merge branch '687-refactor-testing' of https://github.com/UofT-Frosh-…
Freeassassin Aug 21, 2023
1fcdec6
Update scunt init game settings
Freeassassin Aug 21, 2023
fb3b87a
remove map frosh users from coverage
Freeassassin Aug 21, 2023
2435401
update get all scunt missions
Freeassassin Aug 21, 2023
6fca73b
Update user services and tests
Freeassassin Aug 21, 2023
6fac5d2
update email confirmation subscription
Freeassassin Aug 21, 2023
fd8e6f7
update test formatting
Freeassassin Aug 21, 2023
c5333d2
update testing config
Freeassassin Aug 21, 2023
bb2a4ae
Merge pull request #733 from UofT-Frosh-Orientation/701-user-services…
Freeassassin Aug 21, 2023
cc04a47
Update passport
Freeassassin Aug 21, 2023
5353125
Update faq services and tests
Freeassassin Aug 21, 2023
05bd374
Merge pull request #734 from UofT-Frosh-Orientation/699-faq-services-…
Freeassassin Aug 21, 2023
b1ca900
Update timeline services and tests
Freeassassin Aug 21, 2023
d31bc8e
Merge pull request #735 from UofT-Frosh-Orientation/700-timeline-serv…
Freeassassin Aug 21, 2023
1371d05
Merge branch '687-refactor-testing' of https://github.com/UofT-Frosh-…
Freeassassin Aug 21, 2023
33f2b92
Update scunt team services and tests
Freeassassin Aug 21, 2023
eae9364
Update scunt team services
Freeassassin Aug 21, 2023
9f2a023
Update scunt team services and tests
Freeassassin Aug 22, 2023
b2542c9
Update scunt team tests
Freeassassin Aug 22, 2023
afcfe84
Merge pull request #715 from UofT-Frosh-Orientation/707-scunt-team-se…
Freeassassin Aug 22, 2023
e524d6c
Merge branch 'dev' of https://github.com/UofT-Frosh-Orientation/orien…
Freeassassin Aug 22, 2023
69a23e3
Update leadur services and tests
Freeassassin Aug 24, 2023
5c8bef4
Merge pull request #737 from UofT-Frosh-Orientation/703-leadur-servic…
Freeassassin Aug 24, 2023
7152021
Update payments controller
Freeassassin Aug 24, 2023
a4fdd02
Update payments services and tests
Freeassassin Aug 24, 2023
42b3fd1
integrate with other tests
Freeassassin Aug 24, 2023
abdfca2
Merge pull request #738 from UofT-Frosh-Orientation/704-payment-servi…
Freeassassin Aug 24, 2023
6a5fadd
update packages
Freeassassin Aug 24, 2023
4352305
update packages
Freeassassin Aug 24, 2023
bbdd161
update frosh controller
Freeassassin Aug 24, 2023
19dd403
update user controller
Freeassassin Aug 24, 2023
09e2f1c
update passport config
Freeassassin Aug 24, 2023
aea4b96
update payment services
Freeassassin Aug 24, 2023
db56954
Update email confirmation subscriber
Freeassassin Aug 24, 2023
7e8bc5a
Update new user subscriber
Freeassassin Aug 24, 2023
5e4db70
Update email confirmation page
Freeassassin Aug 24, 2023
5e9d2ac
update user services
Freeassassin Aug 24, 2023
30a632e
update scunt team services and tests
Freeassassin Aug 24, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 22 additions & 22 deletions .github/workflows/backend_tests.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
name: Backend Tests
on:
push:
paths:
- server/**
pull_request:
paths:
- server/**
jobs:
test_backend:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3.5.3
- name: Start Docker
run: docker-compose -f docker-compose.test.yml up --build -d
- name: Run Tests
run: cd server && yarn install && yarn test:actions
name: Backend Tests

on:
push:
paths:
- server/**
pull_request:
paths:
- server/**

jobs:
test_backend:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3.5.3

- name: Start Docker
run: docker-compose -f docker-compose.test.yml up --build -d

- name: Run Tests
run: cd server && yarn install && yarn test:actions
38 changes: 19 additions & 19 deletions .github/workflows/frontend_tests.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
name: Frontend Tests
on:
push:
paths:
- client/**
pull_request:
paths:
- client/**
jobs:
build_frontend:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3.5.3
- name: Build client
run: cd client && yarn install && yarn build
name: Frontend Tests

on:
push:
paths:
- client/**
pull_request:
paths:
- client/**

jobs:
build_frontend:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3.5.3

- name: Build client
run: cd client && yarn install && yarn build
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
![image](https://user-images.githubusercontent.com/50821962/195210327-87d8570e-d5c1-4704-be5b-eb2a609c0972.png)

# Orientation Website
# Orientation Website [![Backend Tests](https://github.com/UofT-Frosh-Orientation/orientation-website/actions/workflows/backend_tests.yml/badge.svg?event=push)](https://github.com/UofT-Frosh-Orientation/orientation-website/actions/workflows/backend_tests.yml) [![Frontend Tests](https://github.com/UofT-Frosh-Orientation/orientation-website/actions/workflows/frontend_tests.yml/badge.svg?event=push)](https://github.com/UofT-Frosh-Orientation/orientation-website/actions/workflows/frontend_tests.yml)

Welcome to the University of Toronto's Frosh engineering orientation website, used by more than 1,000 incoming students each year. This website serves as the primary platform for registering and paying for orientation events, and offers a range of features including a main schedule, announcements, a personal profile page with the ability to edit, a Scunt (scavenger hunt) game, sign-up for the Frosh retreat, QR code scanning for automated registration on event day, and more.

Expand Down
1 change: 1 addition & 0 deletions client/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ const TransitionRoutes = () => {
const loggedIn = useSelector(loggedInSelector);
const registered = useSelector(registeredSelector);
const initials = useSelector(initialsSelector);

// const scuntSettings = useSelector(scuntSettingsSelector);

return (
Expand Down
58 changes: 29 additions & 29 deletions client/src/components/MakeSchedulePDF/MakeSchedulePDF.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,33 +8,33 @@ const styles = StyleSheet.create({
backgroundColor: '#E4E4E4',
},
eventBubble: {
backgroundColor: '#58458f',
borderRadius: '10px',
padding: '10px',
margin: '10px'
backgroundColor: '#58458f',
borderRadius: '10px',
padding: '10px',
margin: '10px',
},
eventName: {
fontSize: 12,
fontSize: 12,
fontWeight: 'bold',
padding: '10px 0',
color: '#fff'
padding: '10px 0',
color: '#fff',
},
eventLoc: {
fontSize: 12,
padding: '10px 0',
color: '#fff'
fontSize: 12,
padding: '10px 0',
color: '#fff',
},
eventDate: {
fontSize: 11,
fontStyle: 'italic',
color: '#fff',
padding: '5px 0'
padding: '5px 0',
},
eventDesc: {
fontSize: 12,
fontSize: 12,
color: '#fff',
padding: '10px 0'
}
padding: '10px 0',
},
});

const MakeSchedulePDF = (froshObject) => {
Expand All @@ -53,27 +53,27 @@ const MakeSchedulePDF = (froshObject) => {
</Svg>
{Object.keys(scheduleData).map((day) => (
<div key={day}>
<Text style={{ fontSize: 14, padding: '20px 0', color: '#2c1370', fontWeight: 'bold' }}>
<Text
style={{ fontSize: 14, padding: '20px 0', color: '#2c1370', fontWeight: 'bold' }}
>
{day}
</Text>
{scheduleData[day].map((scheduleDay, index) => (
<div key={scheduleDay} style={styles.eventBubble}>
<Text style={styles.eventName}>
{scheduleDay['Event Name']}
</Text>
<Text style={styles.eventName}>{scheduleDay['Event Name']}</Text>
<Text style={styles.eventDate}>
{scheduleDay['Start Time']} - {scheduleDay['End Time']}
</Text>
{scheduleDay['Event Location'] ?
<Text style={styles.eventLoc}>
{scheduleDay['Event Location']}
</Text> : <></>
}
{scheduleDay['Event Description'] ?
<Text style={styles.eventDesc}>
{scheduleDay['Event Description']}
</Text> : <></>
}
{scheduleDay['Event Location'] ? (
<Text style={styles.eventLoc}>{scheduleDay['Event Location']}</Text>
) : (
<></>
)}
{scheduleDay['Event Description'] ? (
<Text style={styles.eventDesc}>{scheduleDay['Event Description']}</Text>
) : (
<></>
)}
</div>
))}
</div>
Expand All @@ -84,4 +84,4 @@ const MakeSchedulePDF = (froshObject) => {
);
};

export { MakeSchedulePDF };
export { MakeSchedulePDF };
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import './ProfilePageResources.scss';
import PropTypes from 'prop-types';

export const ProfilePageResources = ({ froshObject }) => {

return (
<div className="profile-page-resources profile-page-side-section">
<h2>Resources</h2>
Expand All @@ -25,24 +24,24 @@ export const ProfilePageResources = ({ froshObject }) => {
</a>
);
})}
{froshObject ? (
<>
<a key={'5Download'} className="no-link-style">
<ButtonBubble
label={'Download Information PDF'}
onClick={async () => {
const MakeReceipt = (await import('../../MakeReceipt/MakeReceipt')).MakeReceipt;
const ReactPDF = await import('@react-pdf/renderer');
const blob = await ReactPDF.pdf(MakeReceipt(froshObject)).toBlob();
const fileURL = URL.createObjectURL(blob);
const pdfWindow = window.open(fileURL, '_blank');
pdfWindow && pdfWindow.focus();
}}
isSecondary
style={{ margin: 0, marginTop: '10px' }}
/>
</a>
</>
{froshObject ? (
<>
<a key={'5Download'} className="no-link-style">
<ButtonBubble
label={'Download Information PDF'}
onClick={async () => {
const MakeReceipt = (await import('../../MakeReceipt/MakeReceipt')).MakeReceipt;
const ReactPDF = await import('@react-pdf/renderer');
const blob = await ReactPDF.pdf(MakeReceipt(froshObject)).toBlob();
const fileURL = URL.createObjectURL(blob);
const pdfWindow = window.open(fileURL, '_blank');
pdfWindow && pdfWindow.focus();
}}
isSecondary
style={{ margin: 0, marginTop: '10px' }}
/>
</a>
</>
) : (
<></>
)}
Expand Down
29 changes: 10 additions & 19 deletions client/src/pages/EmailConfirmed/EmailConfirmed.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,19 @@ import { Link, useParams } from 'react-router-dom';
import useAxios from '../../hooks/useAxios';

const PageEmailConfirmed = () => {
const { email } = useParams();
const { emailToken } = useParams();
const [validEmailToken, setvalidEmailToken] = useState(false);
const { email, emailToken } = useParams();
const [validEmailToken, setValidEmailToken] = useState(false);
const { axios } = useAxios();

function verifyEmailToken(email, emailToken) {
const { axios } = useAxios();

try {
const emailAndEmailToken = {
email: email,
emailToken: emailToken,
};
axios.post('/user/verify-user-email', emailAndEmailToken);
setvalidEmailToken(true);
} catch (err) {
setvalidEmailToken(false);
useEffect(() => {
if (emailToken && email) {
setValidEmailToken(true);
}
}
}, [emailToken, email]);

useEffect(() => {
verifyEmailToken(email, emailToken);
}, []);
if (validEmailToken) axios.post('/user/verify-user-email', { emailToken, email });
}, [validEmailToken]);

return (
<div>
Expand All @@ -43,7 +34,7 @@ const PageEmailConfirmed = () => {
) : (
<div className="email-confirmed-page">
<div className="email-confirmed-container">
<h1>Oh no! :( </h1>
<h1>{'Oh no! :( '}</h1>
<h2>An error occurred when trying to verify your email. Please try again later.</h2>
<Link to={'/login'} style={{ textDecoration: 'none' }} className={'no-link-style'}>
<Button label="Go back to login page" />
Expand Down
15 changes: 0 additions & 15 deletions deploy/go.mod

This file was deleted.

Loading