Skip to content
This repository was archived by the owner on Aug 26, 2022. It is now read-only.
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
103 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
372e4bc
migrated serverless functions into pages/api/ so routes should be goo…
Sep 9, 2020
ae78601
:sparkles: ready to merge into staging for testing
Sep 17, 2020
492a81e
Serverless ambitions (#355)
refcell Sep 17, 2020
19f6f2d
update yarn lock
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
c6bd8d5
fix conflicts
refcell Oct 9, 2020
875865a
started refactor into serverless functions but running into issue of …
refcell Oct 9, 2020
d106129
fully refactored admin api routes to serverless
refcell Oct 9, 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)
Nov 5, 2020
50876f4
Back to Admin Dashboard Button (#411)
Nov 6, 2020
1d70c0f
Mini Fix: Schedule Manager Frontend (#410)
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)
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)
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)
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
0181905
staging merge
refcell Dec 5, 2020
f111695
fix lib import
refcell Dec 5, 2020
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
26 changes: 13 additions & 13 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,22 @@ appearance, race, religion, or sexual identity and orientation.
Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
- The use of sexualized language or imagery and unwelcome sexual attention or
advances
- Trolling, insulting/derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or electronic
address, without explicit permission
- Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities

Expand Down
80 changes: 40 additions & 40 deletions api/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ router.use(utils.requireAdmin);
router.put("/:email", async (req, res) => {
const updatedhackerProfile = await models.HackerProfile.update(req.body, {
where: {
email: req.params.email
}
email: req.params.email,
},
});
return res.json({ hackerProfile: newHackerProfile });
});
Expand All @@ -33,25 +33,25 @@ router.get("/profiles", async (req, res) => {
[Op.or]: [
{
email: {
[Op.like]: flexQuery
}
[Op.like]: flexQuery,
},
},
{
firstName: {
[Op.like]: flexQuery
}
[Op.like]: flexQuery,
},
},
{
lastName: {
[Op.like]: flexQuery
}
}
]
[Op.like]: flexQuery,
},
},
],
},
limit: 50
limit: 50,
});
return res.json({
profiles
profiles,
});
} catch (e) {
return res.status(500).json({ error: e.message });
Expand All @@ -63,12 +63,12 @@ router.post("/updateRole", async (req, res) => {
const { email, role } = req.body;
const result = await models.HackerProfile.update(
{
role: role
role: role,
},
{
where: {
email: email
}
email: email,
},
}
);

Expand All @@ -91,8 +91,8 @@ router.get("/reviewHistory", async (req, res) => {
try {
const reviews = await models.HackerReview.findAll({
where: {
createdBy: req.user.id
}
createdBy: req.user.id,
},
});
return res.json({ reviews: reviews });
} catch (e) {
Expand All @@ -106,29 +106,29 @@ router.put("/review/:id", async (req, res) => {
"scoreOne",
"scoreTwo",
"scoreThree",
"comments"
"comments",
]);
const formInput = req.body;

for (let key of Object.keys(formInput)) {
if (!allowedFields.has(key)) {
return res.status(400).json({
error: `${key} is not a supported field`
error: `${key} is not a supported field`,
});
}
}

try {
const result = await models.HackerReview.update(req.body, {
where: {
id: requestId
}
id: requestId,
},
});

return res.json({ update: result });
} catch (e) {
return res.status(500).json({
error: e
error: e,
});
}
});
Expand All @@ -138,23 +138,23 @@ router.get("/eligibleProfiles", async (req, res) => {
const allProfiles = await models.HackerProfile.findAll({
where: {
submittedAt: {
[sequelize.Op.not]: null
}
[sequelize.Op.not]: null,
},
},
include: [
{
model: models.HackerReview
}
]
model: models.HackerReview,
},
],
});
filteredProfiles = allProfiles.filter(profile => {
const reviewsByCurrUser = profile.HackerReviews.filter(review => {
filteredProfiles = allProfiles.filter((profile) => {
const reviewsByCurrUser = profile.HackerReviews.filter((review) => {
return review.dataValues.createdBy === req.user.id;
});
return reviewsByCurrUser.length === 0 && profile.HackerReviews.length < 1;
});
return res.json({
eligibleReviews: filteredProfiles
eligibleReviews: filteredProfiles,
});
} catch (e) {
return res.status(500).json({ error: e.message });
Expand All @@ -170,7 +170,7 @@ router.post("/review", async (req, res) => {
scoreOne: formBody.scoreOne,
scoreTwo: formBody.scoreTwo,
scoreThree: formBody.scoreThree,
comments: formBody.comments
comments: formBody.comments,
});

return res.json({ newReview: newReview });
Expand All @@ -186,31 +186,31 @@ router.get("/review", async (req, res) => {
include: [
[
sequelize.fn("COUNT", sequelize.col("HackerReviews.id")),
"reviewCount"
]
]
"reviewCount",
],
],
},
include: [
{
model: models.HackerReview,
attributes: []
}
attributes: [],
},
],
group: ["HackerProfile.userId"]
group: ["HackerProfile.userId"],
});

const acceptableProfile = profilesWCount.find(profile => {
const acceptableProfile = profilesWCount.find((profile) => {
return profile.dataValues.reviewCount < 1;
});
if (acceptableProfile) {
const newReview = await models.HackerReview.create({
hackerId: acceptableProfile.dataValues.userId,
createdBy: req.user.id
createdBy: req.user.id,
});

return res.json({
review: newReview,
profile: acceptableProfile
profile: acceptableProfile,
});
} else {
return res.json({ review: null, profile: null }); // Returns empty when there are no more profiles
Expand Down
14 changes: 7 additions & 7 deletions api/apis.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ router.get("/", async (req, res) => {
include: [
{
model: models.ApiLinks,
as: "links"
}
]
as: "links",
},
],
});

return res.json({ success: apis });
Expand All @@ -22,14 +22,14 @@ router.get("/event", async (req, res) => {
let id = parseInt(Object.keys(req.query)[0].split(",")[1]);
const apis = await models.Apis.findAll({
where: {
major_event: id
major_event: id,
},
include: [
{
model: models.ApiLinks,
as: "links"
}
]
as: "links",
},
],
});

return res.json({ success: apis });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ module.exports = {
return queryInterface.changeColumn("HackerProfiles", "role", {
type: Sequelize.ENUM,
values: ["hacker", "admin", "sponsor", "volunteer"],
defaultValue: "hacker"
defaultValue: "hacker",
});
},

down: (queryInterface, Sequelize) => {
return queryInterface.changeColumn("HackerProfiles", "role", {
type: Sequelize.ENUM,
values: ["hacker", "admin", "sponsor", "superadmin"],
defaultValue: "hacker"
defaultValue: "hacker",
});
}
},
};
12 changes: 6 additions & 6 deletions api/database/migrations/20201012041027-api-directory.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,23 @@ module.exports = {
type: Sequelize.INTEGER,
autoIncrement: true,
primaryKey: true,
allowNull: false
allowNull: false,
},
name: {
type: Sequelize.STRING,
allowNull: false
allowNull: false,
},
link: {
type: Sequelize.STRING,
allowNull: false
allowNull: false,
},
api_id: {
type: Sequelize.INTEGER,
allowNull: false
}
allowNull: false,
},
});
},
down: (queryInterface, Sequelize) => {
return queryInterface.dropTable("ApiLinks");
}
},
};
12 changes: 6 additions & 6 deletions api/database/migrations/20201012041350-apis.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,23 @@ module.exports = {
type: Sequelize.INTEGER,
autoIncrement: true,
primaryKey: true,
allowNull: false
allowNull: false,
},
name: {
type: Sequelize.STRING,
allowNull: false
allowNull: false,
},
description: {
type: Sequelize.BLOB,
allowNull: false
allowNull: false,
},
major_event: {
type: Sequelize.BOOLEAN,
allowNull: false
}
allowNull: false,
},
});
},
down: (queryInterface, Sequelize) => {
return queryInterface.dropTable("Apis");
}
},
};
14 changes: 7 additions & 7 deletions api/database/migrations/20201012041524-major_events.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,27 @@ module.exports = {
type: Sequelize.INTEGER,
autoIncrement: true,
primaryKey: true,
allowNull: false
allowNull: false,
},
name: {
type: Sequelize.STRING,
allowNull: false
allowNull: false,
},
isHackathon: {
type: Sequelize.BOOLEAN,
allowNull: false
allowNull: false,
},
start_date: {
type: Sequelize.DATE,
allowNull: false
allowNull: false,
},
end_date: {
type: Sequelize.DATE,
allowNull: false
}
allowNull: false,
},
});
},
down: (queryInterface, Sequelize) => {
return queryInterface.dropTable("MajorEvents");
}
},
};
10 changes: 5 additions & 5 deletions api/database/migrations/20201012051044-change_api_description.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ module.exports = {
up: (queryInterface, Sequelize) => {
return Promise.all([
queryInterface.changeColumn("Apis", "description", {
type: Sequelize.STRING
})
type: Sequelize.STRING,
}),
]);
},

down: (queryInterface, Sequelize) => {
return Promise.all([
queryInterface.changeColumn("Apis", "description", {
type: Sequelize.BLOB
})
type: Sequelize.BLOB,
}),
]);
}
},
};
Loading