@hed-hog/lms 0.0.304 → 0.0.306
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +413 -401
- package/dist/certificate/certificate.controller.d.ts +90 -0
- package/dist/certificate/certificate.controller.d.ts.map +1 -0
- package/dist/certificate/certificate.controller.js +121 -0
- package/dist/certificate/certificate.controller.js.map +1 -0
- package/dist/certificate/certificate.module.d.ts +3 -0
- package/dist/certificate/certificate.module.d.ts.map +1 -0
- package/dist/certificate/certificate.module.js +26 -0
- package/dist/certificate/certificate.module.js.map +1 -0
- package/dist/certificate/certificate.service.d.ts +115 -0
- package/dist/certificate/certificate.service.d.ts.map +1 -0
- package/dist/certificate/certificate.service.js +343 -0
- package/dist/certificate/certificate.service.js.map +1 -0
- package/dist/certificate/dto/create-certificate-template.dto.d.ts +8 -0
- package/dist/certificate/dto/create-certificate-template.dto.d.ts.map +1 -0
- package/dist/certificate/dto/create-certificate-template.dto.js +44 -0
- package/dist/certificate/dto/create-certificate-template.dto.js.map +1 -0
- package/dist/certificate/dto/update-certificate-template.dto.d.ts +6 -0
- package/dist/certificate/dto/update-certificate-template.dto.d.ts.map +1 -0
- package/dist/certificate/dto/update-certificate-template.dto.js +9 -0
- package/dist/certificate/dto/update-certificate-template.dto.js.map +1 -0
- package/dist/class-group/class-group.controller.d.ts +305 -0
- package/dist/class-group/class-group.controller.d.ts.map +1 -0
- package/dist/class-group/class-group.controller.js +257 -0
- package/dist/class-group/class-group.controller.js.map +1 -0
- package/dist/class-group/class-group.module.d.ts +3 -0
- package/dist/class-group/class-group.module.d.ts.map +1 -0
- package/dist/class-group/class-group.module.js +25 -0
- package/dist/class-group/class-group.module.js.map +1 -0
- package/dist/class-group/class-group.service.d.ts +354 -0
- package/dist/class-group/class-group.service.d.ts.map +1 -0
- package/dist/class-group/class-group.service.js +1356 -0
- package/dist/class-group/class-group.service.js.map +1 -0
- package/dist/class-group/dto/create-class-group.dto.d.ts +33 -0
- package/dist/class-group/dto/create-class-group.dto.d.ts.map +1 -0
- package/dist/class-group/dto/create-class-group.dto.js +165 -0
- package/dist/class-group/dto/create-class-group.dto.js.map +1 -0
- package/dist/class-group/dto/create-session.dto.d.ts +22 -0
- package/dist/class-group/dto/create-session.dto.d.ts.map +1 -0
- package/dist/class-group/dto/create-session.dto.js +117 -0
- package/dist/class-group/dto/create-session.dto.js.map +1 -0
- package/dist/class-group/dto/enrollment.dto.d.ts +22 -0
- package/dist/class-group/dto/enrollment.dto.d.ts.map +1 -0
- package/dist/class-group/dto/enrollment.dto.js +89 -0
- package/dist/class-group/dto/enrollment.dto.js.map +1 -0
- package/dist/class-group/dto/update-class-group.dto.d.ts +6 -0
- package/dist/class-group/dto/update-class-group.dto.d.ts.map +1 -0
- package/dist/class-group/dto/update-class-group.dto.js +9 -0
- package/dist/class-group/dto/update-class-group.dto.js.map +1 -0
- package/dist/class-group/dto/update-session.dto.d.ts +7 -0
- package/dist/class-group/dto/update-session.dto.d.ts.map +1 -0
- package/dist/class-group/dto/update-session.dto.js +24 -0
- package/dist/class-group/dto/update-session.dto.js.map +1 -0
- package/dist/course/course-structure.controller.d.ts +127 -0
- package/dist/course/course-structure.controller.d.ts.map +1 -0
- package/dist/course/course-structure.controller.js +115 -0
- package/dist/course/course-structure.controller.js.map +1 -0
- package/dist/course/course-structure.service.d.ts +142 -0
- package/dist/course/course-structure.service.d.ts.map +1 -0
- package/dist/course/course-structure.service.js +445 -0
- package/dist/course/course-structure.service.js.map +1 -0
- package/dist/course/course.controller.d.ts +195 -0
- package/dist/course/course.controller.d.ts.map +1 -0
- package/dist/course/course.controller.js +104 -0
- package/dist/course/course.controller.js.map +1 -0
- package/dist/course/course.module.d.ts +3 -0
- package/dist/course/course.module.d.ts.map +1 -0
- package/dist/course/course.module.js +28 -0
- package/dist/course/course.module.js.map +1 -0
- package/dist/course/course.service.d.ts +215 -0
- package/dist/course/course.service.d.ts.map +1 -0
- package/dist/course/course.service.js +743 -0
- package/dist/course/course.service.js.map +1 -0
- package/dist/course/dto/create-course-structure-lesson.dto.d.ts +24 -0
- package/dist/course/dto/create-course-structure-lesson.dto.d.ts.map +1 -0
- package/dist/course/dto/create-course-structure-lesson.dto.js +118 -0
- package/dist/course/dto/create-course-structure-lesson.dto.js.map +1 -0
- package/dist/course/dto/create-course-structure-session.dto.d.ts +7 -0
- package/dist/course/dto/create-course-structure-session.dto.d.ts.map +1 -0
- package/dist/course/dto/create-course-structure-session.dto.js +40 -0
- package/dist/course/dto/create-course-structure-session.dto.js.map +1 -0
- package/dist/course/dto/create-course.dto.d.ts +26 -0
- package/dist/course/dto/create-course.dto.d.ts.map +1 -0
- package/dist/course/dto/create-course.dto.js +138 -0
- package/dist/course/dto/create-course.dto.js.map +1 -0
- package/dist/course/dto/update-course-structure-lesson.dto.d.ts +6 -0
- package/dist/course/dto/update-course-structure-lesson.dto.d.ts.map +1 -0
- package/dist/course/dto/update-course-structure-lesson.dto.js +9 -0
- package/dist/course/dto/update-course-structure-lesson.dto.js.map +1 -0
- package/dist/course/dto/update-course-structure-session.dto.d.ts +6 -0
- package/dist/course/dto/update-course-structure-session.dto.d.ts.map +1 -0
- package/dist/course/dto/update-course-structure-session.dto.js +9 -0
- package/dist/course/dto/update-course-structure-session.dto.js.map +1 -0
- package/dist/course/dto/update-course.dto.d.ts +6 -0
- package/dist/course/dto/update-course.dto.d.ts.map +1 -0
- package/dist/course/dto/update-course.dto.js +9 -0
- package/dist/course/dto/update-course.dto.js.map +1 -0
- package/dist/dashboard/dashboard.controller.d.ts +101 -0
- package/dist/dashboard/dashboard.controller.d.ts.map +1 -0
- package/dist/dashboard/dashboard.controller.js +40 -0
- package/dist/dashboard/dashboard.controller.js.map +1 -0
- package/dist/dashboard/dashboard.module.d.ts +3 -0
- package/dist/dashboard/dashboard.module.d.ts.map +1 -0
- package/dist/dashboard/dashboard.module.js +25 -0
- package/dist/dashboard/dashboard.module.js.map +1 -0
- package/dist/dashboard/dashboard.service.d.ts +130 -0
- package/dist/dashboard/dashboard.service.d.ts.map +1 -0
- package/dist/dashboard/dashboard.service.js +626 -0
- package/dist/dashboard/dashboard.service.js.map +1 -0
- package/dist/enterprise/dto/add-enterprise-class-group.dto.d.ts +4 -0
- package/dist/enterprise/dto/add-enterprise-class-group.dto.d.ts.map +1 -0
- package/dist/enterprise/dto/add-enterprise-class-group.dto.js +22 -0
- package/dist/enterprise/dto/add-enterprise-class-group.dto.js.map +1 -0
- package/dist/enterprise/dto/add-enterprise-course.dto.d.ts +5 -0
- package/dist/enterprise/dto/add-enterprise-course.dto.d.ts.map +1 -0
- package/dist/enterprise/dto/add-enterprise-course.dto.js +27 -0
- package/dist/enterprise/dto/add-enterprise-course.dto.js.map +1 -0
- package/dist/enterprise/dto/add-enterprise-student.dto.d.ts +5 -0
- package/dist/enterprise/dto/add-enterprise-student.dto.d.ts.map +1 -0
- package/dist/enterprise/dto/add-enterprise-student.dto.js +27 -0
- package/dist/enterprise/dto/add-enterprise-student.dto.js.map +1 -0
- package/dist/enterprise/dto/add-enterprise-user.dto.d.ts +7 -0
- package/dist/enterprise/dto/add-enterprise-user.dto.d.ts.map +1 -0
- package/dist/enterprise/dto/add-enterprise-user.dto.js +36 -0
- package/dist/enterprise/dto/add-enterprise-user.dto.js.map +1 -0
- package/dist/enterprise/dto/create-enterprise.dto.d.ts +10 -0
- package/dist/enterprise/dto/create-enterprise.dto.d.ts.map +1 -0
- package/dist/enterprise/dto/create-enterprise.dto.js +54 -0
- package/dist/enterprise/dto/create-enterprise.dto.js.map +1 -0
- package/dist/enterprise/dto/update-enterprise-student.dto.d.ts +4 -0
- package/dist/enterprise/dto/update-enterprise-student.dto.d.ts.map +1 -0
- package/dist/enterprise/dto/update-enterprise-student.dto.js +22 -0
- package/dist/enterprise/dto/update-enterprise-student.dto.js.map +1 -0
- package/dist/enterprise/dto/update-enterprise-user.dto.d.ts +5 -0
- package/dist/enterprise/dto/update-enterprise-user.dto.d.ts.map +1 -0
- package/dist/enterprise/dto/update-enterprise-user.dto.js +27 -0
- package/dist/enterprise/dto/update-enterprise-user.dto.js.map +1 -0
- package/dist/enterprise/dto/update-enterprise.dto.d.ts +6 -0
- package/dist/enterprise/dto/update-enterprise.dto.d.ts.map +1 -0
- package/dist/enterprise/dto/update-enterprise.dto.js +9 -0
- package/dist/enterprise/dto/update-enterprise.dto.js.map +1 -0
- package/dist/enterprise/enterprise.controller.d.ts +269 -0
- package/dist/enterprise/enterprise.controller.d.ts.map +1 -0
- package/dist/enterprise/enterprise.controller.js +311 -0
- package/dist/enterprise/enterprise.controller.js.map +1 -0
- package/dist/enterprise/enterprise.module.d.ts +3 -0
- package/dist/enterprise/enterprise.module.d.ts.map +1 -0
- package/dist/enterprise/enterprise.module.js +25 -0
- package/dist/enterprise/enterprise.module.js.map +1 -0
- package/dist/enterprise/enterprise.service.d.ts +282 -0
- package/dist/enterprise/enterprise.service.d.ts.map +1 -0
- package/dist/enterprise/enterprise.service.js +627 -0
- package/dist/enterprise/enterprise.service.js.map +1 -0
- package/dist/evaluation/evaluation.controller.d.ts +56 -0
- package/dist/evaluation/evaluation.controller.d.ts.map +1 -0
- package/dist/evaluation/evaluation.controller.js +76 -0
- package/dist/evaluation/evaluation.controller.js.map +1 -0
- package/dist/evaluation/evaluation.module.d.ts +3 -0
- package/dist/evaluation/evaluation.module.d.ts.map +1 -0
- package/dist/evaluation/evaluation.module.js +25 -0
- package/dist/evaluation/evaluation.module.js.map +1 -0
- package/dist/evaluation/evaluation.service.d.ts +67 -0
- package/dist/evaluation/evaluation.service.d.ts.map +1 -0
- package/dist/evaluation/evaluation.service.js +378 -0
- package/dist/evaluation/evaluation.service.js.map +1 -0
- package/dist/exam/dto/create-exam-question.dto.d.ts +25 -0
- package/dist/exam/dto/create-exam-question.dto.d.ts.map +1 -0
- package/dist/exam/dto/create-exam-question.dto.js +117 -0
- package/dist/exam/dto/create-exam-question.dto.js.map +1 -0
- package/dist/exam/dto/create-exam.dto.d.ts +11 -0
- package/dist/exam/dto/create-exam.dto.d.ts.map +1 -0
- package/dist/exam/dto/create-exam.dto.js +63 -0
- package/dist/exam/dto/create-exam.dto.js.map +1 -0
- package/dist/exam/dto/reorder-exam-questions.dto.d.ts +4 -0
- package/dist/exam/dto/reorder-exam-questions.dto.d.ts.map +1 -0
- package/dist/exam/dto/reorder-exam-questions.dto.js +23 -0
- package/dist/exam/dto/reorder-exam-questions.dto.js.map +1 -0
- package/dist/exam/dto/save-exam-attempt-answers.dto.d.ts +14 -0
- package/dist/exam/dto/save-exam-attempt-answers.dto.d.ts.map +1 -0
- package/dist/exam/dto/save-exam-attempt-answers.dto.js +68 -0
- package/dist/exam/dto/save-exam-attempt-answers.dto.js.map +1 -0
- package/dist/exam/dto/start-exam-attempt.dto.d.ts +4 -0
- package/dist/exam/dto/start-exam-attempt.dto.d.ts.map +1 -0
- package/dist/exam/dto/start-exam-attempt.dto.js +23 -0
- package/dist/exam/dto/start-exam-attempt.dto.js.map +1 -0
- package/dist/exam/dto/submit-exam-attempt.dto.d.ts +5 -0
- package/dist/exam/dto/submit-exam-attempt.dto.d.ts.map +1 -0
- package/dist/exam/dto/submit-exam-attempt.dto.js +23 -0
- package/dist/exam/dto/submit-exam-attempt.dto.js.map +1 -0
- package/dist/exam/dto/update-exam-question.dto.d.ts +6 -0
- package/dist/exam/dto/update-exam-question.dto.d.ts.map +1 -0
- package/dist/exam/dto/update-exam-question.dto.js +9 -0
- package/dist/exam/dto/update-exam-question.dto.js.map +1 -0
- package/dist/exam/dto/update-exam.dto.d.ts +6 -0
- package/dist/exam/dto/update-exam.dto.d.ts.map +1 -0
- package/dist/exam/dto/update-exam.dto.js +9 -0
- package/dist/exam/dto/update-exam.dto.js.map +1 -0
- package/dist/exam/exam-attempt.controller.d.ts +273 -0
- package/dist/exam/exam-attempt.controller.d.ts.map +1 -0
- package/dist/exam/exam-attempt.controller.js +84 -0
- package/dist/exam/exam-attempt.controller.js.map +1 -0
- package/dist/exam/exam-attempt.service.d.ts +302 -0
- package/dist/exam/exam-attempt.service.d.ts.map +1 -0
- package/dist/exam/exam-attempt.service.js +776 -0
- package/dist/exam/exam-attempt.service.js.map +1 -0
- package/dist/exam/exam.controller.d.ts +162 -0
- package/dist/exam/exam.controller.d.ts.map +1 -0
- package/dist/exam/exam.controller.js +158 -0
- package/dist/exam/exam.controller.js.map +1 -0
- package/dist/exam/exam.module.d.ts +3 -0
- package/dist/exam/exam.module.d.ts.map +1 -0
- package/dist/exam/exam.module.js +27 -0
- package/dist/exam/exam.module.js.map +1 -0
- package/dist/exam/exam.service.d.ts +179 -0
- package/dist/exam/exam.service.d.ts.map +1 -0
- package/dist/exam/exam.service.js +597 -0
- package/dist/exam/exam.service.js.map +1 -0
- package/dist/index.d.ts +28 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +28 -0
- package/dist/index.js.map +1 -1
- package/dist/instructor/dto/create-instructor.dto.d.ts +10 -0
- package/dist/instructor/dto/create-instructor.dto.d.ts.map +1 -0
- package/dist/instructor/dto/create-instructor.dto.js +55 -0
- package/dist/instructor/dto/create-instructor.dto.js.map +1 -0
- package/dist/instructor/dto/update-instructor.dto.d.ts +9 -0
- package/dist/instructor/dto/update-instructor.dto.d.ts.map +1 -0
- package/dist/instructor/dto/update-instructor.dto.js +51 -0
- package/dist/instructor/dto/update-instructor.dto.js.map +1 -0
- package/dist/instructor/instructor.controller.d.ts +52 -0
- package/dist/instructor/instructor.controller.d.ts.map +1 -0
- package/dist/instructor/instructor.controller.js +98 -0
- package/dist/instructor/instructor.controller.js.map +1 -0
- package/dist/instructor/instructor.module.d.ts +3 -0
- package/dist/instructor/instructor.module.d.ts.map +1 -0
- package/dist/instructor/instructor.module.js +25 -0
- package/dist/instructor/instructor.module.js.map +1 -0
- package/dist/instructor/instructor.service.d.ts +79 -0
- package/dist/instructor/instructor.service.d.ts.map +1 -0
- package/dist/instructor/instructor.service.js +528 -0
- package/dist/instructor/instructor.service.js.map +1 -0
- package/dist/lms.module.d.ts.map +1 -1
- package/dist/lms.module.js +36 -4
- package/dist/lms.module.js.map +1 -1
- package/dist/reports/reports.controller.d.ts +69 -0
- package/dist/reports/reports.controller.d.ts.map +1 -0
- package/dist/reports/reports.controller.js +40 -0
- package/dist/reports/reports.controller.js.map +1 -0
- package/dist/reports/reports.module.d.ts +3 -0
- package/dist/reports/reports.module.d.ts.map +1 -0
- package/dist/reports/reports.module.js +25 -0
- package/dist/reports/reports.module.js.map +1 -0
- package/dist/reports/reports.service.d.ts +80 -0
- package/dist/reports/reports.service.d.ts.map +1 -0
- package/dist/reports/reports.service.js +366 -0
- package/dist/reports/reports.service.js.map +1 -0
- package/dist/training/dto/create-training.dto.d.ts +19 -0
- package/dist/training/dto/create-training.dto.d.ts.map +1 -0
- package/dist/training/dto/create-training.dto.js +98 -0
- package/dist/training/dto/create-training.dto.js.map +1 -0
- package/dist/training/dto/update-training.dto.d.ts +6 -0
- package/dist/training/dto/update-training.dto.d.ts.map +1 -0
- package/dist/training/dto/update-training.dto.js +9 -0
- package/dist/training/dto/update-training.dto.js.map +1 -0
- package/dist/training/training.controller.d.ts +195 -0
- package/dist/training/training.controller.d.ts.map +1 -0
- package/dist/training/training.controller.js +104 -0
- package/dist/training/training.controller.js.map +1 -0
- package/dist/training/training.module.d.ts +3 -0
- package/dist/training/training.module.d.ts.map +1 -0
- package/dist/training/training.module.js +25 -0
- package/dist/training/training.module.js.map +1 -0
- package/dist/training/training.service.d.ts +213 -0
- package/dist/training/training.service.d.ts.map +1 -0
- package/dist/training/training.service.js +497 -0
- package/dist/training/training.service.js.map +1 -0
- package/hedhog/data/dashboard.yaml +6 -0
- package/hedhog/data/dashboard_component.yaml +153 -0
- package/hedhog/data/dashboard_component_role.yaml +97 -0
- package/hedhog/data/dashboard_item.yaml +167 -0
- package/hedhog/data/dashboard_role.yaml +6 -0
- package/hedhog/data/instructor_qualification.yaml +16 -0
- package/hedhog/data/menu.yaml +129 -19
- package/hedhog/data/role.yaml +25 -1
- package/hedhog/data/route.yaml +867 -0
- package/hedhog/frontend/app/_components/class-form-sheet.tsx.ejs +1992 -0
- package/hedhog/frontend/app/_components/course-form-sheet.tsx.ejs +480 -0
- package/hedhog/frontend/app/_components/create-lms-instructor-sheet.tsx.ejs +591 -0
- package/hedhog/frontend/app/_components/create-lms-person-sheet.tsx.ejs +164 -0
- package/hedhog/frontend/app/_components/create-lms-student-person-sheet.tsx.ejs +120 -0
- package/hedhog/frontend/app/_components/lms-class-calendar.tsx.ejs +272 -0
- package/hedhog/frontend/app/_components/mobile-calendar.tsx.ejs +277 -0
- package/hedhog/frontend/app/_lib/editor/canvasInstance.ts.ejs +48 -0
- package/hedhog/frontend/app/_lib/editor/pctHelpers.ts.ejs +50 -0
- package/hedhog/frontend/app/_lib/editor/templateSerializer.ts.ejs +268 -0
- package/hedhog/frontend/app/_lib/editor/types.ts.ejs +94 -0
- package/hedhog/frontend/app/_lib/store/useTemplateStore.ts.ejs +284 -0
- package/hedhog/frontend/app/certificates/issued/page.tsx.ejs +638 -0
- package/hedhog/frontend/app/certificates/models/CanvasStage.tsx.ejs +916 -0
- package/hedhog/frontend/app/certificates/models/LeftPanel.tsx.ejs +200 -0
- package/hedhog/frontend/app/certificates/models/RightPanel.tsx.ejs +769 -0
- package/hedhog/frontend/app/certificates/models/TemplateEditorPage.tsx.ejs +104 -0
- package/hedhog/frontend/app/certificates/models/TopBar.tsx.ejs +354 -0
- package/hedhog/frontend/app/certificates/models/editor/page.tsx.ejs +5 -0
- package/hedhog/frontend/app/certificates/models/page.tsx.ejs +883 -0
- package/hedhog/frontend/app/classes/[id]/_components/event-summary-popover.tsx.ejs +279 -0
- package/hedhog/frontend/app/classes/[id]/_components/quick-create-session-popover.tsx.ejs +1027 -0
- package/hedhog/frontend/app/classes/[id]/page.tsx.ejs +3130 -993
- package/hedhog/frontend/app/classes/page.tsx.ejs +2731 -759
- package/hedhog/frontend/app/courses/[id]/_components/CourseCertificateCard.tsx.ejs +80 -0
- package/hedhog/frontend/app/courses/[id]/_components/CourseClassificationCard.tsx.ejs +226 -0
- package/hedhog/frontend/app/courses/[id]/_components/CourseContentCard.tsx.ejs +71 -0
- package/hedhog/frontend/app/courses/[id]/_components/CourseDangerZoneCard.tsx.ejs +42 -0
- package/hedhog/frontend/app/courses/[id]/_components/CourseFlagsCard.tsx.ejs +111 -0
- package/hedhog/frontend/app/courses/[id]/_components/CourseMainInfoCard.tsx.ejs +113 -0
- package/hedhog/frontend/app/courses/[id]/_components/CourseMediaCard.tsx.ejs +215 -0
- package/hedhog/frontend/app/courses/[id]/_components/CourseMultiEntityPicker.tsx.ejs +236 -0
- package/hedhog/frontend/app/courses/[id]/_components/CourseRelationsCard.tsx.ejs +141 -0
- package/hedhog/frontend/app/courses/[id]/_components/CourseSectionCard.tsx.ejs +57 -0
- package/hedhog/frontend/app/courses/[id]/_components/CourseSummaryCard.tsx.ejs +60 -0
- package/hedhog/frontend/app/courses/[id]/_components/course-edit-types.ts.ejs +33 -0
- package/hedhog/frontend/app/courses/[id]/page.tsx.ejs +933 -1103
- package/hedhog/frontend/app/courses/[id]/structure/page.tsx.ejs +699 -117
- package/hedhog/frontend/app/courses/page.tsx.ejs +1018 -1042
- package/hedhog/frontend/app/enterprise/[id]/page.tsx.ejs +317 -0
- package/hedhog/frontend/app/enterprise/_components/enterprise-activity-panel.tsx.ejs +88 -0
- package/hedhog/frontend/app/enterprise/_components/enterprise-admin-create-sheet.tsx.ejs +318 -0
- package/hedhog/frontend/app/enterprise/_components/enterprise-administrators-tab.tsx.ejs +332 -0
- package/hedhog/frontend/app/enterprise/_components/enterprise-class-create-sheet.tsx.ejs +58 -0
- package/hedhog/frontend/app/enterprise/_components/enterprise-classes-tab.tsx.ejs +390 -0
- package/hedhog/frontend/app/enterprise/_components/enterprise-company-identity-card.tsx.ejs +112 -0
- package/hedhog/frontend/app/enterprise/_components/enterprise-course-create-sheet.tsx.ejs +183 -0
- package/hedhog/frontend/app/enterprise/_components/enterprise-courses-tab.tsx.ejs +363 -0
- package/hedhog/frontend/app/enterprise/_components/enterprise-detail-constants.ts.ejs +88 -0
- package/hedhog/frontend/app/enterprise/_components/enterprise-detail-sheet.tsx.ejs +548 -0
- package/hedhog/frontend/app/enterprise/_components/enterprise-detail-utils.ts.ejs +33 -0
- package/hedhog/frontend/app/enterprise/_components/enterprise-mocks.ts.ejs +277 -0
- package/hedhog/frontend/app/enterprise/_components/enterprise-person-picker.ts.ejs +31 -0
- package/hedhog/frontend/app/enterprise/_components/enterprise-progress-bar.tsx.ejs +21 -0
- package/hedhog/frontend/app/enterprise/_components/enterprise-related-tab.tsx.ejs +224 -0
- package/hedhog/frontend/app/enterprise/_components/enterprise-sheet.tsx.ejs +397 -0
- package/hedhog/frontend/app/enterprise/_components/enterprise-student-create-sheet.tsx.ejs +167 -0
- package/hedhog/frontend/app/enterprise/_components/enterprise-students-tab.tsx.ejs +267 -0
- package/hedhog/frontend/app/enterprise/_components/enterprise-system-user-picker.ts.ejs +42 -0
- package/hedhog/frontend/app/enterprise/_components/enterprise-types.ts.ejs +96 -0
- package/hedhog/frontend/app/enterprise/_components/enterprise-user-create-sheet.tsx.ejs +207 -0
- package/hedhog/frontend/app/enterprise/_components/enterprise-user-distribution-chart.tsx.ejs +149 -0
- package/hedhog/frontend/app/enterprise/page.tsx.ejs +596 -0
- package/hedhog/frontend/app/evaluations/page.tsx.ejs +1250 -0
- package/hedhog/frontend/app/exams/[id]/attempt/page.tsx.ejs +642 -196
- package/hedhog/frontend/app/exams/[id]/page.tsx.ejs +11 -0
- package/hedhog/frontend/app/exams/[id]/questions/page.tsx.ejs +1316 -436
- package/hedhog/frontend/app/exams/page.tsx.ejs +799 -546
- package/hedhog/frontend/app/layout.tsx.ejs +5 -0
- package/hedhog/frontend/app/page.tsx.ejs +3 -1220
- package/hedhog/frontend/app/reports/courses/page.tsx.ejs +843 -0
- package/hedhog/frontend/app/reports/dashboard/page.tsx.ejs +890 -0
- package/hedhog/frontend/app/reports/page.tsx.ejs +802 -808
- package/hedhog/frontend/app/reports/students/page.tsx.ejs +772 -0
- package/hedhog/frontend/app/training/page.tsx.ejs +1873 -628
- package/hedhog/frontend/messages/en.json +1606 -111
- package/hedhog/frontend/messages/pt.json +1636 -134
- package/hedhog/frontend/widgets/active-classes-kpi.tsx.ejs +74 -0
- package/hedhog/frontend/widgets/active-courses-kpi.tsx.ejs +74 -0
- package/hedhog/frontend/widgets/approval-rate-kpi.tsx.ejs +81 -0
- package/hedhog/frontend/widgets/category-distribution-chart.tsx.ejs +119 -0
- package/hedhog/frontend/widgets/class-calendar.tsx.ejs +440 -0
- package/hedhog/frontend/widgets/completion-rate-kpi.tsx.ejs +81 -0
- package/hedhog/frontend/widgets/engagement-chart.tsx.ejs +120 -0
- package/hedhog/frontend/widgets/footer-summary.tsx.ejs +80 -0
- package/hedhog/frontend/widgets/issued-certificates-kpi.tsx.ejs +74 -0
- package/hedhog/frontend/widgets/latest-enrollments.tsx.ejs +166 -0
- package/hedhog/frontend/widgets/student-growth-chart.tsx.ejs +89 -0
- package/hedhog/frontend/widgets/top-courses-chart.tsx.ejs +104 -0
- package/hedhog/frontend/widgets/total-students-kpi.tsx.ejs +78 -0
- package/hedhog/frontend/widgets/upcoming-classes.tsx.ejs +152 -0
- package/hedhog/table/course.yaml +19 -1
- package/hedhog/table/course_class_group.yaml +8 -0
- package/hedhog/table/course_class_session.yaml +33 -0
- package/hedhog/table/course_instructor.yaml +27 -0
- package/hedhog/table/enterprise.yaml +29 -0
- package/hedhog/table/enterprise_class_group.yaml +20 -0
- package/hedhog/table/enterprise_course.yaml +23 -0
- package/hedhog/table/enterprise_student.yaml +24 -0
- package/hedhog/table/enterprise_user.yaml +35 -0
- package/hedhog/table/instructor_qualification.yaml +26 -0
- package/hedhog/table/instructor_qualification_assignment.yaml +22 -0
- package/hedhog/table/question.yaml +6 -0
- package/package.json +6 -6
- package/src/certificate/certificate.controller.ts +83 -0
- package/src/certificate/certificate.module.ts +13 -0
- package/src/certificate/certificate.service.ts +413 -0
- package/src/certificate/dto/create-certificate-template.dto.ts +25 -0
- package/src/certificate/dto/update-certificate-template.dto.ts +6 -0
- package/src/class-group/class-group.controller.ts +189 -0
- package/src/class-group/class-group.module.ts +12 -0
- package/src/class-group/class-group.service.ts +1802 -0
- package/src/class-group/dto/create-class-group.dto.ts +139 -0
- package/src/class-group/dto/create-session.dto.ts +102 -0
- package/src/class-group/dto/enrollment.dto.ts +70 -0
- package/src/class-group/dto/update-class-group.dto.ts +4 -0
- package/src/class-group/dto/update-session.dto.ts +9 -0
- package/src/course/course-structure.controller.ts +85 -0
- package/src/course/course-structure.service.ts +525 -0
- package/src/course/course.controller.ts +69 -0
- package/src/course/course.module.ts +15 -0
- package/src/course/course.service.ts +920 -0
- package/src/course/dto/create-course-structure-lesson.dto.ts +97 -0
- package/src/course/dto/create-course-structure-session.dto.ts +22 -0
- package/src/course/dto/create-course.dto.ts +111 -0
- package/src/course/dto/update-course-structure-lesson.dto.ts +6 -0
- package/src/course/dto/update-course-structure-session.dto.ts +6 -0
- package/src/course/dto/update-course.dto.ts +4 -0
- package/src/dashboard/dashboard.controller.ts +14 -0
- package/src/dashboard/dashboard.module.ts +12 -0
- package/src/dashboard/dashboard.service.ts +726 -0
- package/src/enterprise/dto/add-enterprise-class-group.dto.ts +7 -0
- package/src/enterprise/dto/add-enterprise-course.dto.ts +11 -0
- package/src/enterprise/dto/add-enterprise-student.dto.ts +16 -0
- package/src/enterprise/dto/add-enterprise-user.dto.ts +23 -0
- package/src/enterprise/dto/create-enterprise.dto.ts +41 -0
- package/src/enterprise/dto/update-enterprise-student.dto.ts +7 -0
- package/src/enterprise/dto/update-enterprise-user.dto.ts +11 -0
- package/src/enterprise/dto/update-enterprise.dto.ts +4 -0
- package/src/enterprise/enterprise.controller.ts +233 -0
- package/src/enterprise/enterprise.module.ts +12 -0
- package/src/enterprise/enterprise.service.ts +712 -0
- package/src/evaluation/evaluation.controller.ts +44 -0
- package/src/evaluation/evaluation.module.ts +12 -0
- package/src/evaluation/evaluation.service.ts +394 -0
- package/src/exam/dto/create-exam-question.dto.ts +103 -0
- package/src/exam/dto/create-exam.dto.ts +41 -0
- package/src/exam/dto/reorder-exam-questions.dto.ts +8 -0
- package/src/exam/dto/save-exam-attempt-answers.dto.ts +55 -0
- package/src/exam/dto/start-exam-attempt.dto.ts +8 -0
- package/src/exam/dto/submit-exam-attempt.dto.ts +8 -0
- package/src/exam/dto/update-exam-question.dto.ts +4 -0
- package/src/exam/dto/update-exam.dto.ts +4 -0
- package/src/exam/exam-attempt.controller.ts +65 -0
- package/src/exam/exam-attempt.service.ts +1008 -0
- package/src/exam/exam.controller.ts +102 -0
- package/src/exam/exam.module.ts +14 -0
- package/src/exam/exam.service.ts +784 -0
- package/src/index.ts +29 -0
- package/src/instructor/dto/create-instructor.dto.ts +43 -0
- package/src/instructor/dto/update-instructor.dto.ts +38 -0
- package/src/instructor/instructor.controller.ts +73 -0
- package/src/instructor/instructor.module.ts +12 -0
- package/src/instructor/instructor.service.ts +646 -0
- package/src/lms.module.ts +36 -4
- package/src/reports/reports.controller.ts +14 -0
- package/src/reports/reports.module.ts +12 -0
- package/src/reports/reports.service.ts +485 -0
- package/src/training/dto/create-training.dto.ts +81 -0
- package/src/training/dto/update-training.dto.ts +4 -0
- package/src/training/training.controller.ts +68 -0
- package/src/training/training.module.ts +12 -0
- package/src/training/training.service.ts +574 -0
|
@@ -0,0 +1,638 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { createDefaultTemplate } from '@/app/(app)/(libraries)/lms/_lib/editor/types';
|
|
4
|
+
import {
|
|
5
|
+
Page,
|
|
6
|
+
PageHeader,
|
|
7
|
+
PaginationFooter,
|
|
8
|
+
SearchBar,
|
|
9
|
+
} from '@/components/entity-list';
|
|
10
|
+
import { Badge } from '@/components/ui/badge';
|
|
11
|
+
import { Button } from '@/components/ui/button';
|
|
12
|
+
import { Card, CardContent } from '@/components/ui/card';
|
|
13
|
+
import { Input } from '@/components/ui/input';
|
|
14
|
+
import { KpiCardsGrid } from '@/components/ui/kpi-cards-grid';
|
|
15
|
+
import {
|
|
16
|
+
Select,
|
|
17
|
+
SelectContent,
|
|
18
|
+
SelectItem,
|
|
19
|
+
SelectTrigger,
|
|
20
|
+
SelectValue,
|
|
21
|
+
} from '@/components/ui/select';
|
|
22
|
+
import {
|
|
23
|
+
Sheet,
|
|
24
|
+
SheetContent,
|
|
25
|
+
SheetDescription,
|
|
26
|
+
SheetFooter,
|
|
27
|
+
SheetHeader,
|
|
28
|
+
SheetTitle,
|
|
29
|
+
} from '@/components/ui/sheet';
|
|
30
|
+
import { Skeleton } from '@/components/ui/skeleton';
|
|
31
|
+
import { Textarea } from '@/components/ui/textarea';
|
|
32
|
+
import { useApp, useQuery } from '@hed-hog/next-app-provider';
|
|
33
|
+
import {
|
|
34
|
+
Award,
|
|
35
|
+
BadgeCheck,
|
|
36
|
+
ExternalLink,
|
|
37
|
+
FileEdit,
|
|
38
|
+
FilePlus2,
|
|
39
|
+
Loader2,
|
|
40
|
+
Shapes,
|
|
41
|
+
UserRound,
|
|
42
|
+
} from 'lucide-react';
|
|
43
|
+
import { useLocale, useTranslations } from 'next-intl';
|
|
44
|
+
import { useRouter } from 'next/navigation';
|
|
45
|
+
import { useEffect, useMemo, useState } from 'react';
|
|
46
|
+
import { toast } from 'sonner';
|
|
47
|
+
|
|
48
|
+
type IssuedCertificate = {
|
|
49
|
+
id: number;
|
|
50
|
+
studentId: number;
|
|
51
|
+
studentName: string;
|
|
52
|
+
courseName: string;
|
|
53
|
+
templateId: number;
|
|
54
|
+
templateName: string;
|
|
55
|
+
templateStatus: string | null;
|
|
56
|
+
certificateType: 'course' | 'exam' | 'course_class_group' | 'learning_path';
|
|
57
|
+
workloadHours: number;
|
|
58
|
+
issuedAt: string;
|
|
59
|
+
completedAt: string;
|
|
60
|
+
finalScore: number | null;
|
|
61
|
+
verificationCode: string;
|
|
62
|
+
verificationUrl: string | null;
|
|
63
|
+
pdfUrl: string | null;
|
|
64
|
+
sourceTitle: string;
|
|
65
|
+
primaryColor: string | null;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
type ApiIssuedCertificatesResponse = {
|
|
69
|
+
total: number;
|
|
70
|
+
page: number;
|
|
71
|
+
pageSize: number;
|
|
72
|
+
lastPage: number;
|
|
73
|
+
data: IssuedCertificate[];
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
type CertificateTemplateStatus = 'draft' | 'active' | 'inactive';
|
|
77
|
+
|
|
78
|
+
type CreateCertificateTemplatePayload = {
|
|
79
|
+
name: string;
|
|
80
|
+
description?: string;
|
|
81
|
+
templateContent: string;
|
|
82
|
+
status: CertificateTemplateStatus;
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
type CertificateTemplate = {
|
|
86
|
+
id: number;
|
|
87
|
+
name: string;
|
|
88
|
+
slug: string;
|
|
89
|
+
description: string | null;
|
|
90
|
+
templateContent: string;
|
|
91
|
+
status: CertificateTemplateStatus;
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
const PAGE_SIZES = [6, 12, 24];
|
|
95
|
+
|
|
96
|
+
export default function IssuedCertificatesPage() {
|
|
97
|
+
const t = useTranslations('lms.IssuedCertificatesPage');
|
|
98
|
+
const locale = useLocale();
|
|
99
|
+
const router = useRouter();
|
|
100
|
+
const { request } = useApp();
|
|
101
|
+
|
|
102
|
+
const [searchInput, setSearchInput] = useState('');
|
|
103
|
+
const [searchQuery, setSearchQuery] = useState('');
|
|
104
|
+
const [typeFilter, setTypeFilter] = useState('all');
|
|
105
|
+
const [currentPage, setCurrentPage] = useState(1);
|
|
106
|
+
const [pageSize, setPageSize] = useState(12);
|
|
107
|
+
const [isTemplateSheetOpen, setIsTemplateSheetOpen] = useState(false);
|
|
108
|
+
const [isCreatingTemplate, setIsCreatingTemplate] = useState(false);
|
|
109
|
+
const [templateName, setTemplateName] = useState('');
|
|
110
|
+
const [templateDescription, setTemplateDescription] = useState('');
|
|
111
|
+
const [templateStatus, setTemplateStatus] =
|
|
112
|
+
useState<CertificateTemplateStatus>('draft');
|
|
113
|
+
|
|
114
|
+
const {
|
|
115
|
+
data: certificatesResponse,
|
|
116
|
+
isLoading,
|
|
117
|
+
isFetching,
|
|
118
|
+
} = useQuery<ApiIssuedCertificatesResponse>({
|
|
119
|
+
queryKey: [
|
|
120
|
+
'lms-issued-certificates',
|
|
121
|
+
currentPage,
|
|
122
|
+
pageSize,
|
|
123
|
+
searchQuery,
|
|
124
|
+
typeFilter,
|
|
125
|
+
],
|
|
126
|
+
queryFn: async () => {
|
|
127
|
+
const response = await request<ApiIssuedCertificatesResponse>({
|
|
128
|
+
url: '/lms/certificates/issued',
|
|
129
|
+
method: 'GET',
|
|
130
|
+
params: {
|
|
131
|
+
page: currentPage,
|
|
132
|
+
pageSize,
|
|
133
|
+
...(searchQuery ? { search: searchQuery } : {}),
|
|
134
|
+
...(typeFilter !== 'all' ? { type: typeFilter } : {}),
|
|
135
|
+
},
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
return response.data;
|
|
139
|
+
},
|
|
140
|
+
placeholderData: (old) => old,
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
useEffect(() => {
|
|
144
|
+
const timeoutId = setTimeout(() => {
|
|
145
|
+
setSearchQuery(searchInput.trim());
|
|
146
|
+
}, 350);
|
|
147
|
+
|
|
148
|
+
return () => clearTimeout(timeoutId);
|
|
149
|
+
}, [searchInput]);
|
|
150
|
+
|
|
151
|
+
useEffect(() => {
|
|
152
|
+
setCurrentPage(1);
|
|
153
|
+
}, [searchQuery, typeFilter]);
|
|
154
|
+
|
|
155
|
+
const certificates = certificatesResponse?.data ?? [];
|
|
156
|
+
const totalItems = certificatesResponse?.total ?? 0;
|
|
157
|
+
const totalPages = Math.max(certificatesResponse?.lastPage ?? 1, 1);
|
|
158
|
+
const loading = isLoading && !certificatesResponse;
|
|
159
|
+
const isRefreshing = isFetching && !isLoading;
|
|
160
|
+
|
|
161
|
+
useEffect(() => {
|
|
162
|
+
if (currentPage > totalPages) {
|
|
163
|
+
setCurrentPage(totalPages);
|
|
164
|
+
}
|
|
165
|
+
}, [currentPage, totalPages]);
|
|
166
|
+
|
|
167
|
+
const hasActiveFilters =
|
|
168
|
+
searchInput.trim().length > 0 || typeFilter !== 'all';
|
|
169
|
+
|
|
170
|
+
const statsData = useMemo(() => {
|
|
171
|
+
const activeTemplates = new Set<number>();
|
|
172
|
+
const uniqueStudents = new Set<number>();
|
|
173
|
+
let withPdf = 0;
|
|
174
|
+
|
|
175
|
+
for (const certificate of certificates) {
|
|
176
|
+
activeTemplates.add(certificate.templateId);
|
|
177
|
+
uniqueStudents.add(certificate.studentId);
|
|
178
|
+
if (certificate.pdfUrl) {
|
|
179
|
+
withPdf += 1;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
return {
|
|
184
|
+
templates: activeTemplates.size,
|
|
185
|
+
students: uniqueStudents.size,
|
|
186
|
+
withPdf,
|
|
187
|
+
pageTotal: certificates.length,
|
|
188
|
+
};
|
|
189
|
+
}, [certificates]);
|
|
190
|
+
|
|
191
|
+
const dateFormatter = useMemo(
|
|
192
|
+
() =>
|
|
193
|
+
new Intl.DateTimeFormat(locale.startsWith('pt') ? 'pt-BR' : 'en-US', {
|
|
194
|
+
dateStyle: 'medium',
|
|
195
|
+
}),
|
|
196
|
+
[locale]
|
|
197
|
+
);
|
|
198
|
+
|
|
199
|
+
function clearFilters() {
|
|
200
|
+
setSearchInput('');
|
|
201
|
+
setSearchQuery('');
|
|
202
|
+
setTypeFilter('all');
|
|
203
|
+
setCurrentPage(1);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
function resetTemplateForm() {
|
|
207
|
+
setTemplateName('');
|
|
208
|
+
setTemplateDescription('');
|
|
209
|
+
setTemplateStatus('draft');
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
async function createTemplate() {
|
|
213
|
+
const name = templateName.trim();
|
|
214
|
+
|
|
215
|
+
if (!name) {
|
|
216
|
+
toast.error(t('sheet.validation.required'));
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
const initialTemplate = createDefaultTemplate();
|
|
221
|
+
initialTemplate.name = name;
|
|
222
|
+
|
|
223
|
+
const payload: CreateCertificateTemplatePayload = {
|
|
224
|
+
name,
|
|
225
|
+
description: templateDescription.trim() || undefined,
|
|
226
|
+
status: templateStatus,
|
|
227
|
+
templateContent: JSON.stringify(initialTemplate),
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
try {
|
|
231
|
+
setIsCreatingTemplate(true);
|
|
232
|
+
const response = await request<CertificateTemplate>({
|
|
233
|
+
url: '/lms/certificates/templates',
|
|
234
|
+
method: 'POST',
|
|
235
|
+
data: payload,
|
|
236
|
+
});
|
|
237
|
+
|
|
238
|
+
setIsTemplateSheetOpen(false);
|
|
239
|
+
resetTemplateForm();
|
|
240
|
+
toast.success(t('sheet.success'));
|
|
241
|
+
|
|
242
|
+
const createdId = response.data?.id;
|
|
243
|
+
if (createdId) {
|
|
244
|
+
router.push(`/lms/certificates/models/editor?templateId=${createdId}`);
|
|
245
|
+
}
|
|
246
|
+
} catch {
|
|
247
|
+
toast.error(t('sheet.error'));
|
|
248
|
+
} finally {
|
|
249
|
+
setIsCreatingTemplate(false);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
function formatDate(value: string) {
|
|
254
|
+
const parsed = new Date(value);
|
|
255
|
+
|
|
256
|
+
if (Number.isNaN(parsed.getTime())) {
|
|
257
|
+
return '-';
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
return dateFormatter.format(parsed);
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
function formatTypeLabel(
|
|
264
|
+
value: IssuedCertificate['certificateType'] | 'all'
|
|
265
|
+
) {
|
|
266
|
+
if (value === 'course_class_group') {
|
|
267
|
+
return t('types.courseClassGroup');
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
if (value === 'learning_path') {
|
|
271
|
+
return t('types.learningPath');
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
return t(`types.${value}`);
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
return (
|
|
278
|
+
<Page>
|
|
279
|
+
<PageHeader
|
|
280
|
+
title={t('title')}
|
|
281
|
+
description={t('description')}
|
|
282
|
+
breadcrumbs={[
|
|
283
|
+
{ label: t('breadcrumbs.home'), href: '/' },
|
|
284
|
+
{ label: t('breadcrumbs.certificates') },
|
|
285
|
+
{ label: t('breadcrumbs.issued') },
|
|
286
|
+
]}
|
|
287
|
+
/>
|
|
288
|
+
|
|
289
|
+
<KpiCardsGrid
|
|
290
|
+
items={[
|
|
291
|
+
{
|
|
292
|
+
key: 'total',
|
|
293
|
+
title: t('kpis.totalIssued'),
|
|
294
|
+
value: totalItems,
|
|
295
|
+
icon: Award,
|
|
296
|
+
accentClassName: 'from-sky-500/20 via-cyan-500/10 to-transparent',
|
|
297
|
+
iconContainerClassName: 'bg-sky-100 text-sky-700',
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
key: 'templates',
|
|
301
|
+
title: t('kpis.templatesOnPage'),
|
|
302
|
+
value: statsData.templates,
|
|
303
|
+
icon: Shapes,
|
|
304
|
+
accentClassName:
|
|
305
|
+
'from-amber-500/20 via-orange-500/10 to-transparent',
|
|
306
|
+
iconContainerClassName: 'bg-amber-100 text-amber-700',
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
key: 'students',
|
|
310
|
+
title: t('kpis.studentsOnPage'),
|
|
311
|
+
value: statsData.students,
|
|
312
|
+
icon: UserRound,
|
|
313
|
+
accentClassName:
|
|
314
|
+
'from-emerald-500/20 via-green-500/10 to-transparent',
|
|
315
|
+
iconContainerClassName: 'bg-emerald-100 text-emerald-700',
|
|
316
|
+
},
|
|
317
|
+
{
|
|
318
|
+
key: 'pdf',
|
|
319
|
+
title: t('kpis.pdfOnPage'),
|
|
320
|
+
value: statsData.withPdf,
|
|
321
|
+
icon: BadgeCheck,
|
|
322
|
+
accentClassName:
|
|
323
|
+
'from-violet-500/20 via-purple-500/10 to-transparent',
|
|
324
|
+
iconContainerClassName: 'bg-violet-100 text-violet-700',
|
|
325
|
+
},
|
|
326
|
+
]}
|
|
327
|
+
/>
|
|
328
|
+
|
|
329
|
+
<div className="flex flex-col gap-4 xl:flex-row xl:items-center">
|
|
330
|
+
<div className="flex-1">
|
|
331
|
+
<SearchBar
|
|
332
|
+
searchQuery={searchInput}
|
|
333
|
+
onSearchChange={setSearchInput}
|
|
334
|
+
onSearch={() => setSearchQuery(searchInput.trim())}
|
|
335
|
+
placeholder={t('filters.searchPlaceholder')}
|
|
336
|
+
controls={[
|
|
337
|
+
{
|
|
338
|
+
id: 'type-filter',
|
|
339
|
+
type: 'select',
|
|
340
|
+
value: typeFilter,
|
|
341
|
+
onChange: setTypeFilter,
|
|
342
|
+
placeholder: t('filters.type'),
|
|
343
|
+
options: [
|
|
344
|
+
{ value: 'all', label: t('filters.allTypes') },
|
|
345
|
+
{ value: 'course', label: t('types.course') },
|
|
346
|
+
{ value: 'exam', label: t('types.exam') },
|
|
347
|
+
{
|
|
348
|
+
value: 'course_class_group',
|
|
349
|
+
label: t('types.courseClassGroup'),
|
|
350
|
+
},
|
|
351
|
+
{
|
|
352
|
+
value: 'learning_path',
|
|
353
|
+
label: t('types.learningPath'),
|
|
354
|
+
},
|
|
355
|
+
],
|
|
356
|
+
},
|
|
357
|
+
]}
|
|
358
|
+
/>
|
|
359
|
+
</div>
|
|
360
|
+
|
|
361
|
+
<div className="flex items-center gap-2 text-sm text-muted-foreground">
|
|
362
|
+
<span>
|
|
363
|
+
{totalItems}{' '}
|
|
364
|
+
{totalItems === 1 ? t('results.single') : t('results.plural')}
|
|
365
|
+
</span>
|
|
366
|
+
{hasActiveFilters ? (
|
|
367
|
+
<Button
|
|
368
|
+
type="button"
|
|
369
|
+
variant="ghost"
|
|
370
|
+
size="sm"
|
|
371
|
+
onClick={clearFilters}
|
|
372
|
+
>
|
|
373
|
+
{t('filters.clear')}
|
|
374
|
+
</Button>
|
|
375
|
+
) : null}
|
|
376
|
+
{isRefreshing ? <Loader2 className="size-4 animate-spin" /> : null}
|
|
377
|
+
</div>
|
|
378
|
+
</div>
|
|
379
|
+
|
|
380
|
+
{loading ? (
|
|
381
|
+
<div className="grid gap-4 sm:grid-cols-2 lg:grid-cols-3">
|
|
382
|
+
{Array.from({ length: 6 }).map((_, index) => (
|
|
383
|
+
<Card key={index} className="overflow-hidden border-border/70 py-0">
|
|
384
|
+
<div className="h-1 w-full bg-linear-to-r from-slate-300/70 via-slate-200 to-transparent" />
|
|
385
|
+
<CardContent className="space-y-4 p-5">
|
|
386
|
+
<div className="flex items-center gap-2">
|
|
387
|
+
<Skeleton className="h-6 w-20 rounded-full" />
|
|
388
|
+
<Skeleton className="h-6 w-28 rounded-full" />
|
|
389
|
+
</div>
|
|
390
|
+
<div>
|
|
391
|
+
<Skeleton className="mb-2 h-5 w-3/4" />
|
|
392
|
+
<Skeleton className="h-4 w-1/2" />
|
|
393
|
+
</div>
|
|
394
|
+
<Skeleton className="h-16 w-full rounded-xl" />
|
|
395
|
+
<div className="grid grid-cols-2 gap-3">
|
|
396
|
+
<Skeleton className="h-14 w-full rounded-xl" />
|
|
397
|
+
<Skeleton className="h-14 w-full rounded-xl" />
|
|
398
|
+
</div>
|
|
399
|
+
</CardContent>
|
|
400
|
+
</Card>
|
|
401
|
+
))}
|
|
402
|
+
</div>
|
|
403
|
+
) : totalItems === 0 ? (
|
|
404
|
+
<div className="flex flex-col items-center justify-center gap-3 py-12 text-center">
|
|
405
|
+
<Award className="h-12 w-12 text-muted-foreground" />
|
|
406
|
+
<h2 className="text-lg font-semibold text-foreground">
|
|
407
|
+
{t('empty.title')}
|
|
408
|
+
</h2>
|
|
409
|
+
</div>
|
|
410
|
+
) : (
|
|
411
|
+
<div className="grid gap-4 sm:grid-cols-2 lg:grid-cols-3">
|
|
412
|
+
{certificates.map((certificate) => (
|
|
413
|
+
<Card
|
|
414
|
+
key={certificate.id}
|
|
415
|
+
className="overflow-hidden border-border/70 py-0 shadow-sm transition-shadow duration-300 hover:shadow-md"
|
|
416
|
+
>
|
|
417
|
+
<div
|
|
418
|
+
className="h-1 w-full"
|
|
419
|
+
style={{
|
|
420
|
+
backgroundColor: certificate.primaryColor || '#1D4ED8',
|
|
421
|
+
}}
|
|
422
|
+
/>
|
|
423
|
+
|
|
424
|
+
<CardContent className="space-y-4 p-5">
|
|
425
|
+
<div className="flex flex-wrap items-center gap-2">
|
|
426
|
+
<Badge variant="outline">
|
|
427
|
+
{formatTypeLabel(certificate.certificateType)}
|
|
428
|
+
</Badge>
|
|
429
|
+
<Badge variant="secondary">#{certificate.id}</Badge>
|
|
430
|
+
</div>
|
|
431
|
+
|
|
432
|
+
<div className="space-y-1">
|
|
433
|
+
<h3 className="line-clamp-2 text-base font-semibold leading-snug text-foreground">
|
|
434
|
+
{certificate.studentName}
|
|
435
|
+
</h3>
|
|
436
|
+
<p className="line-clamp-2 text-sm text-muted-foreground">
|
|
437
|
+
{certificate.sourceTitle || certificate.courseName}
|
|
438
|
+
</p>
|
|
439
|
+
</div>
|
|
440
|
+
|
|
441
|
+
<div className="rounded-xl border bg-muted/30 p-3">
|
|
442
|
+
<p className="mb-1 text-xs uppercase tracking-wide text-muted-foreground">
|
|
443
|
+
{t('cards.template')}
|
|
444
|
+
</p>
|
|
445
|
+
<p className="text-sm font-medium text-foreground">
|
|
446
|
+
{certificate.templateName || '-'}
|
|
447
|
+
</p>
|
|
448
|
+
</div>
|
|
449
|
+
|
|
450
|
+
<div className="grid grid-cols-2 gap-3">
|
|
451
|
+
<div className="rounded-xl border bg-background p-3">
|
|
452
|
+
<p className="mb-1 text-xs text-muted-foreground">
|
|
453
|
+
{t('cards.issuedAt')}
|
|
454
|
+
</p>
|
|
455
|
+
<p className="text-sm font-medium text-foreground">
|
|
456
|
+
{formatDate(certificate.issuedAt)}
|
|
457
|
+
</p>
|
|
458
|
+
</div>
|
|
459
|
+
<div className="rounded-xl border bg-background p-3">
|
|
460
|
+
<p className="mb-1 text-xs text-muted-foreground">
|
|
461
|
+
{t('cards.workload')}
|
|
462
|
+
</p>
|
|
463
|
+
<p className="text-sm font-medium text-foreground">
|
|
464
|
+
{certificate.workloadHours}h
|
|
465
|
+
</p>
|
|
466
|
+
</div>
|
|
467
|
+
</div>
|
|
468
|
+
|
|
469
|
+
<div className="grid grid-cols-2 gap-3">
|
|
470
|
+
<div className="rounded-xl border bg-background p-3">
|
|
471
|
+
<p className="mb-1 text-xs text-muted-foreground">
|
|
472
|
+
{t('cards.finalScore')}
|
|
473
|
+
</p>
|
|
474
|
+
<p className="text-sm font-medium text-foreground">
|
|
475
|
+
{certificate.finalScore ?? '-'}
|
|
476
|
+
</p>
|
|
477
|
+
</div>
|
|
478
|
+
<div className="rounded-xl border bg-background p-3">
|
|
479
|
+
<p className="mb-1 text-xs text-muted-foreground">
|
|
480
|
+
{t('cards.verificationCode')}
|
|
481
|
+
</p>
|
|
482
|
+
<p className="truncate font-mono text-xs font-medium text-foreground">
|
|
483
|
+
{certificate.verificationCode}
|
|
484
|
+
</p>
|
|
485
|
+
</div>
|
|
486
|
+
</div>
|
|
487
|
+
|
|
488
|
+
<div className="flex flex-wrap gap-2 pt-1">
|
|
489
|
+
<Button
|
|
490
|
+
type="button"
|
|
491
|
+
variant="outline"
|
|
492
|
+
size="sm"
|
|
493
|
+
className="gap-2"
|
|
494
|
+
onClick={() =>
|
|
495
|
+
router.push(
|
|
496
|
+
`/lms/certificates/models/editor?templateId=${certificate.templateId}`
|
|
497
|
+
)
|
|
498
|
+
}
|
|
499
|
+
>
|
|
500
|
+
<FileEdit className="size-4" />
|
|
501
|
+
{t('cards.actions.editTemplate')}
|
|
502
|
+
</Button>
|
|
503
|
+
|
|
504
|
+
{certificate.pdfUrl ? (
|
|
505
|
+
<Button
|
|
506
|
+
type="button"
|
|
507
|
+
variant="outline"
|
|
508
|
+
size="sm"
|
|
509
|
+
className="gap-2"
|
|
510
|
+
onClick={() =>
|
|
511
|
+
window.open(certificate.pdfUrl ?? '', '_blank')
|
|
512
|
+
}
|
|
513
|
+
>
|
|
514
|
+
<BadgeCheck className="size-4" />
|
|
515
|
+
{t('cards.actions.openPdf')}
|
|
516
|
+
</Button>
|
|
517
|
+
) : null}
|
|
518
|
+
|
|
519
|
+
{certificate.verificationUrl ? (
|
|
520
|
+
<Button
|
|
521
|
+
type="button"
|
|
522
|
+
variant="ghost"
|
|
523
|
+
size="sm"
|
|
524
|
+
className="gap-2"
|
|
525
|
+
onClick={() =>
|
|
526
|
+
window.open(certificate.verificationUrl ?? '', '_blank')
|
|
527
|
+
}
|
|
528
|
+
>
|
|
529
|
+
<ExternalLink className="size-4" />
|
|
530
|
+
{t('cards.actions.verify')}
|
|
531
|
+
</Button>
|
|
532
|
+
) : null}
|
|
533
|
+
</div>
|
|
534
|
+
</CardContent>
|
|
535
|
+
</Card>
|
|
536
|
+
))}
|
|
537
|
+
</div>
|
|
538
|
+
)}
|
|
539
|
+
|
|
540
|
+
{!loading && totalItems > 0 ? (
|
|
541
|
+
<PaginationFooter
|
|
542
|
+
currentPage={currentPage}
|
|
543
|
+
pageSize={pageSize}
|
|
544
|
+
totalItems={totalItems}
|
|
545
|
+
onPageChange={setCurrentPage}
|
|
546
|
+
onPageSizeChange={(value) => {
|
|
547
|
+
setPageSize(value);
|
|
548
|
+
setCurrentPage(1);
|
|
549
|
+
}}
|
|
550
|
+
pageSizeOptions={PAGE_SIZES}
|
|
551
|
+
/>
|
|
552
|
+
) : null}
|
|
553
|
+
|
|
554
|
+
<Sheet open={isTemplateSheetOpen} onOpenChange={setIsTemplateSheetOpen}>
|
|
555
|
+
<SheetContent
|
|
556
|
+
side="right"
|
|
557
|
+
className="flex w-full flex-col sm:max-w-lg overflow-y-auto"
|
|
558
|
+
>
|
|
559
|
+
<SheetHeader>
|
|
560
|
+
<SheetTitle>{t('sheet.title')}</SheetTitle>
|
|
561
|
+
<SheetDescription>{t('sheet.description')}</SheetDescription>
|
|
562
|
+
</SheetHeader>
|
|
563
|
+
|
|
564
|
+
<div className="space-y-4 p-4">
|
|
565
|
+
<div className="space-y-2">
|
|
566
|
+
<label className="text-sm font-medium" htmlFor="template-name">
|
|
567
|
+
{t('sheet.fields.name')}
|
|
568
|
+
</label>
|
|
569
|
+
<Input
|
|
570
|
+
id="template-name"
|
|
571
|
+
value={templateName}
|
|
572
|
+
onChange={(event) => setTemplateName(event.target.value)}
|
|
573
|
+
placeholder={t('sheet.placeholders.name')}
|
|
574
|
+
/>
|
|
575
|
+
</div>
|
|
576
|
+
|
|
577
|
+
<div className="space-y-2">
|
|
578
|
+
<label
|
|
579
|
+
className="text-sm font-medium"
|
|
580
|
+
htmlFor="template-description"
|
|
581
|
+
>
|
|
582
|
+
{t('sheet.fields.description')}
|
|
583
|
+
</label>
|
|
584
|
+
<Textarea
|
|
585
|
+
id="template-description"
|
|
586
|
+
value={templateDescription}
|
|
587
|
+
onChange={(event) => setTemplateDescription(event.target.value)}
|
|
588
|
+
rows={4}
|
|
589
|
+
placeholder={t('sheet.placeholders.description')}
|
|
590
|
+
/>
|
|
591
|
+
</div>
|
|
592
|
+
|
|
593
|
+
<div className="space-y-2">
|
|
594
|
+
<p className="text-sm font-medium">{t('sheet.fields.status')}</p>
|
|
595
|
+
<Select
|
|
596
|
+
value={templateStatus}
|
|
597
|
+
onValueChange={(value) =>
|
|
598
|
+
setTemplateStatus(value as CertificateTemplateStatus)
|
|
599
|
+
}
|
|
600
|
+
>
|
|
601
|
+
<SelectTrigger className="w-full">
|
|
602
|
+
<SelectValue placeholder={t('sheet.fields.status')} />
|
|
603
|
+
</SelectTrigger>
|
|
604
|
+
<SelectContent>
|
|
605
|
+
<SelectItem value="draft">
|
|
606
|
+
{t('sheet.status.draft')}
|
|
607
|
+
</SelectItem>
|
|
608
|
+
<SelectItem value="active">
|
|
609
|
+
{t('sheet.status.active')}
|
|
610
|
+
</SelectItem>
|
|
611
|
+
<SelectItem value="inactive">
|
|
612
|
+
{t('sheet.status.inactive')}
|
|
613
|
+
</SelectItem>
|
|
614
|
+
</SelectContent>
|
|
615
|
+
</Select>
|
|
616
|
+
</div>
|
|
617
|
+
</div>
|
|
618
|
+
|
|
619
|
+
<SheetFooter className="flex-row justify-end gap-2">
|
|
620
|
+
<Button
|
|
621
|
+
type="button"
|
|
622
|
+
className="gap-2"
|
|
623
|
+
disabled={isCreatingTemplate}
|
|
624
|
+
onClick={createTemplate}
|
|
625
|
+
>
|
|
626
|
+
{isCreatingTemplate ? (
|
|
627
|
+
<Loader2 className="size-4 animate-spin" />
|
|
628
|
+
) : (
|
|
629
|
+
<FilePlus2 className="size-4" />
|
|
630
|
+
)}
|
|
631
|
+
{t('sheet.submit')}
|
|
632
|
+
</Button>
|
|
633
|
+
</SheetFooter>
|
|
634
|
+
</SheetContent>
|
|
635
|
+
</Sheet>
|
|
636
|
+
</Page>
|
|
637
|
+
);
|
|
638
|
+
}
|