@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,277 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
EnterpriseAccount,
|
|
3
|
+
EnterpriseClass,
|
|
4
|
+
EnterpriseCourse,
|
|
5
|
+
EnterpriseUser,
|
|
6
|
+
} from './enterprise-types';
|
|
7
|
+
|
|
8
|
+
// ── CRM Accounts (picker options) ─────────────────────────────────────────────
|
|
9
|
+
|
|
10
|
+
export const MOCK_CRM_ACCOUNTS = [
|
|
11
|
+
{ id: 101, name: 'Techcorp Brasil Ltda' },
|
|
12
|
+
{ id: 102, name: 'Grupo Atlas S.A.' },
|
|
13
|
+
{ id: 103, name: 'Horizonte Engenharia Ltda' },
|
|
14
|
+
{ id: 104, name: 'MedPlus Saúde S.A.' },
|
|
15
|
+
{ id: 105, name: 'Agro Prime Comércio Ltda' },
|
|
16
|
+
{ id: 106, name: 'LogTech Transportes Ltda' },
|
|
17
|
+
{ id: 107, name: 'Inova Tech S.A.' },
|
|
18
|
+
{ id: 108, name: 'Dinâmica Consultoria Ltda' },
|
|
19
|
+
];
|
|
20
|
+
|
|
21
|
+
// ── Accounts ───────────────────────────────────────────────────────────────────
|
|
22
|
+
|
|
23
|
+
export const MOCK_ENTERPRISE_ACCOUNTS: EnterpriseAccount[] = [
|
|
24
|
+
{
|
|
25
|
+
id: 1,
|
|
26
|
+
name: 'Techcorp Brasil',
|
|
27
|
+
slug: 'techcorp-brasil',
|
|
28
|
+
status: 'active',
|
|
29
|
+
crmAccountId: 101,
|
|
30
|
+
crmAccountName: 'Techcorp Brasil Ltda',
|
|
31
|
+
portalEnabled: true,
|
|
32
|
+
usersCount: 120,
|
|
33
|
+
studentsCount: 104,
|
|
34
|
+
managersCount: 14,
|
|
35
|
+
adminsCount: 2,
|
|
36
|
+
coursesCount: 8,
|
|
37
|
+
classesCount: 3,
|
|
38
|
+
licenseLimit: 150,
|
|
39
|
+
notes: null,
|
|
40
|
+
createdAt: '2026-01-01T10:00:00Z',
|
|
41
|
+
updatedAt: '2026-04-10T08:30:00Z',
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
id: 2,
|
|
45
|
+
name: 'Grupo Financeiro Atlas',
|
|
46
|
+
slug: 'grupo-financeiro-atlas',
|
|
47
|
+
status: 'active',
|
|
48
|
+
crmAccountId: 102,
|
|
49
|
+
crmAccountName: 'Grupo Atlas S.A.',
|
|
50
|
+
portalEnabled: true,
|
|
51
|
+
usersCount: 250,
|
|
52
|
+
studentsCount: 220,
|
|
53
|
+
managersCount: 28,
|
|
54
|
+
adminsCount: 2,
|
|
55
|
+
coursesCount: 14,
|
|
56
|
+
classesCount: 5,
|
|
57
|
+
licenseLimit: 300,
|
|
58
|
+
notes: null,
|
|
59
|
+
createdAt: '2026-02-01T09:00:00Z',
|
|
60
|
+
updatedAt: '2026-04-15T11:00:00Z',
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
id: 3,
|
|
64
|
+
name: 'Construtora Horizonte',
|
|
65
|
+
slug: 'construtora-horizonte',
|
|
66
|
+
status: 'active',
|
|
67
|
+
crmAccountId: null,
|
|
68
|
+
crmAccountName: null,
|
|
69
|
+
portalEnabled: false,
|
|
70
|
+
usersCount: 60,
|
|
71
|
+
studentsCount: 52,
|
|
72
|
+
managersCount: 6,
|
|
73
|
+
adminsCount: 1,
|
|
74
|
+
coursesCount: 4,
|
|
75
|
+
classesCount: 2,
|
|
76
|
+
licenseLimit: 80,
|
|
77
|
+
notes: null,
|
|
78
|
+
createdAt: '2026-03-01T08:00:00Z',
|
|
79
|
+
updatedAt: '2026-04-01T09:00:00Z',
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
id: 4,
|
|
83
|
+
name: 'MedPlus Saúde',
|
|
84
|
+
slug: 'medplus-saude',
|
|
85
|
+
status: 'trial',
|
|
86
|
+
crmAccountId: 104,
|
|
87
|
+
crmAccountName: 'MedPlus Saúde S.A.',
|
|
88
|
+
portalEnabled: true,
|
|
89
|
+
usersCount: 30,
|
|
90
|
+
studentsCount: 28,
|
|
91
|
+
managersCount: 2,
|
|
92
|
+
adminsCount: 1,
|
|
93
|
+
coursesCount: 3,
|
|
94
|
+
classesCount: 1,
|
|
95
|
+
licenseLimit: 50,
|
|
96
|
+
notes: null,
|
|
97
|
+
createdAt: '2026-04-01T11:00:00Z',
|
|
98
|
+
updatedAt: '2026-04-18T14:00:00Z',
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
id: 5,
|
|
102
|
+
name: 'Agro Prime',
|
|
103
|
+
slug: 'agro-prime',
|
|
104
|
+
status: 'inactive',
|
|
105
|
+
crmAccountId: null,
|
|
106
|
+
crmAccountName: null,
|
|
107
|
+
portalEnabled: false,
|
|
108
|
+
usersCount: 0,
|
|
109
|
+
studentsCount: 0,
|
|
110
|
+
managersCount: 0,
|
|
111
|
+
adminsCount: 0,
|
|
112
|
+
coursesCount: 0,
|
|
113
|
+
classesCount: 0,
|
|
114
|
+
licenseLimit: null,
|
|
115
|
+
notes: null,
|
|
116
|
+
createdAt: '2025-09-01T14:00:00Z',
|
|
117
|
+
updatedAt: '2026-02-28T18:00:00Z',
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
id: 6,
|
|
121
|
+
name: 'LogTech Transportes',
|
|
122
|
+
slug: 'logtech-transportes',
|
|
123
|
+
status: 'active',
|
|
124
|
+
crmAccountId: 106,
|
|
125
|
+
crmAccountName: 'LogTech Transportes Ltda',
|
|
126
|
+
portalEnabled: true,
|
|
127
|
+
usersCount: 100,
|
|
128
|
+
studentsCount: 88,
|
|
129
|
+
managersCount: 10,
|
|
130
|
+
adminsCount: 2,
|
|
131
|
+
coursesCount: 6,
|
|
132
|
+
classesCount: 2,
|
|
133
|
+
licenseLimit: 120,
|
|
134
|
+
notes: null,
|
|
135
|
+
createdAt: '2026-01-15T09:30:00Z',
|
|
136
|
+
updatedAt: '2026-04-12T10:00:00Z',
|
|
137
|
+
},
|
|
138
|
+
];
|
|
139
|
+
|
|
140
|
+
// ── Users (linked to account id=1) ─────────────────────────────────────────────
|
|
141
|
+
|
|
142
|
+
export const MOCK_ENTERPRISE_USERS: EnterpriseUser[] = [
|
|
143
|
+
{
|
|
144
|
+
id: 1,
|
|
145
|
+
userId: 201,
|
|
146
|
+
name: 'Ana Beatriz Souza',
|
|
147
|
+
email: 'ana.souza@techcorp.com.br',
|
|
148
|
+
role: 'enterprise_admin',
|
|
149
|
+
status: 'active',
|
|
150
|
+
lastAccessAt: '2026-04-20T14:32:00Z',
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
id: 2,
|
|
154
|
+
userId: 202,
|
|
155
|
+
name: 'Carlos Eduardo Lima',
|
|
156
|
+
email: 'carlos.lima@techcorp.com.br',
|
|
157
|
+
role: 'hr_manager',
|
|
158
|
+
status: 'active',
|
|
159
|
+
lastAccessAt: '2026-04-19T09:15:00Z',
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
id: 3,
|
|
163
|
+
userId: 203,
|
|
164
|
+
name: 'Fernanda Oliveira',
|
|
165
|
+
email: 'fernanda.oliveira@techcorp.com.br',
|
|
166
|
+
role: 'student',
|
|
167
|
+
status: 'active',
|
|
168
|
+
lastAccessAt: '2026-04-18T16:00:00Z',
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
id: 4,
|
|
172
|
+
userId: 204,
|
|
173
|
+
name: 'Ricardo Mendes',
|
|
174
|
+
email: 'ricardo.mendes@techcorp.com.br',
|
|
175
|
+
role: 'student',
|
|
176
|
+
status: 'active',
|
|
177
|
+
lastAccessAt: '2026-04-17T11:45:00Z',
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
id: 5,
|
|
181
|
+
userId: 205,
|
|
182
|
+
name: 'Juliana Castro',
|
|
183
|
+
email: 'juliana.castro@techcorp.com.br',
|
|
184
|
+
role: 'viewer',
|
|
185
|
+
status: 'inactive',
|
|
186
|
+
lastAccessAt: null,
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
id: 6,
|
|
190
|
+
userId: 206,
|
|
191
|
+
name: 'Marcos Vinicius Santos',
|
|
192
|
+
email: 'marcos.santos@techcorp.com.br',
|
|
193
|
+
role: 'student',
|
|
194
|
+
status: 'pending',
|
|
195
|
+
lastAccessAt: null,
|
|
196
|
+
},
|
|
197
|
+
];
|
|
198
|
+
|
|
199
|
+
// ── Courses (linked to account id=1) ──────────────────────────────────────────
|
|
200
|
+
|
|
201
|
+
export const MOCK_ENTERPRISE_COURSES: EnterpriseCourse[] = [
|
|
202
|
+
{
|
|
203
|
+
id: 10,
|
|
204
|
+
title: 'Liderança e Gestão de Equipes',
|
|
205
|
+
slug: 'lideranca-gestao-equipes',
|
|
206
|
+
status: 'published',
|
|
207
|
+
modality: 'Online',
|
|
208
|
+
enrolledCount: 45,
|
|
209
|
+
completionRate: 72,
|
|
210
|
+
contractedAt: '2026-01-05T00:00:00Z',
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
id: 11,
|
|
214
|
+
title: 'Compliance e Ética Corporativa',
|
|
215
|
+
slug: 'compliance-etica-corporativa',
|
|
216
|
+
status: 'published',
|
|
217
|
+
modality: 'Híbrido',
|
|
218
|
+
enrolledCount: 104,
|
|
219
|
+
completionRate: 88,
|
|
220
|
+
contractedAt: '2026-01-05T00:00:00Z',
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
id: 12,
|
|
224
|
+
title: 'Segurança da Informação',
|
|
225
|
+
slug: 'seguranca-informacao',
|
|
226
|
+
status: 'published',
|
|
227
|
+
modality: 'Online',
|
|
228
|
+
enrolledCount: 98,
|
|
229
|
+
completionRate: 61,
|
|
230
|
+
contractedAt: '2026-02-01T00:00:00Z',
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
id: 13,
|
|
234
|
+
title: 'Agile & Scrum na Prática',
|
|
235
|
+
slug: 'agile-scrum-pratica',
|
|
236
|
+
status: 'draft',
|
|
237
|
+
modality: 'Presencial',
|
|
238
|
+
enrolledCount: 0,
|
|
239
|
+
completionRate: 0,
|
|
240
|
+
contractedAt: '2026-03-10T00:00:00Z',
|
|
241
|
+
},
|
|
242
|
+
];
|
|
243
|
+
|
|
244
|
+
// ── Classes / Turmas (linked to account id=1) ──────────────────────────────────
|
|
245
|
+
|
|
246
|
+
export const MOCK_ENTERPRISE_CLASSES: EnterpriseClass[] = [
|
|
247
|
+
{
|
|
248
|
+
id: 20,
|
|
249
|
+
code: 'T2026-LG-01',
|
|
250
|
+
courseTitle: 'Liderança e Gestão de Equipes',
|
|
251
|
+
startDate: '2026-03-01',
|
|
252
|
+
endDate: '2026-06-30',
|
|
253
|
+
enrolledCount: 45,
|
|
254
|
+
capacity: 50,
|
|
255
|
+
status: 'ongoing',
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
id: 21,
|
|
259
|
+
code: 'T2026-CE-01',
|
|
260
|
+
courseTitle: 'Compliance e Ética Corporativa',
|
|
261
|
+
startDate: '2026-01-10',
|
|
262
|
+
endDate: '2026-04-10',
|
|
263
|
+
enrolledCount: 104,
|
|
264
|
+
capacity: 120,
|
|
265
|
+
status: 'completed',
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
id: 22,
|
|
269
|
+
code: 'T2026-SI-01',
|
|
270
|
+
courseTitle: 'Segurança da Informação',
|
|
271
|
+
startDate: '2026-04-15',
|
|
272
|
+
endDate: null,
|
|
273
|
+
enrolledCount: 98,
|
|
274
|
+
capacity: 100,
|
|
275
|
+
status: 'open',
|
|
276
|
+
},
|
|
277
|
+
];
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { useApp } from '@hed-hog/next-app-provider';
|
|
2
|
+
|
|
3
|
+
export type PersonPickerOption = {
|
|
4
|
+
id: number;
|
|
5
|
+
name: string;
|
|
6
|
+
email?: string | null;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export async function loadPersonOptions(
|
|
10
|
+
request: ReturnType<typeof useApp>['request'],
|
|
11
|
+
args: { page: number; pageSize: number; search: string }
|
|
12
|
+
) {
|
|
13
|
+
const params = new URLSearchParams({
|
|
14
|
+
page: String(args.page),
|
|
15
|
+
pageSize: String(args.pageSize),
|
|
16
|
+
search: args.search,
|
|
17
|
+
});
|
|
18
|
+
const res = await request<any>({
|
|
19
|
+
url: `/person?${params}`,
|
|
20
|
+
method: 'GET',
|
|
21
|
+
});
|
|
22
|
+
const body: any = (res as any).data ?? res;
|
|
23
|
+
const page: number = body.page ?? 1;
|
|
24
|
+
const lastPage: number = body.lastPage ?? 1;
|
|
25
|
+
const items: PersonPickerOption[] = (body.data ?? []).map((p: any) => ({
|
|
26
|
+
id: p.id,
|
|
27
|
+
name: p.name ?? '',
|
|
28
|
+
email: p.email ?? null,
|
|
29
|
+
}));
|
|
30
|
+
return { items, hasMore: page < lastPage };
|
|
31
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
export function ProgressBar({
|
|
4
|
+
value,
|
|
5
|
+
max,
|
|
6
|
+
colorClass = 'bg-primary',
|
|
7
|
+
}: {
|
|
8
|
+
value: number;
|
|
9
|
+
max: number;
|
|
10
|
+
colorClass?: string;
|
|
11
|
+
}) {
|
|
12
|
+
const pct = max === 0 ? 0 : Math.min(100, (value / max) * 100);
|
|
13
|
+
return (
|
|
14
|
+
<div className="h-1.5 w-full overflow-hidden rounded-full bg-muted">
|
|
15
|
+
<div
|
|
16
|
+
className={`h-full rounded-full transition-all ${colorClass}`}
|
|
17
|
+
style={{ width: `${pct}%` }}
|
|
18
|
+
/>
|
|
19
|
+
</div>
|
|
20
|
+
);
|
|
21
|
+
}
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { PaginationFooter } from '@/components/entity-list';
|
|
4
|
+
import { Button } from '@/components/ui/button';
|
|
5
|
+
import {
|
|
6
|
+
EntityPicker,
|
|
7
|
+
type EntityPickerLoadResult,
|
|
8
|
+
type EntityPickerValue,
|
|
9
|
+
} from '@/components/ui/entity-picker';
|
|
10
|
+
import { Input } from '@/components/ui/input';
|
|
11
|
+
import { Plus, Search } from 'lucide-react';
|
|
12
|
+
import { type ReactNode } from 'react';
|
|
13
|
+
|
|
14
|
+
// ── Types ─────────────────────────────────────────────────────────────────────
|
|
15
|
+
|
|
16
|
+
export type RelatedTabToolbarProps<TOption extends object> = {
|
|
17
|
+
// Search
|
|
18
|
+
search: string;
|
|
19
|
+
onSearchChange: (value: string) => void;
|
|
20
|
+
searchPlaceholder?: string;
|
|
21
|
+
|
|
22
|
+
// Filters slot — caller renders domain-specific <Select> elements here
|
|
23
|
+
filters?: ReactNode;
|
|
24
|
+
|
|
25
|
+
// EntityPicker binding
|
|
26
|
+
pickerPlaceholder: string;
|
|
27
|
+
pickerEntityLabel?: string;
|
|
28
|
+
pickerValue: EntityPickerValue;
|
|
29
|
+
onPickerChange: (value: EntityPickerValue, option: TOption | null) => void;
|
|
30
|
+
|
|
31
|
+
// Data source — use one of: loadPickerOptions (async) or pickerOptions (static)
|
|
32
|
+
loadPickerOptions?: (args: {
|
|
33
|
+
page: number;
|
|
34
|
+
pageSize: number;
|
|
35
|
+
search: string;
|
|
36
|
+
}) => Promise<EntityPickerLoadResult<TOption> | TOption[]>;
|
|
37
|
+
pickerOptions?: TOption[];
|
|
38
|
+
|
|
39
|
+
// Option accessors
|
|
40
|
+
getPickerOptionValue: (option: TOption) => string | number | null | undefined;
|
|
41
|
+
getPickerOptionLabel: (option: TOption) => string;
|
|
42
|
+
getPickerOptionDescription?: (option: TOption) => string | undefined;
|
|
43
|
+
renderPickerOption?: (args: {
|
|
44
|
+
option: TOption;
|
|
45
|
+
isSelected: boolean;
|
|
46
|
+
}) => ReactNode;
|
|
47
|
+
|
|
48
|
+
// Quick-create: caller is responsible for rendering the Sheet;
|
|
49
|
+
// this just exposes an icon button when the callback is provided.
|
|
50
|
+
onCreateNew?: () => void;
|
|
51
|
+
createLabel?: string;
|
|
52
|
+
|
|
53
|
+
// Optional slot rendered between the picker group and the Add button
|
|
54
|
+
// (e.g. a role selector that should be chosen before linking an entity)
|
|
55
|
+
pickerSuffix?: ReactNode;
|
|
56
|
+
|
|
57
|
+
// Add action
|
|
58
|
+
onAdd: () => void;
|
|
59
|
+
addLabel?: string;
|
|
60
|
+
addDisabled?: boolean;
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export type RelatedTabLayoutProps<TOption extends object> =
|
|
64
|
+
RelatedTabToolbarProps<TOption> & {
|
|
65
|
+
// Content slot — table/list rendered by the caller
|
|
66
|
+
children: ReactNode;
|
|
67
|
+
|
|
68
|
+
// Pagination
|
|
69
|
+
currentPage: number;
|
|
70
|
+
pageSize: number;
|
|
71
|
+
totalItems: number;
|
|
72
|
+
onPageChange: (page: number) => void;
|
|
73
|
+
onPageSizeChange: (pageSize: number) => void;
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
// ── RelatedTabToolbar ─────────────────────────────────────────────────────────
|
|
77
|
+
|
|
78
|
+
export function RelatedTabToolbar<TOption extends object>({
|
|
79
|
+
search,
|
|
80
|
+
onSearchChange,
|
|
81
|
+
searchPlaceholder = 'Search...',
|
|
82
|
+
filters,
|
|
83
|
+
pickerPlaceholder,
|
|
84
|
+
pickerEntityLabel,
|
|
85
|
+
pickerValue,
|
|
86
|
+
onPickerChange,
|
|
87
|
+
loadPickerOptions,
|
|
88
|
+
pickerOptions,
|
|
89
|
+
getPickerOptionValue,
|
|
90
|
+
getPickerOptionLabel,
|
|
91
|
+
getPickerOptionDescription,
|
|
92
|
+
renderPickerOption,
|
|
93
|
+
onCreateNew,
|
|
94
|
+
createLabel = 'Create new',
|
|
95
|
+
pickerSuffix,
|
|
96
|
+
onAdd,
|
|
97
|
+
addLabel = 'Add',
|
|
98
|
+
addDisabled = false,
|
|
99
|
+
}: RelatedTabToolbarProps<TOption>) {
|
|
100
|
+
return (
|
|
101
|
+
<div className="flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between">
|
|
102
|
+
{/* Left: search + caller-provided filters */}
|
|
103
|
+
<div className="flex flex-wrap items-center gap-2">
|
|
104
|
+
<div className="relative">
|
|
105
|
+
<Search className="pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-muted-foreground" />
|
|
106
|
+
<Input
|
|
107
|
+
placeholder={searchPlaceholder}
|
|
108
|
+
value={search}
|
|
109
|
+
onChange={(e) => onSearchChange(e.target.value)}
|
|
110
|
+
className="pl-9 sm:w-52"
|
|
111
|
+
/>
|
|
112
|
+
</div>
|
|
113
|
+
{filters}
|
|
114
|
+
</div>
|
|
115
|
+
|
|
116
|
+
{/* Right: EntityPicker → optional role/suffix → quick-create icon → Add */}
|
|
117
|
+
<div className="flex flex-wrap items-center gap-2">
|
|
118
|
+
<EntityPicker<TOption & Record<string, unknown>>
|
|
119
|
+
value={pickerValue}
|
|
120
|
+
onChange={
|
|
121
|
+
onPickerChange as (
|
|
122
|
+
v: EntityPickerValue,
|
|
123
|
+
o: (TOption & Record<string, unknown>) | null
|
|
124
|
+
) => void
|
|
125
|
+
}
|
|
126
|
+
placeholder={pickerPlaceholder}
|
|
127
|
+
entityLabel={pickerEntityLabel}
|
|
128
|
+
showCreateButton={false}
|
|
129
|
+
clearable
|
|
130
|
+
loadOptions={
|
|
131
|
+
loadPickerOptions as
|
|
132
|
+
| ((args: {
|
|
133
|
+
page: number;
|
|
134
|
+
pageSize: number;
|
|
135
|
+
search: string;
|
|
136
|
+
}) => Promise<
|
|
137
|
+
| EntityPickerLoadResult<TOption & Record<string, unknown>>
|
|
138
|
+
| (TOption & Record<string, unknown>)[]
|
|
139
|
+
>)
|
|
140
|
+
| undefined
|
|
141
|
+
}
|
|
142
|
+
options={
|
|
143
|
+
pickerOptions as (TOption & Record<string, unknown>)[] | undefined
|
|
144
|
+
}
|
|
145
|
+
getOptionValue={
|
|
146
|
+
getPickerOptionValue as (
|
|
147
|
+
o: TOption & Record<string, unknown>
|
|
148
|
+
) => string | number | null | undefined
|
|
149
|
+
}
|
|
150
|
+
getOptionLabel={
|
|
151
|
+
getPickerOptionLabel as (
|
|
152
|
+
o: TOption & Record<string, unknown>
|
|
153
|
+
) => string
|
|
154
|
+
}
|
|
155
|
+
getOptionDescription={
|
|
156
|
+
getPickerOptionDescription as
|
|
157
|
+
| ((o: TOption & Record<string, unknown>) => string | undefined)
|
|
158
|
+
| undefined
|
|
159
|
+
}
|
|
160
|
+
renderOption={
|
|
161
|
+
renderPickerOption as
|
|
162
|
+
| ((args: {
|
|
163
|
+
option: TOption & Record<string, unknown>;
|
|
164
|
+
isSelected: boolean;
|
|
165
|
+
}) => ReactNode)
|
|
166
|
+
| undefined
|
|
167
|
+
}
|
|
168
|
+
buttonClassName="min-w-52 max-w-64"
|
|
169
|
+
/>
|
|
170
|
+
|
|
171
|
+
{/* Suffix slot: e.g. role selector that must be chosen before linking */}
|
|
172
|
+
{pickerSuffix}
|
|
173
|
+
|
|
174
|
+
{onCreateNew && (
|
|
175
|
+
<Button
|
|
176
|
+
variant="ghost"
|
|
177
|
+
size="icon"
|
|
178
|
+
onClick={onCreateNew}
|
|
179
|
+
aria-label={createLabel}
|
|
180
|
+
title={createLabel}
|
|
181
|
+
className="shrink-0"
|
|
182
|
+
>
|
|
183
|
+
<Plus className="h-4 w-4" />
|
|
184
|
+
</Button>
|
|
185
|
+
)}
|
|
186
|
+
|
|
187
|
+
<Button
|
|
188
|
+
onClick={onAdd}
|
|
189
|
+
disabled={addDisabled}
|
|
190
|
+
size="sm"
|
|
191
|
+
className="shrink-0"
|
|
192
|
+
>
|
|
193
|
+
{addLabel}
|
|
194
|
+
</Button>
|
|
195
|
+
</div>
|
|
196
|
+
</div>
|
|
197
|
+
);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
// ── RelatedTabLayout ──────────────────────────────────────────────────────────
|
|
201
|
+
|
|
202
|
+
export function RelatedTabLayout<TOption extends object>({
|
|
203
|
+
children,
|
|
204
|
+
currentPage,
|
|
205
|
+
pageSize,
|
|
206
|
+
totalItems,
|
|
207
|
+
onPageChange,
|
|
208
|
+
onPageSizeChange,
|
|
209
|
+
...toolbarProps
|
|
210
|
+
}: RelatedTabLayoutProps<TOption>) {
|
|
211
|
+
return (
|
|
212
|
+
<div className="flex flex-col gap-4">
|
|
213
|
+
<RelatedTabToolbar {...toolbarProps} />
|
|
214
|
+
<div className="flex-1">{children}</div>
|
|
215
|
+
<PaginationFooter
|
|
216
|
+
currentPage={currentPage}
|
|
217
|
+
pageSize={pageSize}
|
|
218
|
+
totalItems={totalItems}
|
|
219
|
+
onPageChange={onPageChange}
|
|
220
|
+
onPageSizeChange={onPageSizeChange}
|
|
221
|
+
/>
|
|
222
|
+
</div>
|
|
223
|
+
);
|
|
224
|
+
}
|