From 82656a4150bc9e9908079b3b0881e9f08e5631cc Mon Sep 17 00:00:00 2001 From: yaely20 <145603125+yaely20@users.noreply.github.com> Date: Tue, 6 Jan 2026 21:15:50 +0000 Subject: [PATCH 1/3] enable teacher reports access in sidebar and routes --- client/src/App.jsx | 4 ++++ client/src/GeneralLayout.jsx | 2 +- .../percent-report-with-dates-list.jsx | 15 +++++++++++++++ .../TeacherView/student-att-endance-list.jsx | 15 +++++++++++++++ .../src/entities/att-report-with-report-month.jsx | 4 ++-- client/src/pivots/PercentReportWithDatesList.jsx | 3 ++- 6 files changed, 39 insertions(+), 4 deletions(-) create mode 100644 client/src/components/TeacherView/percent-report-with-dates-list.jsx create mode 100644 client/src/components/TeacherView/student-att-endance-list.jsx diff --git a/client/src/App.jsx b/client/src/App.jsx index 96a3b5ca..d7bf11ed 100644 --- a/client/src/App.jsx +++ b/client/src/App.jsx @@ -25,6 +25,8 @@ import { resourceEntityGuesser } from '@shared/components/crudContainers/EntityG import attReport from "src/entities/att-report"; import attReportWithReportMonth from './entities/att-report-with-report-month'; import teacherAttReportList from 'src/components/TeacherView/taecher-att-report-list'; +import TeacherPercentReportWithDatesList from 'src/components/TeacherView/percent-report-with-dates-list'; +import TeacherStudentAttendanceList from 'src/components/TeacherView/student-att-endance-list'; import grade from "src/entities/grade"; import klass from "src/entities/klass"; import klassType from "src/entities/klass-type"; @@ -136,6 +138,8 @@ const App = () => ( } /> } /> + } /> + } /> ); diff --git a/client/src/GeneralLayout.jsx b/client/src/GeneralLayout.jsx index 1f76075e..696ae83b 100644 --- a/client/src/GeneralLayout.jsx +++ b/client/src/GeneralLayout.jsx @@ -45,7 +45,7 @@ const menuGroups = [ } /> ] }), - ({ permissions }) => (isStandardView(permissions)) && ({ + ({ permissions }) => ((isStandardView(permissions)) || (isTeacherView(permissions))) && ({ name: 'report', icon: , routes: [ } />, } />, diff --git a/client/src/components/TeacherView/percent-report-with-dates-list.jsx b/client/src/components/TeacherView/percent-report-with-dates-list.jsx new file mode 100644 index 00000000..24c7a33a --- /dev/null +++ b/client/src/components/TeacherView/percent-report-with-dates-list.jsx @@ -0,0 +1,15 @@ +import PercentReportWithDatesList from 'src/pivots/PercentReportWithDatesList'; +import { TeacherGuard } from 'src/components/TeacherView/TeacherAccess.jsx'; +import { useObjectStore } from 'src/utils/storeUtil'; + +const TeacherPercentReportWithDatesList = (props) => { + const { value: teacher } = useObjectStore('teacher'); + const teacherFilter = { + teacherReferenceId: teacher?.id + }; + + return ; + + +} +export default TeacherPercentReportWithDatesList; diff --git a/client/src/components/TeacherView/student-att-endance-list.jsx b/client/src/components/TeacherView/student-att-endance-list.jsx new file mode 100644 index 00000000..4832c8e6 --- /dev/null +++ b/client/src/components/TeacherView/student-att-endance-list.jsx @@ -0,0 +1,15 @@ +import StudentAttendanceList from 'src/pivots/StudentAttendanceList.jsx'; +import { TeacherGuard } from 'src/components/TeacherView/TeacherAccess.jsx'; +import { useObjectStore } from 'src/utils/storeUtil'; + +const TeacherStudentAttendanceList = (props) => { + const { value: teacher } = useObjectStore('teacher'); + const teacherFilter = { + teacherReferenceId: teacher?.id + }; + + return ; + + +} +export default TeacherStudentAttendanceList; diff --git a/client/src/entities/att-report-with-report-month.jsx b/client/src/entities/att-report-with-report-month.jsx index f5779f0c..9c9fc15f 100644 --- a/client/src/entities/att-report-with-report-month.jsx +++ b/client/src/entities/att-report-with-report-month.jsx @@ -13,7 +13,7 @@ import { CommonHebrewDateField } from '@shared/components/fields/CommonHebrewDat import { BulkActionButton } from '@shared/components/crudContainers/BulkActionButton'; import { BulkFixReferenceButton } from '@shared/components/crudContainers/BulkFixReferenceButton'; import { commonAdminFilters } from '@shared/components/fields/PermissionFilter'; -import { useIsLessonSignature } from 'src/utils/appPermissions'; +import { useIsLessonSignature, isTeacherView } from 'src/utils/appPermissions'; const filters = [ ...commonAdminFilters, @@ -22,7 +22,7 @@ const filters = [ , , , - , + ({ permissions }) => !isTeacherView(permissions) && (), , , , diff --git a/client/src/pivots/PercentReportWithDatesList.jsx b/client/src/pivots/PercentReportWithDatesList.jsx index 896fb2d6..d26dd659 100644 --- a/client/src/pivots/PercentReportWithDatesList.jsx +++ b/client/src/pivots/PercentReportWithDatesList.jsx @@ -7,6 +7,7 @@ import { defaultYearFilter, yearChoices } from '@shared/utils/yearFilter'; import { ShowMatchingRecordsButton } from '@shared/components/fields/ShowMatchingRecordsButton'; import CommonAutocompleteInput from '@shared/components/fields/CommonAutocompleteInput'; import { adminUserFilter } from '@shared/components/fields/PermissionFilter'; +import { isTeacherView } from 'src/utils/appPermissions'; const filters = [ adminUserFilter, @@ -16,7 +17,7 @@ const filters = [ , , , - , + ({ permissions }) => !isTeacherView(permissions) && (), , , , From feeba3403cc2a77eea4b93a5816f682404c5edb0 Mon Sep 17 00:00:00 2001 From: yaely20 <145603125+yaely20@users.noreply.github.com> Date: Wed, 7 Jan 2026 06:56:33 +0000 Subject: [PATCH 2/3] Correcting spelling and spacing errors --- client/src/App.jsx | 4 ++-- client/src/GeneralLayout.jsx | 2 +- .../percent-report-with-dates-list.jsx | 24 ++++++++++--------- .../TeacherView/student-att-endance-list.jsx | 15 ------------ .../TeacherView/student-attendance-list.jsx | 17 +++++++++++++ .../TeacherView/taecher-att-report-list.jsx | 24 ++++++++++--------- 6 files changed, 46 insertions(+), 40 deletions(-) delete mode 100644 client/src/components/TeacherView/student-att-endance-list.jsx create mode 100644 client/src/components/TeacherView/student-attendance-list.jsx diff --git a/client/src/App.jsx b/client/src/App.jsx index d7bf11ed..789a4fb4 100644 --- a/client/src/App.jsx +++ b/client/src/App.jsx @@ -26,7 +26,7 @@ import attReport from "src/entities/att-report"; import attReportWithReportMonth from './entities/att-report-with-report-month'; import teacherAttReportList from 'src/components/TeacherView/taecher-att-report-list'; import TeacherPercentReportWithDatesList from 'src/components/TeacherView/percent-report-with-dates-list'; -import TeacherStudentAttendanceList from 'src/components/TeacherView/student-att-endance-list'; +import TeacherStudentAttendanceList from 'src/components/TeacherView/student-attendance-list'; import grade from "src/entities/grade"; import klass from "src/entities/klass"; import klassType from "src/entities/klass-type"; @@ -139,7 +139,7 @@ const App = () => ( } /> } /> } /> - } /> + } /> ); diff --git a/client/src/GeneralLayout.jsx b/client/src/GeneralLayout.jsx index 696ae83b..70c93b94 100644 --- a/client/src/GeneralLayout.jsx +++ b/client/src/GeneralLayout.jsx @@ -45,7 +45,7 @@ const menuGroups = [ } /> ] }), - ({ permissions }) => ((isStandardView(permissions)) || (isTeacherView(permissions))) && ({ + ({ permissions }) => ((!isInLessonReport(permissions)) || (isTeacherView(permissions))) && ({ name: 'report', icon: , routes: [ } />, } />, diff --git a/client/src/components/TeacherView/percent-report-with-dates-list.jsx b/client/src/components/TeacherView/percent-report-with-dates-list.jsx index 24c7a33a..74a15430 100644 --- a/client/src/components/TeacherView/percent-report-with-dates-list.jsx +++ b/client/src/components/TeacherView/percent-report-with-dates-list.jsx @@ -1,15 +1,17 @@ -import PercentReportWithDatesList from 'src/pivots/PercentReportWithDatesList'; -import { TeacherGuard } from 'src/components/TeacherView/TeacherAccess.jsx'; -import { useObjectStore } from 'src/utils/storeUtil'; +import PercentReportWithDatesList from "src/pivots/PercentReportWithDatesList"; +import { TeacherGuard } from "src/components/TeacherView/TeacherAccess.jsx"; +import { useObjectStore } from "src/utils/storeUtil"; const TeacherPercentReportWithDatesList = (props) => { - const { value: teacher } = useObjectStore('teacher'); - const teacherFilter = { - teacherReferenceId: teacher?.id - }; + const { value: teacher } = useObjectStore("teacher"); + const teacherFilter = { + teacherReferenceId: teacher?.id, + }; - return ; - - -} + return ( + + + + ); +}; export default TeacherPercentReportWithDatesList; diff --git a/client/src/components/TeacherView/student-att-endance-list.jsx b/client/src/components/TeacherView/student-att-endance-list.jsx deleted file mode 100644 index 4832c8e6..00000000 --- a/client/src/components/TeacherView/student-att-endance-list.jsx +++ /dev/null @@ -1,15 +0,0 @@ -import StudentAttendanceList from 'src/pivots/StudentAttendanceList.jsx'; -import { TeacherGuard } from 'src/components/TeacherView/TeacherAccess.jsx'; -import { useObjectStore } from 'src/utils/storeUtil'; - -const TeacherStudentAttendanceList = (props) => { - const { value: teacher } = useObjectStore('teacher'); - const teacherFilter = { - teacherReferenceId: teacher?.id - }; - - return ; - - -} -export default TeacherStudentAttendanceList; diff --git a/client/src/components/TeacherView/student-attendance-list.jsx b/client/src/components/TeacherView/student-attendance-list.jsx new file mode 100644 index 00000000..91fbe5b6 --- /dev/null +++ b/client/src/components/TeacherView/student-attendance-list.jsx @@ -0,0 +1,17 @@ +import StudentAttendanceList from "src/pivots/StudentAttendanceList.jsx"; +import { TeacherGuard } from "src/components/TeacherView/TeacherAccess.jsx"; +import { useObjectStore } from "src/utils/storeUtil"; + +const TeacherStudentAttendanceList = (props) => { + const { value: teacher } = useObjectStore("teacher"); + const teacherFilter = { + teacherReferenceId: teacher?.id, + }; + + return ( + + + + ); +}; +export default TeacherStudentAttendanceList; diff --git a/client/src/components/TeacherView/taecher-att-report-list.jsx b/client/src/components/TeacherView/taecher-att-report-list.jsx index bb95adaa..08cbd3ae 100644 --- a/client/src/components/TeacherView/taecher-att-report-list.jsx +++ b/client/src/components/TeacherView/taecher-att-report-list.jsx @@ -1,17 +1,19 @@ -import attReport from '../../entities/att-report-with-report-month.jsx'; -import { TeacherGuard } from 'src/components/TeacherView/TeacherAccess.jsx'; -import { useObjectStore } from 'src/utils/storeUtil'; +import attReport from "../../entities/att-report-with-report-month.jsx"; +import { TeacherGuard } from "src/components/TeacherView/TeacherAccess.jsx"; +import { useObjectStore } from "src/utils/storeUtil"; const BaseList = attReport.list; const teacherAttReportList = (props) => { - const { value: teacher } = useObjectStore('teacher'); - const teacherFilter = { - teacherReferenceId: teacher?.id - }; + const { value: teacher } = useObjectStore("teacher"); + const teacherFilter = { + teacherReferenceId: teacher?.id, + }; - return ; - - -} + return ( + + + + ); +}; export default { list: teacherAttReportList }; From edcd5b65322a7a4aa3d7ba13166b19064fa130be Mon Sep 17 00:00:00 2001 From: yaely20 <145603125+yaely20@users.noreply.github.com> Date: Wed, 7 Jan 2026 13:12:55 +0000 Subject: [PATCH 3/3] change permissions --- client/src/GeneralLayout.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/src/GeneralLayout.jsx b/client/src/GeneralLayout.jsx index 70c93b94..3a1330bf 100644 --- a/client/src/GeneralLayout.jsx +++ b/client/src/GeneralLayout.jsx @@ -45,8 +45,8 @@ const menuGroups = [ } /> ] }), - ({ permissions }) => ((!isInLessonReport(permissions)) || (isTeacherView(permissions))) && ({ - name: 'report', icon: , routes: [ + ({ permissions }) => !isOnlyInLessonReport(permissions) && ({ + name: 'report', icon: , routes: [ } />, } />, ]