From 7a704fdf291d75398abe1f428959587d6396f251 Mon Sep 17 00:00:00 2001 From: HadasaSchechterV <100204928+HadasaSchechterV@users.noreply.github.com> Date: Tue, 30 Jun 2026 19:39:13 +0300 Subject: [PATCH] feat: add bulk button to change att-report teacher Mirrors the existing bulk "change klass" button on att-report-with-report-month. --- client/src/entities/att-report-with-report-month.jsx | 12 ++++++++++++ .../att-report-with-report-month.config.ts | 11 +++++++++++ 2 files changed, 23 insertions(+) diff --git a/client/src/entities/att-report-with-report-month.jsx b/client/src/entities/att-report-with-report-month.jsx index 43a4b28b..45afe1e8 100644 --- a/client/src/entities/att-report-with-report-month.jsx +++ b/client/src/entities/att-report-with-report-month.jsx @@ -14,6 +14,7 @@ import { import PlaylistRemoveIcon from '@mui/icons-material/PlaylistRemove'; import HelpIcon from '@mui/icons-material/Help'; import ClassIcon from '@mui/icons-material/Class'; +import PersonIcon from '@mui/icons-material/Person'; import { CommonDatagrid } from '@shared/components/crudContainers/CommonList'; import { MultiReferenceField } from '@shared/components/fields/CommonReferenceField'; import { getResourceComponents } from '@shared/components/crudContainers/CommonEntity'; @@ -81,6 +82,17 @@ export const Datagrid = ({ isAdmin, children, ...props }) => { {isAdmin && } , + } + name="bulkChangeTeacher" + key="bulkChangeTeacher" + reloadOnEnd + > + {isAdmin && } + {isAdmin && } + + , } name="bulkKnownAbsences"> diff --git a/server/src/entity-modules/att-report-with-report-month.config.ts b/server/src/entity-modules/att-report-with-report-month.config.ts index 61e9de84..20a0bf8a 100644 --- a/server/src/entity-modules/att-report-with-report-month.config.ts +++ b/server/src/entity-modules/att-report-with-report-month.config.ts @@ -116,6 +116,8 @@ class AttReportWithReportMonthService { + const ids = getAsNumberArray(extra.ids); + if (!ids || ids.length === 0) return 'לא נבחרו רשומות'; + const teacherReferenceId = getAsNumber(extra.teacherReferenceId); + if (!teacherReferenceId) return 'לא נבחר מורה'; + const result = await this.dataSource.getRepository(AttReport).update({ id: In(ids) }, { teacherReferenceId }); + return `עודכנו ${result.affected} רשומות`; + } + private async bulkKnownAbsences(extra: any): Promise { const ids = getAsArray(extra.ids); if (!ids) return 'לא נבחרו רשומות';