Skip to content

fix(teacher-view): remove grade form and fix lead teacher report - #245

Merged
buzz-code merged 2 commits into
mainfrom
claude/project-thread-kjgglk
Oct 28, 2026
Merged

buzz-code merged 2 commits into
mainfrom
claude/project-thread-kjgglk

Conversation

@buzz-code

@buzz-code buzz-code commented Oct 28, 2026 •

Copy link
Copy Markdown
Owner

Requested by הדסה · project thread

Summary

This PR fixes two problems in the teacher view.

1. Grade form removed from the teacher view
When a teacher saved grades, the form sent them to /grade. The teacher view has no grade resource, so they ended up on the "לא קיים" (not found) page.

  • GeneralLayout.jsx: the "טופס ציונים" menu item no longer shows for teacherView users.
  • App.jsx: the /in-lesson-report-grade route is removed from the teacher-view routes.

The standard and inLessonReport.only views still have the grade form.

2. Lead teacher report ("דוח נוכחות לרכזת") returned a 500 error
This report filters on klass.klassType.teacherReferenceId. BaseEntityService.createBuilder validates filter fields before crud sets up the joins. During that check, crud looked up the nested klass.klassType relation while its parent klass was not resolved yet. It then cached the relation with no join path, and the later leftJoin threw Cannot read properties of undefined (reading 'substr').

The fix is in att-report-with-report-month.config.ts: the service resolves klass before calling super.createBuilder. This keeps the change in this repo and leaves the shared code alone. The same ordering issue could affect other nested filters that go through BaseEntityService in server/shared.

Testing

  • Client: yarn test, 252 tests passing.
  • Server: npx jest src/entity-modules, 242 tests passing, including a new test that checks klass is resolved before the builder is created.
  • I checked both fixes against a locally running stack. The lead teacher report request returned 500 before the fix and now returns data (343 rows for the demo lead teacher). The teacher menu no longer shows the grade form.

No buzz-code/ops issue is linked because that repo isn't reachable from this session.

🤖 Generated with Claude Code

https://claude.ai/code/session_012GTicq4LVmQQte9gifqSvU

Saving grades from the teacher view redirected to /grade, which is not a
resource in that view, so teachers landed on a not-found page. Hide the
grade form menu item and drop its route for teacher-view users.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012GTicq4LVmQQte9gifqSvU
@buzz-code buzz-code self-assigned this Oct 28, 2026
The lead teacher report filters on klass.klassType.teacherReferenceId.
BaseEntityService validates filter fields before crud sets up joins, so
crud cached the nested klass.klassType relation without a join path
(its parent klass was not resolved yet) and the request failed with a
500. Resolve klass first in the att_report_with_report_month service.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012GTicq4LVmQQte9gifqSvU
@buzz-code buzz-code changed the title fix(teacher-view): remove grade form from teacher view fix(teacher-view): remove grade form and fix lead teacher report Oct 28, 2026
@buzz-code
buzz-code merged commit 4c7152d into main Oct 28, 2026
4 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.

2 participants