Repository navigation
Add klass exclusion filter to student report card; remove old non-react report card - #130
Merged
Merged
Conversation
…ct report card - add denyKlassReferenceIds param to studentReportCardReact (server + client) - exclude denied klasses from getReportsFilterForReportCard, combined with klassType inclusion filter when both present - delete server/src/reports/studentReportCard.ts (old ejs-based report) and its registrations - update tests accordingly Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012dgrqbwpeXRKvrQZER1QDo
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012dgrqbwpeXRKvrQZER1QDo
There was a problem hiding this comment.
Pull request overview
Add klass-exclusion filter to student report card pipeline (client bulk button → report generator → TypeORM query filter). Remove legacy EJS report card wiring.
Changes:
- Client: add
denyKlassReferenceIdsinput to React report card bulk button - Server: thread
denyKlassReferenceIdsintogetReportsFilterForReportCard, add shared deny-ids filter helper - Cleanup: delete old
studentReportCard.ts(EJS) and remove registrations + update tests/docs
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| server/src/utils/studentReportData.util.ts | Add deny-ids helper; apply deny klass + deny lesson filters in report query |
| server/src/utils/tests/studentReportData.util.spec.ts | Add coverage for deny klass behavior |
| server/src/reports/studentReportCardReact.tsx | Add denyKlassReferenceIds param, pass into report filter builder |
| server/src/reports/studentReportCard.ts | Remove legacy EJS report generator |
| server/src/reports/reportGenerator.ts | Thread denyKlassReferenceIds from request into report params |
| server/src/entity-modules/student.config.ts | Remove legacy report from reportsDict |
| server/src/entity-modules/student-klass.config.ts | Remove legacy report from reportsDict |
| server/src/entity-modules/student-klass-report.config.ts | Remove legacy report from reportsDict |
| server/src/entity-modules/tests/student.config.spec.ts | Update expectations to only React report type |
| server/src/entity-modules/tests/student-klass.config.spec.ts | Remove legacy report-type test path |
| project-index.md | Remove legacy report file from docs index |
| client/src/reports/studentReportCardReactButton.jsx | Add klass deny input to report button form |
| client/src/entities/student.jsx | Remove old commented-out bulk button entry |
Suppressed comments (1)
server/src/utils/studentReportData.util.ts:114
- getReportsFilterForReportCard params typed as required (reportDateFilter/globalLessonIdsStr/denyLessonIdStr), but call sites/tests pass null/undefined. Align types to avoid unsafe calls and TS errors.
export function getReportsFilterForReportCard(
studentId: number,
year: number,
reportDateFilter: FindOperator<any>,
globalLessonIdsStr: string,
denyLessonIdStr: string,
klassIds?: number[],
denyKlassIdStr?: string,
): FindOptionsWhere<AttReportAndGrade>[] {
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+95
to
+104
| // builds an inclusion/exclusion filter for a reference id column: excludes denyIdsStr, | ||
| // intersected with includeIds when given (used for klass ids, which also have a klassType inclusion list) | ||
| function getDenyIdsFilter(denyIdsStr: string, includeIds?: number[]): FindOperator<number> { | ||
| const denyIds = getAsArray(denyIdsStr); | ||
| if (includeIds?.length) { | ||
| const filteredIds = denyIds?.length ? includeIds.filter((id) => !denyIds.includes(String(id))) : includeIds; | ||
| return In(filteredIds); | ||
| } | ||
| return denyIds?.length ? Not(In(denyIds)) : undefined; | ||
| } |
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.
Summary
denyKlassReferenceIdsparam threaded throughreportGenerator.ts→studentReportCardReact.tsx→getReportsFilterForReportCard, which now excludes denied klasses (works standalone, or intersected with the existing klass-type inclusion filter when both are set)getDenyIdsFilterhelperserver/src/reports/studentReportCard.ts, ejs-based) and its registrations instudent.config.ts,student-klass.config.ts,student-klass-report.config.tsTesting
yarn testinserver: 97 suites / 913 tests passingGenerated by Claude Code