From f6007a94d65ead12297914646bd908728939b2b3 Mon Sep 17 00:00:00 2001 From: Kris Jordan Date: Wed, 14 Aug 2024 11:40:09 -0400 Subject: [PATCH] Remove hiring details from overview page (#582) --- .../academics/hiring/hiring_assignment.py | 4 +- backend/services/academics/hiring.py | 54 ++++++++++--------- .../course-hiring-card.widget.html | 8 +-- 3 files changed, 35 insertions(+), 31 deletions(-) diff --git a/backend/models/academics/hiring/hiring_assignment.py b/backend/models/academics/hiring/hiring_assignment.py index 8cdc65f1f..f3e81027a 100644 --- a/backend/models/academics/hiring/hiring_assignment.py +++ b/backend/models/academics/hiring/hiring_assignment.py @@ -89,8 +89,8 @@ class HiringCourseSiteOverview(BaseModel): total_cost: float coverage: float assignments: list[HiringAssignmentOverview] - reviews: list[ApplicationReviewOverview] - instructor_preferences: list[PublicUser] + # reviews: list[ApplicationReviewOverview] + # instructor_preferences: list[PublicUser] class HiringAdminOverview(BaseModel): diff --git a/backend/services/academics/hiring.py b/backend/services/academics/hiring.py index 62bf477e7..462cd1083 100644 --- a/backend/services/academics/hiring.py +++ b/backend/services/academics/hiring.py @@ -587,13 +587,13 @@ def get_hiring_admin_overview( .join(CourseSiteEntity.term) .where(TermEntity.id == term_id) .options( - joinedload(CourseSiteEntity.sections) - .joinedload(SectionEntity.staff) - .joinedload(SectionMemberEntity.user), - joinedload(CourseSiteEntity.application_reviews) - .joinedload(ApplicationReviewEntity.application) - .joinedload(ApplicationEntity.user), - joinedload(CourseSiteEntity.hiring_assignments), + joinedload(CourseSiteEntity.sections), + # # .joinedload(SectionEntity.staff) + # # .joinedload(SectionMemberEntity.user), + # joinedload(CourseSiteEntity.application_reviews) + # .joinedload(ApplicationReviewEntity.application), + # # .joinedload(ApplicationEntity.user), + # joinedload(CourseSiteEntity.hiring_assignments), ) ) course_site_entities = self._session.scalars(course_site_query).unique().all() @@ -615,22 +615,26 @@ def get_hiring_admin_overview( if staff.member_role == RosterRole.INSTRUCTOR ] total_enrollment += section_entity.enrolled - preferred_review_entities = sorted( - [ - review - for review in course_site_entity.application_reviews - if review.status == ApplicationReviewStatus.PREFERRED - ], - key=lambda x: x.preference, - ) - reviews = [ - application_review.to_overview_model() - for application_review in preferred_review_entities - ] - instructor_preferences = [ - application_review.application.user.to_public_model() - for application_review in preferred_review_entities - ] + + # preferred_review_query = ( + # select(ApplicationReviewEntity) + # .where( + # ApplicationReviewEntity.course_site_id == course_site_entity.id, + # ApplicationReviewEntity.status == ApplicationReviewStatus.PREFERRED, + # ) + # .order_by(ApplicationReviewEntity.preference) + # ) + # preferred_review_entities = self._session.scalars( + # preferred_review_query + # ).all() + # reviews = [ + # application_review.to_overview_model() + # for application_review in preferred_review_entities + # ] + # instructor_preferences = [ + # application_review.application.user.to_public_model() + # for application_review in preferred_review_entities + # ] assignments = sorted( [ assignment.to_overview_model() @@ -652,8 +656,8 @@ def get_hiring_admin_overview( total_cost=total_cost, coverage=coverage, assignments=assignments, - reviews=reviews, - instructor_preferences=instructor_preferences, + # reviews=reviews, + # instructor_preferences=instructor_preferences, ) # Add overview to the list diff --git a/frontend/src/app/hiring/widgets/course-hiring-card/course-hiring-card.widget.html b/frontend/src/app/hiring/widgets/course-hiring-card/course-hiring-card.widget.html index 8788898f0..a428678b1 100644 --- a/frontend/src/app/hiring/widgets/course-hiring-card/course-hiring-card.widget.html +++ b/frontend/src/app/hiring/widgets/course-hiring-card/course-hiring-card.widget.html @@ -8,7 +8,7 @@ Assignments
- @@ -85,13 +85,13 @@ -
+ -->
Instructor Preferences - @if(item().instructor_preferences.length === 0) { +