Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 5 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions .idea/dashboard.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions .idea/mongoSettings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added .yarn/install-state.gz
Binary file not shown.
1 change: 1 addition & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodeLinker: node-modules
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# [McHacks Dashboard](https://app.mchacks.ca)

[![Netlify Status](https://api.netlify.com/api/v1/badges/909350ee-5bb5-47c4-88e3-81c1de52db92/deploy-status)](https://app.netlify.com/sites/mchacks-dashboard/deploys)

This repository contains the code for the hackathon dashboard of [McHacks](https://mchacks.ca), Canada's favourite hackathon hosted annually at McGill University. It connects with our [API](https://github.com/hackmcgill/hackerAPI) and is hosted at [app.mchacks.ca](https://app.mchacks.ca).

## Folder Structure
Expand Down
59 changes: 56 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"react-helmet": "^6.1.0",
"react-modal": "^3.16.1",
"react-number-format": "^5.3.1",
"react-phone-number-input": "^3.4.9",
"react-responsive": "^9.0.2",
"react-router-dom": "^6.21.1",
"react-scripts": "^5.0.1",
Expand Down
103 changes: 103 additions & 0 deletions src/api/hacker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
APIRoute,
CACHE_HACKER_KEY,
CACHE_STATS_KEY,
HackerReviewerStatus,
HackerStatus,
IHacker,
IResumeResponse,
Expand All @@ -22,6 +23,12 @@ class HackerAPI {
API.createEntity(APIRoute.HACKER_CHECKIN);
API.createEntity(APIRoute.HACKER);
API.createEntity(APIRoute.HACKER_STATUS);
API.createEntity(APIRoute.HACKER_REVIEWER_STATUS);
API.createEntity(APIRoute.HACKER_REVIEWER_STATUS2);
API.createEntity(APIRoute.HACKER_REVIEWER_NAME);
API.createEntity(APIRoute.HACKER_REVIEWER_NAME2);
API.createEntity(APIRoute.HACKER_REVIEWER_COMMENTS);
API.createEntity(APIRoute.HACKER_REVIEWER_COMMENTS2);
}
/**
* Create an account.
Expand Down Expand Up @@ -114,6 +121,102 @@ class HackerAPI {
return value;
}

/**
* Update's a hacker's reviewer status any status to any status of type HackerReviewerStatus
* @param {String} id The id of the hacker to be updated
* @param {HackerReviewerStatus} reviewerStatus The new status of the hacker
*/
public updateReviewerStatus(id: string, reviewerStatus: HackerReviewerStatus): AxiosPromise {
const key = CACHE_HACKER_KEY + '-' + id;
const value = API.getEndpoint(APIRoute.HACKER_REVIEWER_STATUS).patch(
{ id },
{ reviewerStatus }
);
LocalCache.remove(CACHE_HACKER_KEY);
LocalCache.remove(key);
return value;
}

/**
* Update's a hacker's reviewer status (2nd) any status to any status of type HackerReviewerStatus
* @param {String} id The id of the hacker to be updated
* @param {HackerReviewerStatus} reviewerStatus2 The new status of the hacker
*/
public updateReviewerStatus2(id: string, reviewerStatus2: HackerReviewerStatus): AxiosPromise {
const key = CACHE_HACKER_KEY + '-' + id;
const value = API.getEndpoint(APIRoute.HACKER_REVIEWER_STATUS2).patch(
{ id },
{ reviewerStatus2 }
);
LocalCache.remove(CACHE_HACKER_KEY);
LocalCache.remove(key);
return value;
}

/**
* Update's a hacker's reviewer name to any name of type string
* @param {String} id The id of the hacker to be updated
* @param {String} reviewerName The new status of the hacker
*/
public updateReviewerName(id: string, reviewerName: string): AxiosPromise {
const key = CACHE_HACKER_KEY + '-' + id;
const value = API.getEndpoint(APIRoute.HACKER_REVIEWER_NAME).patch(
{ id },
{ reviewerName }
);
LocalCache.remove(CACHE_HACKER_KEY);
LocalCache.remove(key);
return value;
}

/**
* Update's a hacker's reviewer name 2 to any name of type string
* @param {String} id The id of the hacker to be updated
* @param {String} reviewerName2 The new status of the hacker
*/
public updateReviewerName2(id: string, reviewerName2: string): AxiosPromise {
const key = CACHE_HACKER_KEY + '-' + id;
const value = API.getEndpoint(APIRoute.HACKER_REVIEWER_NAME2).patch(
{ id },
{ reviewerName2 }
);
LocalCache.remove(CACHE_HACKER_KEY);
LocalCache.remove(key);
return value;
}

/**
* Update's a hacker's reviewer comments to any name of type string
* @param {String} id The id of the hacker to be updated
* @param {String} reviewerComments The new status of the hacker
*/
public updateReviewerComments(id: string, reviewerComments: string): AxiosPromise {
const key = CACHE_HACKER_KEY + '-' + id;
const value = API.getEndpoint(APIRoute.HACKER_REVIEWER_COMMENTS).patch(
{ id },
{ reviewerComments }
);
LocalCache.remove(CACHE_HACKER_KEY);
LocalCache.remove(key);
return value;
}

/**
* Update's a hacker's reviewer comments to any name of type string
* @param {String} id The id of the hacker to be updated
* @param {String} reviewerComments2 The new status of the hacker
*/
public updateReviewerComments2(id: string, reviewerComments2: string): AxiosPromise {
const key = CACHE_HACKER_KEY + '-' + id;
const value = API.getEndpoint(APIRoute.HACKER_REVIEWER_COMMENTS2).patch(
{ id },
{ reviewerComments2 }
);
LocalCache.remove(CACHE_HACKER_KEY);
LocalCache.remove(key);
return value;
}

/**
* Update's a hacker's status to checked-in if the hacker is accepted or confirmed.
* @param {String} id The id of the hacker to be updated
Expand Down
6 changes: 6 additions & 0 deletions src/config/APIRoute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ export enum APIRoute {
HACKER_SELF = 'hacker/self',
HACKER_STATS = 'hacker/stats',
HACKER_STATUS = 'hacker/status',
HACKER_REVIEWER_STATUS = 'hacker/reviewerStatus',
HACKER_REVIEWER_STATUS2 = 'hacker/reviewerStatus2',
HACKER_REVIEWER_NAME = 'hacker/reviewerName',
HACKER_REVIEWER_NAME2 = 'hacker/reviewerName2',
HACKER_REVIEWER_COMMENTS = 'hacker/reviewerComments',
HACKER_REVIEWER_COMMENTS2 = 'hacker/reviewerComments2',
// Travel routes
TRAVEL = 'travel',
TRAVEL_EMAIL = 'travel/email',
Expand Down
9 changes: 7 additions & 2 deletions src/config/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export const PRONOUN_PLACEHOLDER = 'Pronouns';
export const GENDER_LABEL = 'Gender';
export const GENDER_PLACEHOLDER = 'Gender';
export const PHONE_NUMBER_LABEL = 'Phone number';
export const BIRTH_DATE_LABEL = 'Birth date';
export const AGE_LABEL = 'Age';
export const FIRST_NAME_LABEL = 'First name';
export const LAST_NAME_LABEL = 'Last name';

Expand Down Expand Up @@ -102,6 +102,10 @@ export const COC_ACCEPTANCE_PHRASE = 'I accept the';
export const COC_MCHACKS_REQUEST_LABEL = 'McHacks Code of Conduct';
export const COC_MLH_REQUEST_LABEL = 'MLH terms, conditions and guidelines.';
export const COMMENTS_LABEL = "Is there anything you'd like us to know?";
export const COUNTRY_LABEL = 'Country of Residence';
export const COUNTRY_PLACEHOLDER = 'Country of Residence';
export const COUNTRY_TEXT =
'Please indicate your current country of residence.';
export const DEGREE_LABEL = 'Degree';
export const DEGREE_PLACEHOLDER = 'High School, Undergraduate...';
export const DRIBBBLE_LINK_LABEL = 'Dribbble URL';
Expand All @@ -128,6 +132,7 @@ export const OTHER_LINK_PLACEHOLDER = 'https://my.website.com/';
export const MCHACKS_COC = 'Code of Conduct';
export const MCHACKS_PRIVACY = 'Privacy Policy';
export const MLH_LABEL = 'I accept the MLH policies.';
export const SEND_EMAIL_LABEL = 'I authorize MLH to send me occasional emails about relevant events, career opportunities, and community announcements.';
export const PERSONAL_LABEL = 'Personal URL';
export const RESUME_LABEL = 'Resume';
export const SHIRT_SIZE_LABEL = 'Shirt Size (Unisex)';
Expand All @@ -143,7 +148,7 @@ export const TRAVEL_REQUEST_REASON_LABEL = 'Reason';
export const PREVIOUS_HACKATHONS_LABEL =
'How many hackathons have you been to?';
export const REVIEW_APPLICIATION_DESCRIPTION =
'Your are about to submit. Please review your application before submitting. You won’t be able to edit your responses later.';
'You are about to submit. Please review your application before submitting. You won’t be able to edit your responses later.';

// Invite Page
export const ACCOUNT_TYPE_LABEL = 'Account type';
Expand Down
Loading