Skip to content
This repository has been archived by the owner on Aug 26, 2022. It is now read-only.

sorted eligible profiles for review based on number of current reviews #565

Open
wants to merge 156 commits into
base: staging
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
156 commits
Select commit Hold shift + click to select a range
3502334
[WIP] migrating rest api to vercel serverless functions
Aug 18, 2020
219bc32
temp
Aug 20, 2020
1f7c3da
Merge branch 'develop' into serverless-ambitions
Sep 1, 2020
6285ce1
migrated admin and contribution to typescript vercel serverless
Sep 2, 2020
5e33b95
local testing
Sep 9, 2020
12fcd1d
Testing CircleCI Slack notifications... this is definitely a bad idea
Sep 9, 2020
a0384e7
bump .circleci/config.yml
Sep 9, 2020
94ada7c
send on circleci message on fail_only
Sep 9, 2020
fc639f9
send on circleci message on fail_only
Sep 9, 2020
ea25a98
test circleci more
Sep 9, 2020
148fc11
test circleci more
Sep 9, 2020
9ee550c
custom build name?
Sep 9, 2020
7c9c2cd
OMG just bad indentation :(
Sep 9, 2020
2fa49ba
added success and failure messages
Sep 9, 2020
4ef8afc
added success and failure messages
Sep 9, 2020
e358d43
Merge branch 'staging' of https://github.com/HackSC/odyssey into staging
Sep 9, 2020
492a81e
Serverless ambitions (#355)
refcell Sep 17, 2020
0dc7a3b
update
Sep 17, 2020
77dc3bb
deepscan?
Sep 17, 2020
138ee75
Merge branch 'develop' into staging
refcell Sep 18, 2020
f4ced10
test push to main
refcell Sep 18, 2020
9d3cb51
test push to staging
refcell Sep 18, 2020
8d0fad0
Merge branch 'main' into staging
refcell Sep 18, 2020
4f4a7fd
Update banner to use current year (#374)
jasonsilberman Sep 18, 2020
50eb64d
dynamically render date (#377)
refcell Sep 18, 2020
396dedd
Allow team owners to kick other members (#375)
refcell Sep 18, 2020
f984256
fix footer HackSC copyright (#372)
refcell Sep 18, 2020
7411d44
fix missing application page (#362)
refcell Sep 18, 2020
206781b
update hacksc header logo (#380)
refcell Sep 21, 2020
7234611
Andreas/cluster schools (#381)
refcell Sep 22, 2020
183a63f
Andreas/admin dashboard fix (#382)
refcell Sep 22, 2020
a274c11
query mail signups (#390)
refcell Oct 8, 2020
b386510
Merge branch 'main' of https://github.com/HackSC/odyssey into main
refcell Oct 8, 2020
102f440
codecov (#397)
refcell Oct 11, 2020
822371e
Add code of conduct 1 (#393)
refcell Oct 11, 2020
ea98dd4
lighthouse metrics (#403)
refcell Oct 15, 2020
d8d5080
Schedule Manager (#408)
chloetanlimco Nov 5, 2020
50876f4
Back to Admin Dashboard Button (#411)
chloetanlimco Nov 6, 2020
1d70c0f
Mini Fix: Schedule Manager Frontend (#410)
chloetanlimco Nov 6, 2020
a223bc9
Ct admin (#412)
refcell Nov 6, 2020
f45d3bf
add prettier (#395)
refcell Nov 6, 2020
0a98a8a
Add license 1 (#394)
refcell Nov 6, 2020
6ee2737
Andreas/lighthouse metrics (#405)
refcell Nov 7, 2020
5a8107a
Merge branch 'main' into staging
refcell Nov 7, 2020
464e2d5
hotfix (#413)
refcell Nov 8, 2020
ac6e8e0
hotfix for git merge conflict
Nov 8, 2020
fd7d340
Staging hotfix duplicate lib definition (#414)
refcell Nov 8, 2020
9ff7d30
refactored admin components (#415)
refcell Nov 8, 2020
c7ad41b
Andreas/api directory (#399)
refcell Nov 8, 2020
eb0a83a
Andreas/minor updates (#416)
refcell Nov 8, 2020
d7aca00
Andreas/fix mobile logo (#417)
refcell Nov 9, 2020
fffb978
Add CRUD functions to task manager (#419)
rolandtshen Nov 9, 2020
7715452
Andreas/fix mobile logo (#418)
refcell Nov 9, 2020
3f56b7a
betteruptime heartbeat (#420)
refcell Nov 10, 2020
8c73022
Andreas/betteruptime heartbeat (#421)
refcell Nov 10, 2020
ce258a7
Andreas/betteruptime heartbeat (#422)
refcell Nov 10, 2020
fa42c98
updated dates (#423)
refcell Nov 11, 2020
9667d8f
Merge branch 'main' into staging
refcell Nov 11, 2020
f213168
styles (#425)
refcell Nov 11, 2020
47e7644
fix app due date (#427)
refcell Nov 13, 2020
ef1eac0
badges and code coverage (#428)
refcell Nov 14, 2020
c1c3831
U json (#429)
refcell Nov 14, 2020
84afacf
gitbook initialization (#430)
refcell Nov 14, 2020
a07f49f
app review and sanity check (#431)
refcell Nov 15, 2020
d74137a
App review (#432)
refcell Nov 15, 2020
4821b32
App review (#433)
refcell Nov 15, 2020
24b65da
more cypress tests and confetti fixes (#434)
refcell Nov 26, 2020
843fabc
Bug fixes, refactoring, and application updates for 2021
Nov 29, 2020
ae376b3
Merge branch 'main' of https://github.com/HackSC/odyssey into main
refcell Nov 30, 2020
344bfc3
fix cypress tests
refcell Nov 30, 2020
767ba80
Editing Admin NavBar (#438)
chloetanlimco Dec 2, 2020
f19e34e
Merge branch 'main' into staging
refcell Dec 2, 2020
a6b32ec
Andreas/cypress fixes and admin enchancements (#441)
refcell Dec 2, 2020
cf70bce
Andreas/cypress fixes and admin enchancements (#442)
refcell Dec 2, 2020
b66254e
Andreas/cypress fixes and admin enchancements (#443)
refcell Dec 2, 2020
f9f6b5e
Fix footer responsive styling (#439)
rolandtshen Dec 3, 2020
8d238cb
Slack bot announcements on app submit (#444)
Dec 3, 2020
30339b7
Andreas/cypress fixes and admin enchancements (#447)
refcell Dec 3, 2020
7291cc5
Merge branch 'main' into staging
refcell Dec 3, 2020
6f20f7f
Slack announce improvements (#449)
Dec 3, 2020
5df75e9
slackbot cron job (#453)
refcell Dec 3, 2020
64edb9c
bad metabase link (#451)
refcell Dec 3, 2020
fb84c5c
Merge branch 'main' into staging
refcell Dec 3, 2020
1d1123c
Update nextjs, fix application steps disable bug, misc fixes (#452)
Dec 3, 2020
26b5f35
Merge branch 'main' into staging
refcell Dec 3, 2020
4a98cd6
fix metabase statistics embed (#456)
Dec 3, 2020
6bfc648
Merge branch 'main' into staging
refcell Dec 3, 2020
00eddd6
switch slackbot to staging (#459)
refcell Dec 3, 2020
32902ca
Andreas/cron job fixes (#460)
refcell Dec 3, 2020
1be309c
Gender -> Pronouns (#462)
chloetanlimco Dec 4, 2020
aef99b5
Merge branch 'main' into staging
refcell Dec 4, 2020
ed2e17d
Slack message fix (#464)
refcell Dec 4, 2020
5c1c383
fix date parsing (#465)
refcell Dec 4, 2020
af1ca6a
styling :) :sparkles: (#461)
refcell Dec 4, 2020
6228aa4
fix pronoun input (#466)
refcell Dec 4, 2020
8b80d56
Andreas/dynamic helpful links (#469)
refcell Dec 5, 2020
55eb8b4
Andreas/dynamic helpful links (#470)
refcell Dec 6, 2020
6e4fa72
Setup kodiak to automerge PRs (#471)
Dec 6, 2020
5a34187
Andreas/manage roles (#472)
refcell Dec 6, 2020
156449b
app review leaderboard (#473)
refcell Dec 7, 2020
97ef798
Andreas/app review (#474)
refcell Dec 7, 2020
95bc78d
add reject and waitlist functionality (#475)
refcell Dec 7, 2020
ce1ff84
Fix app review (#477)
refcell Dec 8, 2020
634756b
mobile optimizations (#478)
refcell Dec 8, 2020
c25bde5
Andreas/increase styling (#480)
refcell Dec 8, 2020
5b0e5d2
fix scanner (#481)
refcell Dec 9, 2020
d4c971d
Bump ini from 1.3.5 to 1.3.8 (#483)
dependabot[bot] Dec 12, 2020
964c281
fix styling and remove more console.logs (#486)
refcell Dec 12, 2020
b6c415a
Merge branch 'main' into staging
refcell Dec 12, 2020
ba8d5d4
update app due date in Status (#490)
Dec 15, 2020
9a2e282
Fix Container style width from 5a34187
Dec 15, 2020
2ed32ba
Merge branch 'main' into staging
Dec 15, 2020
3ad1000
Andreas/export resumes (#488)
refcell Dec 17, 2020
942485e
Merge branch 'main' into staging
refcell Dec 17, 2020
51e9675
Add View Application button to app steps (#495)
Dec 17, 2020
cb91b2b
Add basic modal component and allow viewing hackers full profile in M…
Dec 17, 2020
cfe996f
date fix in result (#499)
elissaperdue Dec 20, 2020
d6fe695
better buttons with merge fix (#503)
elissaperdue Dec 20, 2020
14c0e82
Bump node-notifier from 8.0.0 to 8.0.1 (#505)
dependabot[bot] Dec 22, 2020
8b0986a
Improve admin visibility message to not include null firstName/lastNa…
Dec 24, 2020
8b34c58
Team/Teammate Matching (#484)
chloetanlimco Dec 25, 2020
6585f64
Merge branch 'main' into staging
refcell Dec 25, 2020
c3f70a3
Automate ending application submissions 3 days after apps close with …
Dec 25, 2020
cbf240b
Elissa/resume pd fdisplay (#511)
refcell Dec 25, 2020
be7fff5
remove needs bus and fix app leaderboard styling
refcell Dec 26, 2020
7b8c591
fix app review numbers (#513)
refcell Dec 26, 2020
531795e
Andreas/teammatching enhancements (#514)
refcell Dec 26, 2020
f652857
Andreas/container exploration - added a simple dockerfile (#515)
refcell Dec 26, 2020
9af3dde
Staging build fix (#516)
refcell Dec 26, 2020
505fd42
New judging manager, added superadmin + judge roles (#492)
rolandtshen Dec 28, 2020
902f5e0
built out judge manager (#519)
refcell Dec 28, 2020
baf9755
Merge branch 'main' into staging
refcell Dec 28, 2020
3c74dfb
remove superadmin tests - unnecessary right now (#520)
refcell Dec 28, 2020
e9307be
format columns on app review page (#522)
elissaperdue Dec 30, 2020
79420ba
@ flag for directories (#521)
refcell Dec 30, 2020
7df8b3d
Andreas/hackathon constants manager (#525)
refcell Dec 30, 2020
c3ffd12
Merge branch 'main' into staging
refcell Dec 30, 2020
daf519e
styling changes (#526)
refcell Dec 30, 2020
e962296
add superadmin and judge to role manager options (#528)
refcell Dec 30, 2020
cdc407c
Andreas/admin stats fixed (#530)
refcell Dec 31, 2020
1a7af7a
Merge branch 'main' into staging
refcell Dec 31, 2020
911fa36
Andreas/app review refinments (#534)
refcell Dec 31, 2020
a146d65
Andreas/dev touch ups (#538)
refcell Jan 1, 2021
3215c26
Merge branch 'main' into staging
refcell Jan 1, 2021
9df3a5d
api route /eligibleReviews only returned if hacker hadnt been review…
refcell Jan 2, 2021
275b5c5
Merge branch 'main' into staging
refcell Jan 2, 2021
4375970
Hacker CheckIn (#545)
chloetanlimco Jan 7, 2021
d5a8fa7
Merge branch 'main' into staging
refcell Jan 7, 2021
4bf2829
Remove unused dependencies (#523)
Jan 8, 2021
18974fa
Hacker Constants (#550)
chloetanlimco Jan 10, 2021
b0e5947
Merge branch 'main' into staging
refcell Jan 10, 2021
3ea6376
Add auth to slack routes (#542)
rolandtshen Jan 10, 2021
bf5aa58
CheckIn CSS Bugfix (#553)
chloetanlimco Jan 12, 2021
135c6fe
Andreas/remove lockfile (#554)
refcell Jan 12, 2021
347d40f
fix admin stats and counts (#555)
refcell Jan 13, 2021
bf0c458
sorted eligible profiles for review based on number of current reviews
refcell Jan 20, 2021
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
28 changes: 0 additions & 28 deletions .env.example

This file was deleted.

6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ typings/
# dotenv environment variables file
.env
.env.prod
prod.env
aws.env
aws_secrets.env

# * Ignore package lock in favor of yarn lock
package-lock.json

# next.js build output
.next
Expand Down
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,16 @@ Implemented E2E tests:
- Tests to visit each admin page on the /admin dashboard for an admin profile
- `hacker_sanity.spec.js`
- Tests to visit each pach in the navbar for a hacker profile

Need to implement:

- `volunteer_sanity.spec.js`
- Tests to visit each volunteer page on the /volunteer dashboard for an volunteer profile
- `sponsor_sanity.spec.js`
- Tests to visit each sponsor page on the /sponsor dashboard for an sponsor profile
- `judge_sanity.spec.js`
- Tests to visit each judge page on the /judge dashboard for an judge profile

Need to implement:

- `superadmin_sanity.spec.js`

## How To: Create Unit Tests with Jest

Expand Down
13 changes: 6 additions & 7 deletions SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,23 @@
- [Some other child page](docs/docs-2.md)
- [Team](docs/README.md)
- [Some child page](docs/page2-1.md)
- [Some other child page](docs/page2-2.md)

## Frontend

- [Specifications](another-page.md)
- [Frontend](docs/frontend/README.md)

## API/Backend
## Backend

- [Specifications](another-page.md)
- [API/Backend](docs/backend/Backend/README.md)

## Testing

- [Specifications](another-page.md)
- [Testing](docs/testing/README.md)

## Infrastructure

- [Specifications](another-page.md)
- [Infrastructure](docs/infrastructure/README.md)

## Future Directions

- [Specifications](another-page.md)
- [Future Directions](docs/future/README.md)
128 changes: 90 additions & 38 deletions api/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,13 @@ router.get("/eligibleProfiles", async (req, res) => {
});
return reviewsByCurrUser.length === 0;
});

filteredProfiles.sort((profile_a, profile_b) => {
return profile_a.HackerReviews.length > profile_b.HackerReviews.length
? -1
: 1;
});

return res.json({
eligibleReviews: filteredProfiles,
});
Expand All @@ -313,14 +320,54 @@ router.get("/reviewedProfiles", async (req, res) => {
],
});

const anyProfile = await models.HackerProfile.findAll({
include: [
{
model: models.HackerReview,
},
],
});

let numHackerReviews = anyProfile.reduce(
(acc, curr) => curr.HackerReviews.length + acc,
0
);
let numHackers = allProfiles.filter(
(temp_hacker) => temp_hacker.role === "hacker"
).length;
let numAcceptedHackers = allProfiles.filter(
(temp_hacker) =>
(temp_hacker.status === "accepted" ||
temp_hacker.status === "checkedIn") &&
temp_hacker.role === "hacker"
).length;
let numRejectedHackers = allProfiles.filter(
(temp_hacker) =>
temp_hacker.status === "rejected" && temp_hacker.role === "hacker"
).length;
let numWaitlistedHackers = allProfiles.filter(
(temp_hacker) =>
temp_hacker.status === "waitlisted" && temp_hacker.role === "hacker"
).length;

let filteredProfiles = allProfiles
.filter((profile) => {
return profile.HackerReviews.length > 0;
return profile.HackerReviews.length > 0 && profile.role === "hacker";
})
.slice(0, count);

let numReviewedProfiles = allProfiles.filter(
(profile) => profile.HackerReviews.length > 0 && profile.role === "hacker"
).length;

return res.json({
reviewedProfiles: filteredProfiles,
numReviewedProfiles: numReviewedProfiles,
numAcceptedHackers: numAcceptedHackers,
numRejectedHackers: numRejectedHackers,
numWaitlistedHackers: numWaitlistedHackers,
numHackerReviews: numHackerReviews,
numHackers: numHackers,
});
} catch (e) {
return res.status(500).json({ error: e.message });
Expand Down Expand Up @@ -391,8 +438,8 @@ router.get("/hackerStatusStats", async (req, res) => {
const checkedIn = await models.HackerProfile.findAll({
where: {
status: "checkedIn",
}
})
},
});
const accepted = await models.HackerProfile.findAll({
where: {
status: "accepted",
Expand All @@ -401,18 +448,20 @@ router.get("/hackerStatusStats", async (req, res) => {
const waitlisted = await models.HackerProfile.findAll({
where: {
status: "waitlisted",
}
},
});
const rejected = await models.HackerProfile.findAll({
where: {
status: "rejected",
}
},
});

return res.json({ checkedIn: checkedIn.length,
accepted: accepted.length,
waitlisted: waitlisted.length,
rejected: rejected.length });
return res.json({
checkedIn: checkedIn.length,
accepted: accepted.length,
waitlisted: waitlisted.length,
rejected: rejected.length,
});
} catch (e) {
return res.status(500).json({ err: e });
}
Expand All @@ -421,62 +470,65 @@ router.get("/hackerStatusStats", async (req, res) => {
router.post("/batchCheckIn", async (req, res) => {
const input = req.body.qrCodes;
if (input.length % 2 === 1) {
return res.status(500).json({ error: ["invalid input: len(QR_Codes) !== len(hacker_emails)"], success: [] });
return res.status(500).json({
error: ["invalid input: len(QR_Codes) !== len(hacker_emails)"],
success: [],
});
}
let errorMsg = [];
let successMsg = [];
let updatedRequestBody = "";
for (let i = 0; i < input.length; i+=2) {
for (let i = 0; i < input.length; i += 2) {
if (input[i].length != 4) {
errorMsg.push(input[i] + " is an invalid QR Code");
updatedRequestBody += input[i] + " " + input[i+1] + "\n";
}
else {
updatedRequestBody += input[i] + " " + input[i + 1] + "\n";
} else {
const body = {
qrCodeId: input[i].toUpperCase(),
status: "checkedIn",
};
const hackerProfiles = await models.HackerProfile.findAll({
where: {
email: input[i+1],
}
email: input[i + 1],
},
});
const withQRCode = await models.HackerProfile.findAll({
where: {
qrCodeId: input[i].toUpperCase(),
}
},
});
if (withQRCode.length > 0) {
errorMsg.push(input[i] + " must be unique to the hacker");
updatedRequestBody += input[i] + " " + input[i+1] + "\n";
}
else if (hackerProfiles.length == 0) {
errorMsg.push(input[i+1] + " does not belong to a hacker");
updatedRequestBody += input[i] + " " + input[i+1] + "\n";
}
else if (hackerProfiles.length > 1) {
errorMsg.push(input[i+1] + " belongs to multiple hackers. Please use the Check In tool to select the correct hacker");
updatedRequestBody += input[i] + " " + input[i+1] + "\n";
}
else {
updatedRequestBody += input[i] + " " + input[i + 1] + "\n";
} else if (hackerProfiles.length == 0) {
errorMsg.push(input[i + 1] + " does not belong to a hacker");
updatedRequestBody += input[i] + " " + input[i + 1] + "\n";
} else if (hackerProfiles.length > 1) {
errorMsg.push(
input[i + 1] +
" belongs to multiple hackers. Please use the Check In tool to select the correct hacker"
);
updatedRequestBody += input[i] + " " + input[i + 1] + "\n";
} else {
try {
await models.HackerProfile.update(body, {
where: {
email: input[i+1],
}
email: input[i + 1],
},
});
successMsg.push(input[i+1] + " successfully checked in");
}
catch (e) {
errorMsg.push("Error checking in " + input[i+1]);
updatedRequestBody += input[i] + " " + input[i+1] + "\n";
successMsg.push(input[i + 1] + " successfully checked in");
} catch (e) {
errorMsg.push("Error checking in " + input[i + 1]);
updatedRequestBody += input[i] + " " + input[i + 1] + "\n";
}

}
}
}
return res.json({error: errorMsg, success: successMsg, updatedRequestBody: updatedRequestBody });
return res.json({
error: errorMsg,
success: successMsg,
updatedRequestBody: updatedRequestBody,
});
});


module.exports = router;
10 changes: 5 additions & 5 deletions api/database/migrations/20201216025425-teams-add-matching.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
'use strict';
"use strict";

module.exports = {
up: (queryInterface, Sequelize) => {
return Promise.all([
queryInterface.addColumn("Teams", "lookingForTeammates", {
type: Sequelize.BOOLEAN,
defaultValue: false
defaultValue: false,
}),
queryInterface.addColumn("Teams", "description", {
type: Sequelize.TEXT,
defaultValue: false
})
defaultValue: false,
}),
]);
},

Expand All @@ -19,5 +19,5 @@ module.exports = {
queryInterface.removeColumn("Teams", "lookingForTeammates"),
queryInterface.removeColumn("Teams", "description"),
]);
}
},
};
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
'use strict';
"use strict";

module.exports = {
up: (queryInterface, Sequelize) => {
Expand All @@ -8,8 +8,8 @@ module.exports = {
defaultValue: false,
}),
queryInterface.addColumn("HackerProfiles", "portfolioUrl", {
type: Sequelize.STRING
})
type: Sequelize.STRING,
}),
]);
},

Expand All @@ -18,5 +18,5 @@ module.exports = {
queryInterface.removeColumn("HackerProfiles", "lookingForTeam"),
queryInterface.removeColumn("HackerProfiles", "portfolioUrl"),
]);
}
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
'use strict';

module.exports = {
up: (queryInterface, Sequelize) => {
return queryInterface.addColumn("HackathonConstants", "type", {
type: Sequelize.ENUM,
values: ["date", "boolean", "string"],
},
{
charset: "utf8mb4",
collate: "utf8mb4_bin", // * New Databases: utf8mb4_0900_ai_ci
});
},

down: (queryInterface, Sequelize) => {
return queryInterface.removeColumn("HackathonConstants", "type");
}
};
2 changes: 2 additions & 0 deletions api/hackathonConstants.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ router.post("/update", utils.requireAdmin, async (req, res) => {
name: req.body.name,
boolean: req.body.boolean,
date: req.body.date,
type: req.body.type,
},
{
where: {
Expand All @@ -41,6 +42,7 @@ router.post("/new", utils.requireAdmin, async (req, res) => {
name: req.body.name,
boolean: req.body.boolean,
date: req.body.date,
type: req.body.type,
});

return res.json({ result });
Expand Down
9 changes: 9 additions & 0 deletions api/models/hackathonConstants.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,15 @@ module.exports = (sequelize, DataTypes) => {
allowNull: false,
type: DataTypes.DATE,
},
type: {
allowNull: true,
type: DataTypes.ENUM,
values: [
"date",
"boolean",
"string",
],
},
},
{
timestamps: false,
Expand Down
Loading