diff --git a/backend/entities/academics/section_entity.py b/backend/entities/academics/section_entity.py index bfb3fd653..8ec00056c 100644 --- a/backend/entities/academics/section_entity.py +++ b/backend/entities/academics/section_entity.py @@ -125,6 +125,8 @@ def from_model(cls, model: Section) -> Self: meeting_pattern=model.meeting_pattern, override_title=model.override_title, override_description=model.override_description, + enrolled=model.enrolled, + total_seats=model.total_seats, ) def to_model(self) -> Section: @@ -150,6 +152,8 @@ def to_model(self) -> Section: staff=[members.to_flat_model() for members in self.staff], override_title=self.override_title, override_description=self.override_description, + enrolled=self.enrolled, + total_seats=self.total_seats, ) def to_details_model(self) -> SectionDetails: @@ -179,4 +183,6 @@ def to_details_model(self) -> SectionDetails: course_site=( self.course_site.to_model() if self.course_site is not None else None ), + enrolled=self.enrolled, + total_seats=self.total_seats, ) diff --git a/backend/models/academics/section.py b/backend/models/academics/section.py index c54fd2445..c74e02235 100644 --- a/backend/models/academics/section.py +++ b/backend/models/academics/section.py @@ -26,3 +26,5 @@ class Section(BaseModel): office_hour_rooms: list[Room] = [] override_title: str override_description: str + enrolled: int + total_seats: int diff --git a/backend/services/academics/section_member.py b/backend/services/academics/section_member.py index 8776354c9..b34c0e723 100644 --- a/backend/services/academics/section_member.py +++ b/backend/services/academics/section_member.py @@ -186,7 +186,7 @@ def import_users_from_csv(self, subject: User, section_id: int, csv_data: str): try: for row in reader: - if reader.line_num != 2: + if reader.line_num != 2 and row["Student"] != "Student, Test": # Ensure that the uploaded CSV only contains one section unique_sections.add(row["Section"]) diff --git a/backend/test/services/academics/section_data.py b/backend/test/services/academics/section_data.py index 84f9927a7..2d4687a65 100644 --- a/backend/test/services/academics/section_data.py +++ b/backend/test/services/academics/section_data.py @@ -52,6 +52,8 @@ meeting_pattern="TTh 12:00PM - 1:15PM", override_title="", override_description="", + enrolled=100, + total_seats=200, ) comp_101_002 = Section( @@ -62,6 +64,8 @@ meeting_pattern="TTh 1:30PM - 2:45PM", override_title="", override_description="", + enrolled=100, + total_seats=200, ) comp_210_001 = Section( @@ -72,6 +76,8 @@ meeting_pattern="TTh 8:00AM - 9:15AM", override_title="", override_description="", + enrolled=100, + total_seats=200, ) comp_211_001 = Section( @@ -82,6 +88,8 @@ meeting_pattern="TTh 8:00AM - 9:15AM", override_title="", override_description="", + enrolled=100, + total_seats=200, ) comp_301_001 = Section( @@ -92,6 +100,8 @@ meeting_pattern="TTh 8:00AM - 9:15AM", override_title="", override_description="", + enrolled=100, + total_seats=200, ) comp_311_001 = Section( @@ -102,6 +112,8 @@ meeting_pattern="TTh 8:00AM - 9:15AM", override_title="", override_description="", + enrolled=100, + total_seats=200, ) edited_comp_110 = Section( @@ -112,6 +124,8 @@ meeting_pattern="MW 1:30PM - 2:45PM", override_title="", override_description="", + enrolled=100, + total_seats=200, ) edited_comp_110_with_room = Section( @@ -123,6 +137,8 @@ override_title="", override_description="", lecture_room=virtual_room, + enrolled=100, + total_seats=200, ) edited_comp_301_with_room = Section( @@ -134,6 +150,8 @@ override_title="", override_description="", lecture_room=virtual_room, + enrolled=100, + total_seats=200, ) new_section = Section( @@ -144,6 +162,8 @@ meeting_pattern="MW 1:30PM - 2:45PM", override_title="", override_description="", + enrolled=100, + total_seats=200, ) new_section_with_lecture_room = Section( @@ -155,6 +175,8 @@ override_title="", override_description="", lecture_room=virtual_room, + enrolled=100, + total_seats=200, ) @@ -167,6 +189,8 @@ meeting_pattern="TTh 2:00PM - 3:15PM", override_title="", override_description="", + enrolled=100, + total_seats=200, ) comp_210_001_current_term = Section( @@ -177,6 +201,8 @@ meeting_pattern="TTh 9:00AM - 10:15AM", override_title="", override_description="", + enrolled=100, + total_seats=200, ) @@ -188,6 +214,8 @@ meeting_pattern="TTh 12:00PM - 1:15PM", override_title="", override_description="", + enrolled=100, + total_seats=200, ) comp_110_002_current_term = Section( @@ -198,6 +226,8 @@ meeting_pattern="TTh 1:30PM - 2:45PM", override_title="", override_description="", + enrolled=100, + total_seats=200, ) comp_301_001_current_term = Section( @@ -208,6 +238,8 @@ meeting_pattern="TTh 8:00AM - 9:15AM", override_title="", override_description="", + enrolled=100, + total_seats=200, ) comp_301_002_current_term = Section( @@ -218,6 +250,8 @@ meeting_pattern="TTh 5:00PM - 6:15PM", override_title="", override_description="", + enrolled=100, + total_seats=200, ) comp_311_001_current_term = Section( @@ -228,6 +262,8 @@ meeting_pattern="TTh 5:00PM - 6:15PM", override_title="", override_description="", + enrolled=100, + total_seats=200, ) comp_311_002_current_term = Section( @@ -238,6 +274,8 @@ meeting_pattern="TTh 5:00PM - 6:15PM", override_title="", override_description="", + enrolled=100, + total_seats=200, ) # Variables To Help Associate User Data to Section Members diff --git a/frontend/src/app/academics/academics.models.ts b/frontend/src/app/academics/academics.models.ts index 9a3abae08..60b676347 100644 --- a/frontend/src/app/academics/academics.models.ts +++ b/frontend/src/app/academics/academics.models.ts @@ -35,6 +35,8 @@ export interface Section { office_hour_rooms: Room[] | null; override_title: string; override_description: string; + enrolled: number; + total_seats: number; } /** Defines a Term */ @@ -72,8 +74,8 @@ export interface Room { /** Defines a Roster Role */ export enum RosterRole { - STUDENT = 0, - UTA = 1, - GTA = 2, - INSTRUCTOR = 3 + STUDENT = 'Student', + UTA = 'UTA', + GTA = 'GTA', + INSTRUCTOR = 'Instructor' } diff --git a/frontend/src/app/academics/academics.resolver.ts b/frontend/src/app/academics/academics.resolver.ts index 0a66490a7..583f71806 100644 --- a/frontend/src/app/academics/academics.resolver.ts +++ b/frontend/src/app/academics/academics.resolver.ts @@ -115,7 +115,9 @@ export const sectionResolver: ResolveFn
= ( lecture_room: null, office_hour_rooms: [], override_title: '', - override_description: '' + override_description: '', + enrolled: 0, + total_seats: 0 }; } diff --git a/frontend/src/app/my-courses/catalog/section-offerings/section-offerings.component.html b/frontend/src/app/my-courses/catalog/section-offerings/section-offerings.component.html index 29b481220..a46a8b056 100644 --- a/frontend/src/app/my-courses/catalog/section-offerings/section-offerings.component.html +++ b/frontend/src/app/my-courses/catalog/section-offerings/section-offerings.component.html @@ -56,6 +56,14 @@ {{ element.lecture_room?.nickname ?? 'Unknown' }} + + Enrolled + + @if (element.total_seats <= 0) { Unknown } @else { + {{ element.enrolled }} / {{ element.total_seats }} + } + +   diff --git a/frontend/src/app/my-courses/catalog/section-offerings/section-offerings.component.ts b/frontend/src/app/my-courses/catalog/section-offerings/section-offerings.component.ts index 1648a14ef..b0b312531 100644 --- a/frontend/src/app/my-courses/catalog/section-offerings/section-offerings.component.ts +++ b/frontend/src/app/my-courses/catalog/section-offerings/section-offerings.component.ts @@ -73,9 +73,10 @@ export class SectionOfferingsComponent implements OnInit { public displayedColumns: string[] = [ 'code', 'title', - //'instructor', + 'instructor', 'meetingpattern', - 'room' + 'room', + 'enrollment' ]; /** Store the columns to display when extended */ public columnsToDisplayWithExpand = [...this.displayedColumns, 'expand']; @@ -128,7 +129,7 @@ export class SectionOfferingsComponent implements OnInit { instructorNameForSection(section: Section): string { // Find all staff with the instructor role let staffFilter = section.staff?.filter( - (s) => s.member_role == RosterRole.INSTRUCTOR + (s) => s.member_role == 'Instructor' ); // Find the instructor let instructor = staffFilter?.length ?? 0 > 0 ? staffFilter![0] : null; diff --git a/frontend/src/app/my-courses/course/office-hours/office-hours-get-help/office-hours-get-help.component.html b/frontend/src/app/my-courses/course/office-hours/office-hours-get-help/office-hours-get-help.component.html index 59eef05c3..f8c8ed624 100644 --- a/frontend/src/app/my-courses/course/office-hours/office-hours-get-help/office-hours-get-help.component.html +++ b/frontend/src/app/my-courses/course/office-hours/office-hours-get-help/office-hours-get-help.component.html @@ -64,8 +64,8 @@ Ticket Type - Assignment Help - Conceptual Help + Assignment Help + Conceptual Help @if (ticketForm.controls['type'].value === 'Assignment Help') { diff --git a/frontend/src/app/my-courses/course/office-hours/office-hours-get-help/office-hours-get-help.component.ts b/frontend/src/app/my-courses/course/office-hours/office-hours-get-help/office-hours-get-help.component.ts index 110effc15..fe049ded4 100644 --- a/frontend/src/app/my-courses/course/office-hours/office-hours-get-help/office-hours-get-help.component.ts +++ b/frontend/src/app/my-courses/course/office-hours/office-hours-get-help/office-hours-get-help.component.ts @@ -151,8 +151,10 @@ export class OfficeHoursGetHelpComponent implements OnInit, OnDestroy { next: (_) => { this.pollData(); }, - error: (err) => { - /** */ + error: (_) => { + this.snackBar.open(`Could not create a ticket at this time.`, '', { + duration: 2000 + }); } }); } diff --git a/frontend/src/app/my-courses/my-courses-page/my-courses-page.component.html b/frontend/src/app/my-courses/my-courses-page/my-courses-page.component.html index 0e10067b6..223e15baf 100644 --- a/frontend/src/app/my-courses/my-courses-page/my-courses-page.component.html +++ b/frontend/src/app/my-courses/my-courses-page/my-courses-page.component.html @@ -20,10 +20,6 @@ View Catalog - @if (this.myCoursesService.teachingCoursesWithNoSite()) {