Repository navigation
fix(teacher-view): remove grade form and fix lead teacher report - #245
Merged
Merged
Conversation
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
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 nograderesource, so they ended up on the "לא קיים" (not found) page.GeneralLayout.jsx: the "טופס ציונים" menu item no longer shows forteacherViewusers.App.jsx: the/in-lesson-report-graderoute is removed from the teacher-view routes.The standard and
inLessonReport.onlyviews still have the grade form.2. Lead teacher report ("דוח נוכחות לרכזת") returned a 500 error
This report filters on
klass.klassType.teacherReferenceId.BaseEntityService.createBuildervalidates filter fields before crud sets up the joins. During that check, crud looked up the nestedklass.klassTyperelation while its parentklasswas not resolved yet. It then cached the relation with no join path, and the laterleftJointhrewCannot read properties of undefined (reading 'substr').The fix is in
att-report-with-report-month.config.ts: the service resolvesklassbefore callingsuper.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 throughBaseEntityServiceinserver/shared.Testing
yarn test, 252 tests passing.npx jest src/entity-modules, 242 tests passing, including a new test that checksklassis resolved before the builder is created.No
buzz-code/opsissue is linked because that repo isn't reachable from this session.🤖 Generated with Claude Code
https://claude.ai/code/session_012GTicq4LVmQQte9gifqSvU