Repository navigation
Allow OR between attendance/grade limit filters in student report card - #105
Merged
Merged
Conversation
…rs in student report card Previously, when both attendanceLessThan and gradesLessThan were set, a row had to satisfy both to be shown. Add a limitFilterUseOr toggle so a row can be shown when it satisfies either limit instead, defaulting to the existing AND behavior.
Keeps only the dedicated LessonScheduleImportButton (Excel upload with Yemot auto-detect) in the list actions.
This reverts commit b7af386.
There was a problem hiding this comment.
Pull request overview
This PR adds an opt-in toggle to the “תעודה לתלמידה” report so that when both attendanceLessThan and gradesLessThan are provided, the report can filter rows using OR (either condition) instead of the existing AND (both conditions), while keeping AND as the default to preserve current behavior.
Changes:
- Added
limitFilterUseOrto student report card report params and plumbed it through the server report generator. - Updated
filterReportsto support OR-vs-AND behavior when both limit filters are set. - Added a UI checkbox for the toggle and recorded the feature in the client roadmap.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| server/src/reports/studentReportCardReact.tsx | Adds limitFilterUseOr param and updates filterReports to support OR/AND filtering when both limits are set. |
| server/src/reports/reportGenerator.ts | Includes limitFilterUseOr in the generated extra params from request input. |
| client/src/reports/studentReportCardReactButton.jsx | Adds a BooleanInput checkbox so users can choose OR behavior per report run. |
| client/src/roadmapFeatures.js | Adds a roadmap entry documenting completion of the new OR/AND toggle feature. |
Files not reviewed (1)
- client/src/roadmapFeatures.js: Generated file
Comment on lines
+617
to
629
| const failsAttendanceLimit = reportParams.attendanceLessThan && report.attPercents >= reportParams.attendanceLessThan; | ||
| const failsGradesLimit = reportParams.gradesLessThan && report.gradeAvg >= reportParams.gradesLessThan; | ||
|
|
||
| if (reportParams.attendanceLessThan && reportParams.gradesLessThan) { | ||
| const passesLimits = reportParams.limitFilterUseOr | ||
| ? !failsAttendanceLimit || !failsGradesLimit | ||
| : !failsAttendanceLimit && !failsGradesLimit; | ||
| if (!passesLimits) { | ||
| return false; | ||
| } | ||
| } else if (failsAttendanceLimit || failsGradesLimit) { | ||
| return false; | ||
| } |
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
attendanceLessThanandgradesLessThanwere set on the student report card ("תעודה לתלמידה"), a row had to satisfy both to be shown (AND).limitFilterUseOrtoggle so a row can be shown when it satisfies either limit instead, defaulting to the existing AND behavior so no existing reports change.BooleanInputcheckbox in the report button UI to let users choose per-report, and a roadmap entry per this repo's convention.Test plan
filterReports.Generated by Claude Code