Skip to content

Allow OR between attendance/grade limit filters in student report card - #105

Merged
buzz-code merged 3 commits into
mainfrom
claude/report-card-filter-logic-oxz5pn
Jul 7, 2026
Merged

buzz-code merged 3 commits into
mainfrom
claude/report-card-filter-logic-oxz5pn

Conversation

@buzz-code

Copy link
Copy Markdown
Owner

Summary

  • Previously, when both attendanceLessThan and gradesLessThan were set on the student report card ("תעודה לתלמידה"), a row had to satisfy both to be shown (AND).
  • Added a limitFilterUseOr toggle so a row can be shown when it satisfies either limit instead, defaulting to the existing AND behavior so no existing reports change.
  • Added a BooleanInput checkbox in the report button UI to let users choose per-report, and a roadmap entry per this repo's convention.

Test plan

  • Verified the new filter logic (AND default, OR opt-in, single-filter, no-filter cases) against a standalone simulation of filterReports.
  • Manual smoke test of the "תעודה לתלמידה" report with both limits filled, toggling the new checkbox.

Generated by Claude Code

claude added 3 commits July 7, 2026 14:23
…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.
Copilot AI review requested due to automatic review settings July 7, 2026 14:58
@buzz-code
buzz-code merged commit fd0ac0b into main Jul 7, 2026

Copilot AI left a comment

Copy link
Copy Markdown

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 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 limitFilterUseOr to student report card report params and plumbed it through the server report generator.
  • Updated filterReports to 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;
}
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.

3 participants