From 239d7a662d72753b6242ca0ec46b6b10bae4a21d Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 24 Jul 2026 08:51:04 +0000 Subject: [PATCH 1/2] Add per-date lesson count, sticky attendance table, lesson name column - Per-date "howManyLessons" override in attendance form, gated behind new perDateLessonCount permission; falls back to shared value. - Fix attendance table sticky header/first column not actually sticking (TableContainer had no bounded height, so position:sticky never engaged) by bounding maxHeight and pinning the student-name column. - Restore lesson name column in sessions summary report (data was already fetched, just commented out in the render). --- .../reports/in-lesson-report/StudentList.jsx | 34 +++++++++++++++---- client/src/reports/in-lesson-report/index.jsx | 2 +- client/src/utils/appPermissions.js | 5 +++ .../reports/reportGroupSessionsSummary.tsx | 4 +-- 4 files changed, 36 insertions(+), 9 deletions(-) diff --git a/client/src/reports/in-lesson-report/StudentList.jsx b/client/src/reports/in-lesson-report/StudentList.jsx index fa73cd49..801f48a8 100644 --- a/client/src/reports/in-lesson-report/StudentList.jsx +++ b/client/src/reports/in-lesson-report/StudentList.jsx @@ -24,7 +24,7 @@ import DeleteIcon from '@mui/icons-material/Delete'; import { CommonSliderInput } from '../../../shared/components/fields/CommonSliderInput'; import { ReportContext } from './context'; import { CommonHebrewDateField } from '@shared/components/fields/CommonHebrewDateField'; -import { useIsLessonSignature } from 'src/utils/appPermissions'; +import { useIsLessonSignature, useIsPerDateLessonCount } from 'src/utils/appPermissions'; export const getDefaultReportDate = () => new Date().toISOString().split('T')[0]; @@ -32,6 +32,7 @@ export const StudentList = ({ reportDates, setReportDates }) => { const { gradeMode, isShowLate, students } = useContext(ReportContext); const record = useRecordContext(); const hasLessonSignaturePermission = useIsLessonSignature(); + const hasPerDateLessonCountPermission = useIsPerDateLessonCount(); const today = useMemo(() => new Date().toISOString().split('T')[0], []); const columns = useMemo(() => { @@ -75,11 +76,11 @@ export const StudentList = ({ reportDates, setReportDates }) => { ); return ( - + - + {reportDates.map((date, index) => ( @@ -110,6 +111,16 @@ export const StudentList = ({ reportDates, setReportDates }) => { )} + {!gradeMode && hasPerDateLessonCountPermission && ( + + )} + {hasLessonSignaturePermission && ( <> { ))} - + שם התלמידה {reportDates.map((date, index) => @@ -153,7 +164,14 @@ export const StudentList = ({ reportDates, setReportDates }) => { .filter((student) => student.student) .map((student) => ( - + {student.student.name} {reportDates.map((date, index) => ( @@ -162,7 +180,11 @@ export const StudentList = ({ reportDates, setReportDates }) => { index={index} columns={columns} studentId={student.student.id} - lessonCount={record.howManyLessons} + lessonCount={ + (hasPerDateLessonCountPermission && + record.lessonDetails?.[index]?.howManyLessons) || + record.howManyLessons + } /> ))} diff --git a/client/src/reports/in-lesson-report/index.jsx b/client/src/reports/in-lesson-report/index.jsx index 36edd360..8b17b048 100644 --- a/client/src/reports/in-lesson-report/index.jsx +++ b/client/src/reports/in-lesson-report/index.jsx @@ -100,7 +100,7 @@ export const InLessonReport = ({ newEntry.grade = rest[studentId]?.[`grade_${index}`] ?? 0; newEntry.comments = rest[studentId]?.[`comments_${index}`] ?? ''; } else { - newEntry.howManyLessons = howManyLessons; + newEntry.howManyLessons = lessonDetails?.[index]?.howManyLessons ?? howManyLessons; newEntry.absCount = round( (rest[studentId]?.[`absence_${index}`] ?? 0) + (rest[studentId]?.[`late_${index}`] ?? 0) * lateValue, diff --git a/client/src/utils/appPermissions.js b/client/src/utils/appPermissions.js index 00c7f290..e8101617 100644 --- a/client/src/utils/appPermissions.js +++ b/client/src/utils/appPermissions.js @@ -16,6 +16,7 @@ export const appPermissions = { studentAttendanceByKlass: 'studentAttendanceByKlass', seminarAttendanceYemot: 'seminarAttendanceYemot', lessonSchedule: 'lessonSchedule', + perDateLessonCount: 'perDateLessonCount', }; export const isScannerUpload = (permissions) => hasPermissionLogic(permissions, appPermissions.scannerUpload); @@ -71,3 +72,7 @@ export const useIsSeminarAttendanceYemot = () => useHasPermission(appPermissions export const isLessonSchedule = (permissions) => isAdmin(permissions) || hasPermissionLogic(permissions, appPermissions.lessonSchedule); export const useIsLessonSchedule = () => useHasPermission(appPermissions.lessonSchedule); + +export const isPerDateLessonCount = (permissions) => + isAdmin(permissions) || hasPermissionLogic(permissions, appPermissions.perDateLessonCount); +export const useIsPerDateLessonCount = () => useHasPermission(appPermissions.perDateLessonCount); diff --git a/server/src/reports/reportGroupSessionsSummary.tsx b/server/src/reports/reportGroupSessionsSummary.tsx index 2caa4c5e..5f18ca7e 100644 --- a/server/src/reports/reportGroupSessionsSummary.tsx +++ b/server/src/reports/reportGroupSessionsSummary.tsx @@ -194,7 +194,7 @@ const SessionsSummaryReport: React.FC = (props) - {/* */} + {!isSingleKlass && } @@ -205,7 +205,7 @@ const SessionsSummaryReport: React.FC = (props) - {/* */} + {!isSingleKlass && }
תאריך נושאשיעורשיעורכיתהמספר שיעורים חתימת מורה
{formatDate(session.date)} {session.topic || '-'}{session.lessonName || '-'}{session.lessonName || '-'}{session.klassName || '-'}{session.lessonCount} From 900a6d0d3ebd59a237f46cc88a13e9cc0e4238ff Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 24 Jul 2026 09:07:59 +0000 Subject: [PATCH 2/2] Use logical CSS property for sticky column to support RTL and LTR left:0 only pins the column to the physical left edge, which is wrong in RTL layouts where the name column sits on the right. insetInlineStart resolves to the correct physical side per the active theme direction. --- client/src/reports/in-lesson-report/StudentList.jsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/src/reports/in-lesson-report/StudentList.jsx b/client/src/reports/in-lesson-report/StudentList.jsx index 801f48a8..3bed3b42 100644 --- a/client/src/reports/in-lesson-report/StudentList.jsx +++ b/client/src/reports/in-lesson-report/StudentList.jsx @@ -80,7 +80,7 @@ export const StudentList = ({ reportDates, setReportDates }) => { - + {reportDates.map((date, index) => ( @@ -146,7 +146,7 @@ export const StudentList = ({ reportDates, setReportDates }) => { ))} - + שם התלמידה {reportDates.map((date, index) => @@ -167,7 +167,7 @@ export const StudentList = ({ reportDates, setReportDates }) => {