Skip to content

Commit

Permalink
Merge branch 'beta' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
gaurikam2003 committed Jun 16, 2024
2 parents f1baa80 + e11f1b7 commit a967146
Show file tree
Hide file tree
Showing 12 changed files with 201 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/beta_deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ jobs:
run: docker push registry.digitalocean.com/uoft-orientation/orientation-client:beta

# - name: Run garbage collector
# run: doctl registry garbage-collection start --include-untagged-manifests --force uoft-orientation
# run: doctl registry garbage-collection start --include-untagged-manifests --force uoft-orientation

deploy_beta:
runs-on: ubuntu-20.04
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ Pages are stored in `./client/src/util/pages.jsx`. To add a page, add it to the
The Snackbar provider is wrapped at the root of the app. Therefore it can be accessed by the child components. You can use setSnackbar to show a snackbar message.

An example usage:
```js
```jsx
// Import useContext from React
import React, { useState, useEffect, useContext } from 'react';
// Import the context
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,6 @@ export const ProfilePageQRScanner = ({ scopes }) => {
);
})}

{/* Scanner specific */}

{scannerInfo()}
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion client/src/pages/Initial/AsmitaLanding/AsmitaLanding.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
overflow-y: hidden;
overflow-x: hidden;

background-image: url('images\AsmitaLandingBackDrop.png');
background-image: url('../AsmitaLanding/images/AsmitaLandingBackDrop.png');
background-size: cover;
background-repeat: no-repeat;
background-position: center center;
Expand Down
1 change: 1 addition & 0 deletions client/src/pages/Profile/PageProfileLeader.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ const PageProfileLeader = () => {
<ProfilePageSchedule />
</div>
<div style={{ display: 'flex', flexDirection: 'column' }}>
{/* <ProfilePageQRCode /> */}
{qrCodeLeader === true ? (
<ProfilePageQRScanner scopes={user?.authScopes?.approved} />
) : null}
Expand Down
184 changes: 184 additions & 0 deletions server/routes.http
Original file line number Diff line number Diff line change
@@ -0,0 +1,184 @@
POST {{$dotenv API_BASE_URL}}/user/signup
Content-Type: application/json

{ "email": "test@test{{$randomInt 1000 9999}}.com", "password":"Password!2", "firstName":"FirstName", "lastName":"LastName" }

###

post {{$dotenv API_BASE_URL}}/user/login
Content-Type: application/json
// 9050, 6397, 9070, 8383, 5246

{
"email": "[email protected]",
"password": "Password!2"
}

###

post {{$dotenv API_BASE_URL}}/user/verify-user-email
Content-Type: application/json

{
"email":"[email protected]",
"emailToken":""
}

###

post {{$dotenv API_BASE_URL}}/user/logout


###

get {{$dotenv API_BASE_URL}}/user/info

###

post {{$dotenv API_BASE_URL}}/user/request-password-reset

###

post {{$dotenv API_BASE_URL}}/user/reset-password



###

post {{$dotenv API_BASE_URL}}/user/request-auth-scopes

###

get {{$dotenv API_BASE_URL}}/user/unapproved-users

###

get {{$dotenv API_BASE_URL}}/user/all-auth-scopes

###

put {{$dotenv API_BASE_URL}}/user/update-info

###

put {{$dotenv API_BASE_URL}}/user/unsubscribe

###

put {{$dotenv API_BASE_URL}}/user/resubscribe

###

put {{$dotenv API_BASE_URL}}/user/account-statuses

###

put {{$dotenv API_BASE_URL}}/user/auth-scopes

###

get {{$dotenv API_BASE_URL}}/user/scunt-judge-users

###

delete {{$dotenv API_BASE_URL}}/user/:id

###

put {{$dotenv API_BASE_URL}}/user/user-exist

###

post {{$dotenv API_BASE_URL}}/frosh/register

###

put {{$dotenv API_BASE_URL}}/frosh/info

###

get {{$dotenv API_BASE_URL}}/frosh/filtered-data

###

post {{$dotenv API_BASE_URL}}/frosh/search

###

post {{$dotenv API_BASE_URL}}/frosh/redistribute

###

get {{$dotenv API_BASE_URL}}/scunt-game-controls/

###

post {{$dotenv API_BASE_URL}}/scunt-game-controls/

###

get {{$dotenv API_BASE_URL}}/scunt-missions/

###

post {{$dotenv API_BASE_URL}}/scunt-missions/

###

delete {{$dotenv API_BASE_URL}}/scunt-missions/:id

###

put {{$dotenv API_BASE_URL}}/scunt-missions/set-visibility

###

post {{$dotenv API_BASE_URL}}/scunt-missions/bulk

###

get {{$dotenv API_BASE_URL}}/scunt-teams/

###

post {{$dotenv API_BASE_URL}}/scunt-teams/update-team

###

post {{$dotenv API_BASE_URL}}/scunt-teams/transaction/bribe

###

get {{$dotenv API_BASE_URL}}/scunt-teams/judges

###

post {{$dotenv API_BASE_URL}}/scunt-teams/transaction/refill-bribe

###

post {{$dotenv API_BASE_URL}}/scunt-teams/transaction/add

###

post {{$dotenv API_BASE_URL}}/scunt-teams/transactions

###

post {{$dotenv API_BASE_URL}}/scunt-teams/transaction/subtract

###

post {{$dotenv API_BASE_URL}}/scunt-teams/transaction/check

###

post {{$dotenv API_BASE_URL}}/scunt-teams/transaction/delete

###

post {{$dotenv API_BASE_URL}}/scunt-teams/shuffle

###

put {{$dotenv API_BASE_URL}}/scunt-teams/rename-teams
8 changes: 4 additions & 4 deletions server/src/controllers/ScuntController.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const ScuntController = {
try {
const { missionNumber, teamNumber } = req.query;
const gameSettings = await ScuntGameSettingsServices.getGameSettings();
if (!gameSettings[0].revealMissions) {
if (!gameSettings.revealMissions) {
return next(new Error('MISSIONS_NOT_REVEALED'));
}
const mission = await ScuntMissionServices.getMission(missionNumber);
Expand Down Expand Up @@ -88,9 +88,9 @@ const ScuntController = {
const teams = await ScuntTeamServices.getTeamPoints();
const teamScores = await teams.sort((a, b) => b.number - a.number).map((t) => t.points);
res.status(200).send({ teamScores });
} catch (e) {
req.log.fatal({ msg: 'Unable to retrieve scunt leaderboard', e });
next(e);
} catch (error) {
req.log.fatal({ msg: 'Unable to retrieve scunt leaderboard', e: error });
next(error);
}
},
};
Expand Down
1 change: 1 addition & 0 deletions server/src/controllers/ScuntGameSettingsController.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const ScuntGameSettingsController = {
async getGameSettings(req, res, next) {
try {
const gameSettings = await ScuntGameSettingsServices.getGameSettings();
console.log(gameSettings);
return res.status(200).send({
message: 'Found game settings',
settings: gameSettings,
Expand Down
5 changes: 4 additions & 1 deletion server/src/services/FroshServices.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,10 @@ const FroshServices = {
*/
async getFilteredUserInfo(query, projection) {
return UserModel.find(query, { ...projection, isRegistered: 1 }, { strictQuery: false }).then(
(user) => user,
(user) => {
if (!user.length) throw new Error('USERS_NOT_FOUND');
return user;
},
(error) => {
throw new Error('UNABLE_TO_GET_USER', { cause: error });
},
Expand Down
2 changes: 1 addition & 1 deletion server/src/services/ScuntGameSettingsServices.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const ScuntGameSettingsServices = {
* @returns {Settings}
*/
async getGameSettings() {
return ScuntGameSettingModel.findOne().then(
return ScuntGameSettingModel.findOne({}).then(
(settings) => settings,
(error) => {
throw new Error('UNABLE_TO_GET_SCUNT_SETTINGS', { cause: error });
Expand Down
2 changes: 0 additions & 2 deletions server/src/services/ScuntTeamServices.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ const ScuntTeamServices = {
* @returns {ScuntTeam[]}
*/
async getTeamPoints() {
//Get amount of teams (Scunt Game Settings) and points for each team
//Add up and calculate all tranactions for each team
return ScuntTeamModel.find({}, { name: 1, number: 1, points: 1 }).then(
(teams) => {
if (!teams.length) throw new Error('TEAMS_NOT_FOUND');
Expand Down
6 changes: 3 additions & 3 deletions server/src/websockets/ScuntLeaderboardSocketManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ class ScuntLeaderboardSocketManager {
console.log(this.settings);
return done();
}
} catch (e) {
console.log(e);
done();
} catch (error) {
console.log(error);
done(error);
}
});
}
Expand Down

0 comments on commit a967146

Please sign in to comment.