From 8228eb630769f3c00f64295c80ccad57752f03f6 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 7 Jul 2026 14:23:49 +0000 Subject: [PATCH 1/3] Allow choosing OR instead of AND between attendance/grade limit filters 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. --- .../reports/studentReportCardReactButton.jsx | 6 +++++- client/src/roadmapFeatures.js | 1 + server/src/reports/reportGenerator.ts | 1 + server/src/reports/studentReportCardReact.tsx | 17 +++++++++++++---- 4 files changed, 20 insertions(+), 5 deletions(-) diff --git a/client/src/reports/studentReportCardReactButton.jsx b/client/src/reports/studentReportCardReactButton.jsx index 620e0d72..bcf6cddf 100644 --- a/client/src/reports/studentReportCardReactButton.jsx +++ b/client/src/reports/studentReportCardReactButton.jsx @@ -1,4 +1,4 @@ -import { TextInput, DateInput, NumberInput } from 'react-admin'; +import { TextInput, DateInput, NumberInput, BooleanInput } from 'react-admin'; import { defaultYearFilter } from '@shared/utils/yearFilter'; import { CommonYearInput } from '@shared/components/fields/CommonYear'; import NoteAltIcon from '@mui/icons-material/NoteAlt'; @@ -45,6 +45,10 @@ export default ({ defaultRequestValues }) => { label="הצג רק שורות עם ציון נמוך מ (%)" helperText="הסינון מתבצע לפי הציון המקורי, לפני התאמה לפי אחוזי נוכחות" /> + ); }; diff --git a/client/src/roadmapFeatures.js b/client/src/roadmapFeatures.js index aea29bc7..f7cb2696 100644 --- a/client/src/roadmapFeatures.js +++ b/client/src/roadmapFeatures.js @@ -22,6 +22,7 @@ export default [ { html: 'הוספת אפשרות לדיווח נוכחות סמינר בטלפון', status: 'בוצע', statusColor: 'success' }, { html: 'הוספת אפשרות לעדכון מספר טלפון בהגדרות', status: 'בוצע', statusColor: 'success' }, { html: 'העלאת קובץ אקסל של מערכת שעות וזיהוי אוטומטי של השיעור בדיווח נוכחות בטלפון', status: 'בוצע', statusColor: 'success' }, + { html: 'אפשרות לבחור בין "וגם" ל"או" בין סינון נוכחות וציון בתעודה', status: 'בוצע', statusColor: 'success' }, // { html: 'הגדרת תקופת זמן לפי תאריכים', status: 'בקרוב', statusColor: 'warning' }, // { html: 'הגדרת תקופת זמן לפי יום בשבוע', status: 'בוצע', statusColor: 'success' }, diff --git a/server/src/reports/reportGenerator.ts b/server/src/reports/reportGenerator.ts index b389e19a..3f0fa492 100644 --- a/server/src/reports/reportGenerator.ts +++ b/server/src/reports/reportGenerator.ts @@ -33,6 +33,7 @@ export function generateStudentReportCard(userId: any, reqExtra: any, generator: debug: getAsBoolean(reqExtra.debug), attendanceLessThan: getPercentLessThanParam(reqExtra.attendanceLessThan), gradesLessThan: getPercentLessThanParam(reqExtra.gradesLessThan), + limitFilterUseOr: getAsBoolean(reqExtra.limitFilterUseOr), }; console.log('student report card extra params: ', extraParams); const params = getAsArray(reqExtra.ids)?.map((id) => ({ diff --git a/server/src/reports/studentReportCardReact.tsx b/server/src/reports/studentReportCardReact.tsx index 83caccdf..19a940cb 100644 --- a/server/src/reports/studentReportCardReact.tsx +++ b/server/src/reports/studentReportCardReact.tsx @@ -499,6 +499,7 @@ export interface IReportParams { debug?: boolean; attendanceLessThan?: number; gradesLessThan?: number; + limitFilterUseOr?: boolean; } export const getReportData: IGetReportDataFunction = async (params, dataSource) => { const reportDate = getReportDateFilter(dateFromString(params.startDate), dateFromString(params.endDate)); @@ -613,12 +614,20 @@ function getReports( function filterReports(reports: IExtenedStudentPercentReport[], reportParams: IReportParams): AppProps['reports'][number]['reports'] { return reports.filter(report => { - if (reportParams.attendanceLessThan && (report.attPercents >= reportParams.attendanceLessThan)) { - return false; - } - if (reportParams.gradesLessThan && (report.gradeAvg >= reportParams.gradesLessThan)) { + 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; } + return !( (reportParams.forceGrades && (report.gradeAvg === undefined || report.gradeAvg === null)) || (reportParams.forceAtt && !report.lessonsCount) From b7af386438e9b634f04fc46264f18ec1146a2da5 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 7 Jul 2026 14:45:39 +0000 Subject: [PATCH 2/3] Explicitly disable generic importer on lesson schedule page Keeps only the dedicated LessonScheduleImportButton (Excel upload with Yemot auto-detect) in the list actions. --- client/src/entities/lesson-schedule.jsx | 1 + 1 file changed, 1 insertion(+) diff --git a/client/src/entities/lesson-schedule.jsx b/client/src/entities/lesson-schedule.jsx index edd62266..97125b62 100644 --- a/client/src/entities/lesson-schedule.jsx +++ b/client/src/entities/lesson-schedule.jsx @@ -112,6 +112,7 @@ const entity = { Representation, filters, filterDefaultValues, + importer: false, additionalListActions, }; From 5db9edfe5855bfb1acfa645e75ec1dbf467cb8c7 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 7 Jul 2026 14:47:33 +0000 Subject: [PATCH 3/3] Revert "Explicitly disable generic importer on lesson schedule page" This reverts commit b7af386438e9b634f04fc46264f18ec1146a2da5. --- client/src/entities/lesson-schedule.jsx | 1 - 1 file changed, 1 deletion(-) diff --git a/client/src/entities/lesson-schedule.jsx b/client/src/entities/lesson-schedule.jsx index 97125b62..edd62266 100644 --- a/client/src/entities/lesson-schedule.jsx +++ b/client/src/entities/lesson-schedule.jsx @@ -112,7 +112,6 @@ const entity = { Representation, filters, filterDefaultValues, - importer: false, additionalListActions, };