Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions client/src/entities/student.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ const filterDefaultValues = {
};

const additionalBulkButtons = [
// <BulkReportButton label='תעודה לתלמידה' icon={<NoteAltIcon />}
// key='studentReportCard' name='studentReportCard' filename='תעודה' />,
<StudentReportCardReactButton key="studentReportCardReact" defaultRequestValues={filterDefaultValues} />,
<BulkActionButton
label="סימון פעיל/לא פעיל"
Expand Down
5 changes: 5 additions & 0 deletions client/src/reports/studentReportCardReactButton.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ export default ({ defaultRequestValues }) => {
reference="lesson"
label="שיעורים שלא ייכללו בתעודה"
/>
<CommonReferenceArrayInput
source="denyKlassReferenceIds"
reference="klass"
label="כיתות שלא ייכללו בתעודה"
/>
<CommonReferenceInput source="klassTypeReferenceId" reference="klass_type" label="שיוך כיתה" />
<TextInput source="personalNote" label="הערה לתלמידה" defaultValue="" />
<NumberInput source="attendanceLessThan" label="הצג רק שורות עם נוכחות נמוכה מ (%)" />
Expand Down
3 changes: 1 addition & 2 deletions project-index.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,7 @@

### Reports
- `/server/src/reports/reportGenerator.ts` - Report generation functionality
- `/server/src/reports/studentReportCard.ts` - Student report card generation
- `/server/src/reports/studentReportCardReact.tsx` - React version of student report cards
- `/server/src/reports/studentReportCardReact.tsx` - Student report card generation
- `/server/src/reports/teacherReportFile.ts` - Teacher report file generation
- `/server/src/reports/michlolPopulatedFile.ts` - Michlol populated file generation

Expand Down
23 changes: 0 additions & 23 deletions server/src/entity-modules/__tests__/student-klass.config.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,29 +171,6 @@ describe('StudentKlassConfig', () => {
});

describe('getReportData', () => {
it('should handle studentReportCard report type', async () => {
const req = {
...createMockCrudRequest({
report: 'studentReportCard',
ids: '1,2,3',
}),
auth: { id: 1 },
};

mockRepository.find.mockResolvedValueOnce([
createMockStudentKlass({ studentReferenceId: 101 }),
createMockStudentKlass({ studentReferenceId: 102 }),
createMockStudentKlass({ studentReferenceId: 103 }),
]);

await service.getReportData(req);

expect(mockRepository.find).toHaveBeenCalledWith({
where: { id: In([1, 2, 3]) },
select: { studentReferenceId: true },
});
});

it('should handle studentReportCardReact report type', async () => {
const req = {
...createMockCrudRequest({
Expand Down
4 changes: 1 addition & 3 deletions server/src/entity-modules/__tests__/student.config.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ describe('StudentConfig', () => {
// Properly type the service to include reportsDict
let service: BaseEntityService<Student> & {
reportsDict: {
studentReportCard: BulkToPdfReportGenerator;
studentReportCardReact: BulkToPdfReportGenerator;
};
};
Expand Down Expand Up @@ -121,14 +120,13 @@ describe('StudentConfig', () => {

it('should initialize reports dictionary', () => {
expect(service.reportsDict).toEqual({
studentReportCard: expect.any(BulkToPdfReportGenerator),
studentReportCardReact: expect.any(BulkToPdfReportGenerator),
});
});

describe('getReportData', () => {
const mockUserId = '123';
const mockExtra = { report: 'studentReportCard', someOption: 'value' };
const mockExtra = { report: 'studentReportCardReact', someOption: 'value' };
const mockReq = {
auth: { someAuth: true },
parsed: {
Expand Down
2 changes: 0 additions & 2 deletions server/src/entity-modules/student-klass-report.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { BaseEntityService } from '@shared/base-entity/base-entity.service';
import { BaseEntityModuleOptions, Entity } from '@shared/base-entity/interface';
import { StudentKlassReport } from 'src/db/view-entities/StudentKlassReport.entity';
import { CommonReportData } from '@shared/utils/report/types';
import studentReportCard from '../reports/studentReportCard';
import { BulkToPdfReportGenerator } from '@shared/utils/report/bulk-to-pdf.generator';
import studentReportCardReact from 'src/reports/studentReportCardReact';
import { generateStudentReportCard } from 'src/reports/reportGenerator';
Expand Down Expand Up @@ -45,7 +44,6 @@ function getConfig(): BaseEntityModuleOptions {

class StudentKlassReportService<T extends Entity | StudentKlassReport> extends BaseEntityService<T> {
reportsDict = {
studentReportCard: new BulkToPdfReportGenerator(studentReportCard),
studentReportCardReact: new BulkToPdfReportGenerator(studentReportCardReact),
};
async getReportData(req: CrudRequest<any, any>): Promise<CommonReportData> {
Expand Down
2 changes: 0 additions & 2 deletions server/src/entity-modules/student-klass.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { BulkToPdfReportGenerator } from '@shared/utils/report/bulk-to-pdf.gener
import { CommonReportData } from '@shared/utils/report/types';
import { StudentKlass } from 'src/db/entities/StudentKlass.entity';
import { generateStudentReportCard } from 'src/reports/reportGenerator';
import studentReportCard from 'src/reports/studentReportCard';
import studentReportCardReact from 'src/reports/studentReportCardReact';
import { fixReferences } from '@shared/utils/entity/fixReference.util';
import { getAsNumberArray } from '@shared/utils/queryParam.util';
Expand Down Expand Up @@ -45,7 +44,6 @@ function getConfig(): BaseEntityModuleOptions {

class StudentKlassService<T extends Entity | StudentKlass> extends BaseEntityService<T> {
reportsDict = {
studentReportCard: new BulkToPdfReportGenerator(studentReportCard),
studentReportCardReact: new BulkToPdfReportGenerator(studentReportCardReact),
};
async getReportData(req: CrudRequest<any, any>): Promise<CommonReportData> {
Expand Down
2 changes: 0 additions & 2 deletions server/src/entity-modules/student.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { IHeader } from '@shared/utils/exporter/types';
import { getHebrewBooleanFormatter } from '@shared/utils/formatting/formatter.util';
import { Student } from 'src/db/entities/Student.entity';
import { CommonReportData } from '@shared/utils/report/types';
import studentReportCard from '../reports/studentReportCard';
import { BulkToPdfReportGenerator } from '@shared/utils/report/bulk-to-pdf.generator';
import studentReportCardReact from 'src/reports/studentReportCardReact';
import { getUserIdFromUser } from '@shared/auth/auth.util';
Expand Down Expand Up @@ -34,7 +33,6 @@ function getConfig(): BaseEntityModuleOptions {

class StudentService<T extends Entity | Student> extends BaseEntityService<T> {
reportsDict = {
studentReportCard: new BulkToPdfReportGenerator(studentReportCard),
studentReportCardReact: new BulkToPdfReportGenerator(studentReportCardReact),
};
async getReportData(req: CrudRequest<any, any>): Promise<CommonReportData> {
Expand Down
1 change: 1 addition & 0 deletions server/src/reports/reportGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export function generateStudentReportCard(userId: any, reqExtra: any, generator:
endDate: getAsString(reqExtra.endDate),
globalLessonReferenceIds: getAsString(reqExtra.globalLessonReferenceIds),
denyLessonReferenceIds: getAsString(reqExtra.denyLessonReferenceIds),
denyKlassReferenceIds: getAsString(reqExtra.denyKlassReferenceIds),
klassTypeReferenceId: getAsString(reqExtra.klassTypeReferenceId),
attendance: getAsBoolean(reqExtra.attendance),
grades: getAsBoolean(reqExtra.grades),
Expand Down
253 changes: 0 additions & 253 deletions server/src/reports/studentReportCard.ts

This file was deleted.

Loading
Loading