Skip to content

Commit

Permalink
Remove hiring details from overview page (#582)
Browse files Browse the repository at this point in the history
  • Loading branch information
KrisJordan authored Aug 14, 2024
1 parent 238e16b commit f6007a9
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 31 deletions.
4 changes: 2 additions & 2 deletions backend/models/academics/hiring/hiring_assignment.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
54 changes: 29 additions & 25 deletions backend/services/academics/hiring.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand 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()
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<mat-card-content>
<mat-card-subtitle class="subtitle-header">Assignments</mat-card-subtitle>
<div class="table-responsive">
<table
<!-- <table
mat-table
[dataSource]="item().assignments"
class="surface-container-card">
Expand Down Expand Up @@ -85,13 +85,13 @@
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns"></tr>
</table>
</table> -->
</div>
<!-- <mat-divider /> -->
<mat-card-subtitle class="subtitle-header">
Instructor Preferences
</mat-card-subtitle>
@if(item().instructor_preferences.length === 0) {
<!-- @if(item().instructor_preferences.length === 0) {
<p>The instructor left no preferences.</p>
}
<div class="user-chips">
Expand All @@ -109,6 +109,6 @@
[src]="user.github_avatar" />
{{ user.first_name + ' ' + user.last_name }}
</mat-chip-option>
</div>
</div> -->
</mat-card-content>
</mat-pane>

0 comments on commit f6007a9

Please sign in to comment.