Skip to content

Feature/regular students part2#138

Merged
dashaaaa21 merged 7 commits intodevelopfrom
feature/regular-students-part2
Mar 1, 2026
Merged

Feature/regular students part2#138
dashaaaa21 merged 7 commits intodevelopfrom
feature/regular-students-part2

Conversation

@dashaaaa21
Copy link
Contributor

No description provided.

Copilot AI review requested due to automatic review settings March 1, 2026 17:45
@HackYourFutures HackYourFutures temporarily deployed to study-bridge-feature-re-y9qyiu March 1, 2026 17:46 Inactive
@HackYourFutures HackYourFutures temporarily deployed to study-bridge-feature-re-f0lqpx March 1, 2026 17:50 Inactive
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends the “regular students/teachers” feature by moving regular-student management to the backend, adding weekly schedule editing/viewing for regular lessons, and using that schedule data to block unavailable time slots.

Changes:

  • Replace localStorage-based regular-student storage with API-backed queries/mutations and cache invalidations.
  • Add UI to edit a regular student’s weekly schedule (teacher side) and view a regular teacher’s schedule (student side).
  • Use regular weekly schedules to block slot selection in schedule-related UI.

Reviewed changes

Copilot reviewed 21 out of 21 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
client/src/pages/privetTeachersPages/teacherProfile/TeacherProfile.tsx Invalidates teacher profile queries after schedule save; blocks schedule slots using regular-student weekly schedules.
client/src/pages/privetTeachersPages/teacherAppointments/TeacherAppointments.tsx Migrates regular-student management to API; adds modal to edit a regular student’s schedule; removes localStorage logic.
client/src/pages/privateStudentsPages/clientsAppointments/ClientsAppointments.tsx Adds “Regular Teachers” tab backed by API + pagination; adds schedule viewing modal.
client/src/features/appointments/query/useTeacherAppointmentsQuery.ts Changes query enabled condition for teacher appointments fetching.
client/src/features/appointments/mutations/useUpdateWeeklyScheduleMutation.ts Invalidates additional appointment-related query keys after updating weekly schedule.
client/src/features/appointments/mutations/useSetRegularStudentMutation.ts Invalidates regular-teachers + teacher-appointments queries after setting regular student.
client/src/features/appointments/mutations/useRemoveRegularStudentMutation.ts Invalidates regular-teachers + teacher-appointments queries after removal; adds error logging.
client/src/components/teacherSection/teacherSchedule/TeacherSchedule.tsx Uses teacher appointments + regular weekly schedules to block booking times; tweaks availability parsing for 23:59.
client/src/components/teacherProfileSection/LessonSchedule.tsx Adds bookedSlots support and blocks selection for occupied slots; refactors modal content wrapper.
client/src/components/teacherAppointmentCard/TeacherAppointmentsList.tsx Adjusts callbacks/conditions for add/remove regular and schedule click behavior.
client/src/components/teacherAppointmentCard/TeacherAppointmentInfo.tsx Displays formatted weekly schedule in regular tab.
client/src/components/teacherAppointmentCard/TeacherAppointmentCard.tsx Passes weekly schedule + regular-tab flag down to info component.
client/src/components/teacherAppointmentCard/TeacherAppointmentActions.tsx Tightens action visibility and updates copy for regular-student actions.
client/src/components/sidebar/sidebarMenuItems.ts Removes commented menu items and centralizes menu configuration.
client/src/components/sidebar/Sidebar.tsx Switches to importing menu definitions from sidebarMenuItems.ts.
client/src/components/regularStudentScheduleModal/RegularStudentScheduleModal.tsx Refactors modal content wrapper; improves default next-slot selection behavior.
client/src/components/appointmentCard/AppointmentStatusBar.tsx Adds “Regular Teacher” variant with “Show Schedule” action; adds “Regular” badge support.
client/src/components/appointmentCard/AppointmentInfo.tsx Displays formatted weekly schedule for regular teachers.
client/src/components/appointmentCard/AppointmentCard.tsx Adds regular-teacher styling + passes schedule props into status/info components.
client/src/api/appointments/regularStudents.api.ts Removes unused helper that fetched all regular-student slots.
Comments suppressed due to low confidence (1)

client/src/components/teacherSection/teacherSchedule/TeacherSchedule.tsx:179

  • endHour is no longer validated (previously both start/end were range-checked). With the new 23:59 -> 24 logic, it would be safer to validate endHour as well (allowing 24) and ensure endHour > startHour; otherwise malformed availability like 25:00 could generate invalid time slots.
      const startHour = parseInt(startMatch[1], 10);
      let endHour = parseInt(endMatch[1], 10);

      if (slot.end === "23:59") {
        endHour = 24;
      }

      if (startHour < 0 || startHour > 23) {
        return;
      }

      for (let hour = startHour; hour < endHour; hour++) {
        slots.push(`${hour.toString().padStart(2, "0")}:00`);
      }

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@HackYourFutures HackYourFutures temporarily deployed to study-bridge-feature-re-f0lqpx March 1, 2026 18:04 Inactive
@dashaaaa21 dashaaaa21 merged commit 7af4320 into develop Mar 1, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants