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

[INTF23 ReviewDashboardChanges #47

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
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
Prev Previous commit
adds new fields to graphql query
  • Loading branch information
aanxniee committed Dec 6, 2023
commit fbe8bce4e1bf40d1cdd649871756fd0573ae2488
11 changes: 8 additions & 3 deletions backend/typescript/graphql/resolvers/dashboardResolvers.ts
Original file line number Diff line number Diff line change
@@ -39,9 +39,8 @@
_parent: undefined,
{ secondChoice }: { secondChoice: ApplicantRole },
): Promise<Array<ApplicationDTO>> => {
const applications = await dashboardService.getApplicationsBySecondChoiceRole(
secondChoice,
);
const applications =

Check failure on line 42 in backend/typescript/graphql/resolvers/dashboardResolvers.ts

GitHub Actions / run-lint

Replace `⏎········await·dashboardService.getApplicationsBySecondChoiceRole(secondChoice` with `·await·dashboardService.getApplicationsBySecondChoiceRole(⏎········secondChoice,⏎······`
await dashboardService.getApplicationsBySecondChoiceRole(secondChoice);
return applications;
},
dashboardsByApplicationId: async (
@@ -79,8 +78,10 @@
teamPlayer,
desireToLearn,
skill,
totalScore,
skillCategory,
reviwerComments,
adminComments,
recommendedSecondChoice,
}: {
reviewerEmail: string;
@@ -90,8 +91,10 @@
teamPlayer: number;
desireToLearn: number;
skill: number;
totalScore: number;
skillCategory: string;
reviwerComments: string;
adminComments: string;
recommendedSecondChoice: string;
},
): Promise<ApplicationDashboardDTO> => {
@@ -103,8 +106,10 @@
teamPlayer,
desireToLearn,
skill,
totalScore,
skillCategory,
reviwerComments,
adminComments,
recommendedSecondChoice,
);
},
2 changes: 2 additions & 0 deletions backend/typescript/graphql/types/dashboardType.ts
Original file line number Diff line number Diff line change
@@ -90,8 +90,10 @@ const dashboardType = gql`
teamPlayer: Int!
desireToLearn: Int!
skill: Int!
totalScore: Int!
skillCategory: String!
reviwerComments: String!
adminComments: String!
recommendedSecondChoice: String!
): ApplicationDashboardDTO!
}
43 changes: 27 additions & 16 deletions backend/typescript/services/implementations/appDashboardService.ts
Original file line number Diff line number Diff line change
@@ -47,8 +47,10 @@
teamPlayer: dashboard.teamPlayer,
desireToLearn: dashboard.desireToLearn,
skill: dashboard.skill,
totalScore: dashboard.totalScore,
skillCategory: dashboard.skillCategory,
reviewerComments: dashboard.reviewerComments,
adminComments: dashboard.adminComments,
recommendedSecondChoice: dashboard.recommendedSecondChoice,
reviewerId: dashboard.reviewerId,
applicationId: dashboard.applicationId,
@@ -166,8 +168,8 @@
);
},
);
applicationsBySecondChoiceRoleDTO = await applicationsBySecondChoiceRole.map(
(application) => {
applicationsBySecondChoiceRoleDTO =

Check failure on line 171 in backend/typescript/services/implementations/appDashboardService.ts

GitHub Actions / run-lint

Replace `⏎········await·applicationsBySecondChoiceRole.map(` with `·await·applicationsBySecondChoiceRole.map(⏎········`
await applicationsBySecondChoiceRole.map((application) => {
return {
id: application.id,
academicOrCoop: application.academicOrCoop,
@@ -191,8 +193,7 @@
timesApplied: application.timesApplied,
timestamp: application.timestamp,
};
},
);
});

Check failure on line 196 in backend/typescript/services/implementations/appDashboardService.ts

GitHub Actions / run-lint

Insert `,⏎······`
} catch (error: unknown) {
Logger.error(
`Failed to get applications by this second choice role = ${role}. Reason = ${getErrorMessage(
@@ -221,8 +222,10 @@
teamPlayer: dashboard.teamPlayer,
desireToLearn: dashboard.desireToLearn,
skill: dashboard.skill,
totalScore: dashboard.totalScore,
skillCategory: dashboard.skillCategory,
reviewerComments: dashboard.reviewerComments,
adminComments: dashboard.adminComments,
recommendedSecondChoice: dashboard.recommendedSecondChoice,
reviewerId: dashboard.reviewerId,
applicationId: dashboard.applicationId,
@@ -243,15 +246,13 @@
role: ApplicantRole,
): Promise<ApplicationDashboardRowDTO[]> {
// get all the applications for the role
const applications: Array<ApplicationDTO> = await this.getApplicationsByRole(
role,
);
const applications: Array<ApplicationDTO> =

Check failure on line 249 in backend/typescript/services/implementations/appDashboardService.ts

GitHub Actions / run-lint

Replace `⏎······await·this.getApplicationsByRole(role` with `·await·this.getApplicationsByRole(⏎······role,⏎····`
await this.getApplicationsByRole(role);
// get the dashboards associated with the applications
const appDashRows: Array<ApplicationDashboardRowDTO> = await Promise.all(
applications.map(async (application) => {
const reviewDashboards: Array<ApplicationDashboardDTO> = await this.getDashboardsByApplicationId(
application.id,
);
const reviewDashboards: Array<ApplicationDashboardDTO> =

Check failure on line 254 in backend/typescript/services/implementations/appDashboardService.ts

GitHub Actions / run-lint

Replace `⏎··········await·this.getDashboardsByApplicationId(application.id` with `·await·this.getDashboardsByApplicationId(⏎··········application.id,⏎········`
await this.getDashboardsByApplicationId(application.id);
const reviewers: Array<UserDTO> = await Promise.all(
reviewDashboards.map(async (dash) => {
return userService.getUserByEmail(dash.reviewerEmail);
@@ -271,15 +272,13 @@
role: ApplicantRole,
): Promise<ApplicationDashboardRowDTO[]> {
// get all the applications for the role
const applications: Array<ApplicationDTO> = await this.getApplicationsBySecondChoiceRole(
role,
);
const applications: Array<ApplicationDTO> =

Check failure on line 275 in backend/typescript/services/implementations/appDashboardService.ts

GitHub Actions / run-lint

Replace `⏎······await·this.getApplicationsBySecondChoiceRole(role` with `·await·this.getApplicationsBySecondChoiceRole(⏎······role,⏎····`
await this.getApplicationsBySecondChoiceRole(role);
// get the dashboards associated with the applications
const appDashRows: Array<ApplicationDashboardRowDTO> = await Promise.all(
applications.map(async (application) => {
const reviewDashboards: Array<ApplicationDashboardDTO> = await this.getDashboardsByApplicationId(
application.id,
);
const reviewDashboards: Array<ApplicationDashboardDTO> =

Check failure on line 280 in backend/typescript/services/implementations/appDashboardService.ts

GitHub Actions / run-lint

Replace `⏎··········await·this.getDashboardsByApplicationId(application.id` with `·await·this.getDashboardsByApplicationId(⏎··········application.id,⏎········`
await this.getDashboardsByApplicationId(application.id);
const reviewers: Array<UserDTO> = await Promise.all(
reviewDashboards.map(async (dash) => {
return userService.getUserByEmail(dash.reviewerEmail);
@@ -331,8 +330,10 @@
teamPlayer: dashboard.teamPlayer,
desireToLearn: dashboard.desireToLearn,
skill: dashboard.skill,
totalScore: dashboard.totalScore,
skillCategory: dashboard.skillCategory,
reviewerComments: dashboard.reviewerComments,
adminComments: dashboard.adminComments,
recommendedSecondChoice: dashboard.recommendedSecondChoice,
reviewerId: dashboard.reviewerId,
applicationId: dashboard.applicationId,
@@ -347,8 +348,10 @@
teamPlayer: number,
desireToLearn: number,
skill: number,
totalScore: number,
skillCategory: string,
reviewerComments: string,
adminComments: string,
recommendedSecondChoice: string,
): Promise<ApplicationDashboardDTO> {
try {
@@ -363,8 +366,10 @@
teamPlayer,
desireToLearn,
skill,
totalScore,
skillCategory,
reviewerComments,
adminComments,
recommendedSecondChoice,
});
Logger.error(`the data: ${JSON.stringify(dashboard)}`);
@@ -375,8 +380,10 @@
teamPlayer: dashboard.teamPlayer,
desireToLearn: dashboard.desireToLearn,
skill: dashboard.skill,
totalScore: dashboard.totalScore,
skillCategory: dashboard.skillCategory,
reviewerComments: dashboard.reviewerComments,
adminComments: dashboard.adminComments,
recommendedSecondChoice: dashboard.recommendedSecondChoice,
reviewerId: dashboard.reviewerId,
applicationId: dashboard.applicationId,
@@ -413,8 +420,10 @@
teamPlayer: dashboard.teamPlayer,
desireToLearn: dashboard.desireToLearn,
skill: dashboard.skill,
totalScore: dashboard.totalScore,
skillCategory: dashboard.skillCategory,
reviewerComments: dashboard.reviewerComments,
adminComments: dashboard.adminComments,
recommendedSecondChoice: dashboard.recommendedSecondChoice,
reviewerId: dashboard.reviewerId,
applicationId: dashboard.applicationId,
@@ -447,8 +456,10 @@
teamPlayer: dashboard.teamPlayer,
desireToLearn: dashboard.desireToLearn,
skill: dashboard.skill,
totalScore: dashboard.totalScore,
skillCategory: dashboard.skillCategory,
reviewerComments: dashboard.reviewerComments,
adminComments: dashboard.adminComments,
recommendedSecondChoice: dashboard.recommendedSecondChoice,
reviewerId: dashboard.reviewerId,
applicationId: dashboard.applicationId,
11 changes: 8 additions & 3 deletions backend/typescript/services/interfaces/appDashboardService.ts
Original file line number Diff line number Diff line change
@@ -36,11 +36,14 @@ interface IAppDashboardService {
* @Param reviewerEmail the email of the reviewer
* @param applicationId the id of the application (seperate from the postgres id field of the application)
* @param reviewerAuthId the Firebase auth id of the user (This is NOT the same as the postgress id field of the user)
* @param passionFSG passion for social good rating of applicatn
* @param teamPlayer teamwork rating of applicatn
* @param skill skill rating of applicatn
* @param passionFSG passion for social good rating of application
* @param teamPlayer teamwork rating of application
* @param desireToLearn willingness to learn rating of application
* @param skill skill rating of application
* @param totalScore sum of passionFSG, teamPlayer, desireToLearn, and skill
* @param skillCategory whether applicant is viewed as junior, intermediate, or senior
* @param reviewerComments comments of the application from reviewer
* @param adminComments comments of the application from admin
* @param recommendedSecondChoice an indication of whether 2nd choice is recommended
* @param reviewComplete whether the reviewer has finished the review
* @returns an array of the updated dashboard entry ids
@@ -54,8 +57,10 @@ interface IAppDashboardService {
teamPlayer: number,
desireToLearn: number,
skill: number,
totalScore: number,
skillCategory: string,
reviewerComments: string,
adminComments: string,
recommendedSecondChoice: string,
): Promise<ApplicationDashboardDTO>;

2 changes: 2 additions & 0 deletions backend/typescript/types.ts
Original file line number Diff line number Diff line change
@@ -39,8 +39,10 @@ export type ApplicationDashboardDTO = {
teamPlayer: number;
desireToLearn: number;
skill: number;
totalScore: number;
skillCategory: string;
reviewerComments: string;
adminComments: string;
recommendedSecondChoice: string;
reviewerId: number;
applicationId: number;
Loading