@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,215 @@
|
|
|
1
|
+
import { Button } from '@/components/ui/button';
|
|
2
|
+
import { Progress } from '@/components/ui/progress';
|
|
3
|
+
import { cn } from '@/lib/utils';
|
|
4
|
+
import {
|
|
5
|
+
Eye,
|
|
6
|
+
FileImage,
|
|
7
|
+
ImagePlus,
|
|
8
|
+
Loader2,
|
|
9
|
+
UploadCloud,
|
|
10
|
+
} from 'lucide-react';
|
|
11
|
+
import { type ChangeEvent, useRef } from 'react';
|
|
12
|
+
|
|
13
|
+
import { CourseSectionCard } from './CourseSectionCard';
|
|
14
|
+
import type { TranslationFn } from './course-edit-types';
|
|
15
|
+
|
|
16
|
+
type MediaFile = {
|
|
17
|
+
id: number;
|
|
18
|
+
name: string;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
type MediaPaneProps = {
|
|
22
|
+
label: string;
|
|
23
|
+
description: string;
|
|
24
|
+
ratioClassName: string;
|
|
25
|
+
preview: string | null;
|
|
26
|
+
file?: MediaFile;
|
|
27
|
+
loading: boolean;
|
|
28
|
+
onSelect: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
29
|
+
onOpenFile?: () => void;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
function MediaPane({
|
|
33
|
+
label,
|
|
34
|
+
description,
|
|
35
|
+
ratioClassName,
|
|
36
|
+
preview,
|
|
37
|
+
file,
|
|
38
|
+
loading,
|
|
39
|
+
onSelect,
|
|
40
|
+
onOpenFile,
|
|
41
|
+
}: MediaPaneProps) {
|
|
42
|
+
const inputRef = useRef<HTMLInputElement>(null);
|
|
43
|
+
|
|
44
|
+
return (
|
|
45
|
+
<div className="space-y-3">
|
|
46
|
+
<div className="space-y-1">
|
|
47
|
+
<p className="text-sm font-medium text-foreground">{label}</p>
|
|
48
|
+
<p className="text-xs leading-5 text-muted-foreground">{description}</p>
|
|
49
|
+
</div>
|
|
50
|
+
|
|
51
|
+
<input
|
|
52
|
+
ref={inputRef}
|
|
53
|
+
type="file"
|
|
54
|
+
accept="image/*"
|
|
55
|
+
className="hidden"
|
|
56
|
+
onChange={onSelect}
|
|
57
|
+
/>
|
|
58
|
+
|
|
59
|
+
<button
|
|
60
|
+
type="button"
|
|
61
|
+
className={cn(
|
|
62
|
+
'group relative block w-full overflow-hidden rounded-2xl border border-border/70 bg-gradient-to-br from-muted/40 to-background text-left transition-all hover:border-border hover:shadow-sm',
|
|
63
|
+
ratioClassName
|
|
64
|
+
)}
|
|
65
|
+
onClick={() => inputRef.current?.click()}
|
|
66
|
+
>
|
|
67
|
+
{preview ? (
|
|
68
|
+
<>
|
|
69
|
+
<img
|
|
70
|
+
src={preview}
|
|
71
|
+
alt={label}
|
|
72
|
+
className="h-full w-full object-cover transition-transform duration-200 group-hover:scale-[1.02]"
|
|
73
|
+
/>
|
|
74
|
+
<div className="absolute inset-x-0 bottom-0 bg-gradient-to-t from-black/70 via-black/10 to-transparent p-4">
|
|
75
|
+
<div className="flex flex-wrap gap-2">
|
|
76
|
+
<span className="rounded-full bg-white/15 px-2.5 py-1 text-xs font-medium text-white backdrop-blur">
|
|
77
|
+
Preview pronta
|
|
78
|
+
</span>
|
|
79
|
+
<span className="rounded-full bg-white/15 px-2.5 py-1 text-xs font-medium text-white backdrop-blur">
|
|
80
|
+
Clique para substituir
|
|
81
|
+
</span>
|
|
82
|
+
</div>
|
|
83
|
+
</div>
|
|
84
|
+
</>
|
|
85
|
+
) : (
|
|
86
|
+
<div className="flex h-full flex-col items-center justify-center gap-3 px-6 text-center">
|
|
87
|
+
<div className="flex h-12 w-12 items-center justify-center rounded-2xl border border-border/70 bg-background/80 text-muted-foreground">
|
|
88
|
+
<ImagePlus className="h-5 w-5" />
|
|
89
|
+
</div>
|
|
90
|
+
<div className="space-y-1">
|
|
91
|
+
<p className="text-sm font-medium text-foreground">
|
|
92
|
+
Enviar {label.toLowerCase()}
|
|
93
|
+
</p>
|
|
94
|
+
<p className="text-xs leading-5 text-muted-foreground">
|
|
95
|
+
Clique para selecionar uma imagem.
|
|
96
|
+
</p>
|
|
97
|
+
</div>
|
|
98
|
+
</div>
|
|
99
|
+
)}
|
|
100
|
+
|
|
101
|
+
{loading ? (
|
|
102
|
+
<div className="absolute inset-0 flex flex-col items-center justify-center gap-3 bg-background/85">
|
|
103
|
+
<Loader2 className="h-5 w-5 animate-spin text-foreground" />
|
|
104
|
+
<div className="w-full max-w-[180px] space-y-2">
|
|
105
|
+
<Progress value={72} className="h-2" />
|
|
106
|
+
<p className="text-xs text-muted-foreground">Enviando arquivo...</p>
|
|
107
|
+
</div>
|
|
108
|
+
</div>
|
|
109
|
+
) : null}
|
|
110
|
+
</button>
|
|
111
|
+
|
|
112
|
+
<div className="rounded-2xl border border-border/60 bg-muted/20 p-3">
|
|
113
|
+
<div className="flex items-start gap-3">
|
|
114
|
+
<div className="flex h-9 w-9 shrink-0 items-center justify-center rounded-xl border border-border/60 bg-background text-muted-foreground">
|
|
115
|
+
<FileImage className="h-4 w-4" />
|
|
116
|
+
</div>
|
|
117
|
+
<div className="min-w-0 flex-1">
|
|
118
|
+
<p className="truncate text-sm font-medium text-foreground">
|
|
119
|
+
{file?.name || 'Nenhum arquivo vinculado'}
|
|
120
|
+
</p>
|
|
121
|
+
<p className="text-xs text-muted-foreground">
|
|
122
|
+
{file ? 'Arquivo pronto para uso.' : 'Ainda sem mídia vinculada.'}
|
|
123
|
+
</p>
|
|
124
|
+
</div>
|
|
125
|
+
</div>
|
|
126
|
+
|
|
127
|
+
<div className="mt-3 flex flex-wrap gap-2">
|
|
128
|
+
<Button
|
|
129
|
+
type="button"
|
|
130
|
+
variant="outline"
|
|
131
|
+
size="sm"
|
|
132
|
+
className="gap-2"
|
|
133
|
+
onClick={() => inputRef.current?.click()}
|
|
134
|
+
>
|
|
135
|
+
<UploadCloud className="h-4 w-4" />
|
|
136
|
+
{preview ? 'Substituir' : 'Enviar'}
|
|
137
|
+
</Button>
|
|
138
|
+
|
|
139
|
+
{file && onOpenFile ? (
|
|
140
|
+
<Button
|
|
141
|
+
type="button"
|
|
142
|
+
variant="ghost"
|
|
143
|
+
size="sm"
|
|
144
|
+
className="gap-2"
|
|
145
|
+
onClick={onOpenFile}
|
|
146
|
+
>
|
|
147
|
+
<Eye className="h-4 w-4" />
|
|
148
|
+
Visualizar
|
|
149
|
+
</Button>
|
|
150
|
+
) : null}
|
|
151
|
+
</div>
|
|
152
|
+
</div>
|
|
153
|
+
</div>
|
|
154
|
+
);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
type CourseMediaCardProps = {
|
|
158
|
+
logoPreview: string | null;
|
|
159
|
+
bannerPreview: string | null;
|
|
160
|
+
uploadingLogo: boolean;
|
|
161
|
+
uploadingBanner: boolean;
|
|
162
|
+
onLogoSelect: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
163
|
+
onBannerSelect: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
164
|
+
logoFile?: MediaFile;
|
|
165
|
+
bannerFile?: MediaFile;
|
|
166
|
+
onOpenLogoFile?: () => void;
|
|
167
|
+
onOpenBannerFile?: () => void;
|
|
168
|
+
t: TranslationFn;
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
export function CourseMediaCard({
|
|
172
|
+
logoPreview,
|
|
173
|
+
bannerPreview,
|
|
174
|
+
uploadingLogo,
|
|
175
|
+
uploadingBanner,
|
|
176
|
+
onLogoSelect,
|
|
177
|
+
onBannerSelect,
|
|
178
|
+
logoFile,
|
|
179
|
+
bannerFile,
|
|
180
|
+
onOpenLogoFile,
|
|
181
|
+
onOpenBannerFile,
|
|
182
|
+
t,
|
|
183
|
+
}: CourseMediaCardProps) {
|
|
184
|
+
return (
|
|
185
|
+
<CourseSectionCard
|
|
186
|
+
title={t('form.media.title')}
|
|
187
|
+
description="Gerencie os ativos visuais do curso com preview e ações rápidas."
|
|
188
|
+
icon={FileImage}
|
|
189
|
+
>
|
|
190
|
+
<div className="space-y-5">
|
|
191
|
+
<MediaPane
|
|
192
|
+
label={t('form.fields.banner.label')}
|
|
193
|
+
description={t('form.fields.banner.description')}
|
|
194
|
+
ratioClassName="aspect-[16/9]"
|
|
195
|
+
preview={bannerPreview}
|
|
196
|
+
file={bannerFile}
|
|
197
|
+
loading={uploadingBanner}
|
|
198
|
+
onSelect={onBannerSelect}
|
|
199
|
+
onOpenFile={onOpenBannerFile}
|
|
200
|
+
/>
|
|
201
|
+
|
|
202
|
+
<MediaPane
|
|
203
|
+
label={t('form.fields.logo.label')}
|
|
204
|
+
description={t('form.fields.logo.description')}
|
|
205
|
+
ratioClassName="aspect-square max-w-[220px]"
|
|
206
|
+
preview={logoPreview}
|
|
207
|
+
file={logoFile}
|
|
208
|
+
loading={uploadingLogo}
|
|
209
|
+
onSelect={onLogoSelect}
|
|
210
|
+
onOpenFile={onOpenLogoFile}
|
|
211
|
+
/>
|
|
212
|
+
</div>
|
|
213
|
+
</CourseSectionCard>
|
|
214
|
+
);
|
|
215
|
+
}
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar';
|
|
2
|
+
import { Button } from '@/components/ui/button';
|
|
3
|
+
import { EntityPicker } from '@/components/ui/entity-picker';
|
|
4
|
+
import { Badge } from '@/components/ui/badge';
|
|
5
|
+
import { cn } from '@/lib/utils';
|
|
6
|
+
import { Grip, Plus, X } from 'lucide-react';
|
|
7
|
+
import { useMemo, useState } from 'react';
|
|
8
|
+
|
|
9
|
+
import type { PickerOption } from './course-edit-types';
|
|
10
|
+
|
|
11
|
+
type CourseMultiEntityPickerProps = {
|
|
12
|
+
value: string[];
|
|
13
|
+
options: PickerOption[];
|
|
14
|
+
placeholder: string;
|
|
15
|
+
entityLabel: string;
|
|
16
|
+
searchPlaceholder?: string;
|
|
17
|
+
emptyStateDescription?: string;
|
|
18
|
+
createActionLabel?: string;
|
|
19
|
+
createTitle?: string;
|
|
20
|
+
createDescription?: string;
|
|
21
|
+
onCreate?: (values: Record<string, string>) => Promise<PickerOption | null>;
|
|
22
|
+
onCreateClick?: () => void;
|
|
23
|
+
createFields?: Array<{
|
|
24
|
+
name: string;
|
|
25
|
+
label: string;
|
|
26
|
+
placeholder?: string;
|
|
27
|
+
required?: boolean;
|
|
28
|
+
}>;
|
|
29
|
+
mapSearchToCreateValues?: (search: string) => Record<string, string>;
|
|
30
|
+
onChange: (nextValue: string[]) => void;
|
|
31
|
+
emptyHint?: string;
|
|
32
|
+
renderOptionMeta?: boolean;
|
|
33
|
+
variant?: 'default' | 'instructor';
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
function getInitials(label: string) {
|
|
37
|
+
return label
|
|
38
|
+
.split(' ')
|
|
39
|
+
.filter(Boolean)
|
|
40
|
+
.slice(0, 2)
|
|
41
|
+
.map((part) => part[0]?.toUpperCase() ?? '')
|
|
42
|
+
.join('');
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export function CourseMultiEntityPicker({
|
|
46
|
+
value,
|
|
47
|
+
options,
|
|
48
|
+
placeholder,
|
|
49
|
+
entityLabel,
|
|
50
|
+
searchPlaceholder,
|
|
51
|
+
emptyStateDescription,
|
|
52
|
+
createActionLabel,
|
|
53
|
+
createTitle,
|
|
54
|
+
createDescription,
|
|
55
|
+
onCreate,
|
|
56
|
+
onCreateClick,
|
|
57
|
+
createFields,
|
|
58
|
+
mapSearchToCreateValues,
|
|
59
|
+
onChange,
|
|
60
|
+
emptyHint,
|
|
61
|
+
renderOptionMeta = false,
|
|
62
|
+
variant = 'default',
|
|
63
|
+
}: CourseMultiEntityPickerProps) {
|
|
64
|
+
const [pickerValue, setPickerValue] = useState('');
|
|
65
|
+
|
|
66
|
+
const optionByValue = useMemo(
|
|
67
|
+
() =>
|
|
68
|
+
options.reduce<Record<string, PickerOption>>((acc, option) => {
|
|
69
|
+
acc[option.value] = option;
|
|
70
|
+
return acc;
|
|
71
|
+
}, {}),
|
|
72
|
+
[options]
|
|
73
|
+
);
|
|
74
|
+
|
|
75
|
+
const selectedOptions = value
|
|
76
|
+
.map((item) => optionByValue[item])
|
|
77
|
+
.filter(Boolean) as PickerOption[];
|
|
78
|
+
|
|
79
|
+
return (
|
|
80
|
+
<div className="space-y-3">
|
|
81
|
+
<div className="flex items-start gap-2">
|
|
82
|
+
<EntityPicker<PickerOption>
|
|
83
|
+
value={pickerValue}
|
|
84
|
+
onChange={(nextValue) => {
|
|
85
|
+
const normalized = String(nextValue ?? '');
|
|
86
|
+
|
|
87
|
+
if (!normalized) {
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
if (!value.includes(normalized)) {
|
|
92
|
+
onChange([...value, normalized]);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
setPickerValue('');
|
|
96
|
+
}}
|
|
97
|
+
options={options}
|
|
98
|
+
placeholder={placeholder}
|
|
99
|
+
searchPlaceholder={searchPlaceholder ?? placeholder}
|
|
100
|
+
emptyStateDescription={emptyStateDescription}
|
|
101
|
+
entityLabel={entityLabel}
|
|
102
|
+
showCreateButton={Boolean(onCreate)}
|
|
103
|
+
onCreate={onCreate}
|
|
104
|
+
createFields={createFields}
|
|
105
|
+
createActionLabel={createActionLabel}
|
|
106
|
+
createTitle={createTitle}
|
|
107
|
+
createDescription={createDescription}
|
|
108
|
+
mapSearchToCreateValues={mapSearchToCreateValues}
|
|
109
|
+
getOptionValue={(option) => option.value}
|
|
110
|
+
getOptionLabel={(option) => option.label}
|
|
111
|
+
getOptionDescription={(option) =>
|
|
112
|
+
option.description || option.meta || undefined
|
|
113
|
+
}
|
|
114
|
+
renderOption={({ option }) => (
|
|
115
|
+
<div className="flex min-w-0 items-center gap-3 py-0.5">
|
|
116
|
+
{variant === 'instructor' ? (
|
|
117
|
+
<Avatar className="h-8 w-8 rounded-lg border border-border/60">
|
|
118
|
+
<AvatarImage src={option.avatarUrl ?? undefined} />
|
|
119
|
+
<AvatarFallback className="rounded-lg bg-muted text-[11px] font-semibold text-foreground">
|
|
120
|
+
{getInitials(option.label)}
|
|
121
|
+
</AvatarFallback>
|
|
122
|
+
</Avatar>
|
|
123
|
+
) : (
|
|
124
|
+
<div className="flex h-8 w-8 items-center justify-center rounded-lg border border-border/60 bg-muted/30 text-muted-foreground">
|
|
125
|
+
<Grip className="h-3.5 w-3.5" />
|
|
126
|
+
</div>
|
|
127
|
+
)}
|
|
128
|
+
|
|
129
|
+
<div className="min-w-0">
|
|
130
|
+
<div className="truncate text-sm font-medium text-foreground">
|
|
131
|
+
{option.label}
|
|
132
|
+
</div>
|
|
133
|
+
{renderOptionMeta && option.meta ? (
|
|
134
|
+
<div className="truncate text-xs text-muted-foreground">
|
|
135
|
+
{option.meta}
|
|
136
|
+
</div>
|
|
137
|
+
) : option.description ? (
|
|
138
|
+
<div className="truncate text-xs text-muted-foreground">
|
|
139
|
+
{option.description}
|
|
140
|
+
</div>
|
|
141
|
+
) : null}
|
|
142
|
+
</div>
|
|
143
|
+
</div>
|
|
144
|
+
)}
|
|
145
|
+
className="min-w-0 flex-1"
|
|
146
|
+
/>
|
|
147
|
+
|
|
148
|
+
{onCreateClick ? (
|
|
149
|
+
<Button
|
|
150
|
+
type="button"
|
|
151
|
+
variant="outline"
|
|
152
|
+
size="icon"
|
|
153
|
+
className="h-10 w-10 shrink-0 rounded-xl"
|
|
154
|
+
onClick={onCreateClick}
|
|
155
|
+
aria-label={createActionLabel ?? `Criar ${entityLabel}`}
|
|
156
|
+
>
|
|
157
|
+
<Plus className="h-4 w-4" />
|
|
158
|
+
</Button>
|
|
159
|
+
) : null}
|
|
160
|
+
</div>
|
|
161
|
+
|
|
162
|
+
{selectedOptions.length > 0 ? (
|
|
163
|
+
<div
|
|
164
|
+
className={cn(
|
|
165
|
+
'rounded-2xl border border-border/60 bg-muted/20 p-2.5',
|
|
166
|
+
variant === 'instructor' ? 'space-y-2' : 'flex flex-wrap gap-2'
|
|
167
|
+
)}
|
|
168
|
+
>
|
|
169
|
+
{selectedOptions.map((option) =>
|
|
170
|
+
variant === 'instructor' ? (
|
|
171
|
+
<div
|
|
172
|
+
key={option.value}
|
|
173
|
+
className="flex items-center justify-between gap-3 rounded-xl border border-border/60 bg-background px-3 py-2"
|
|
174
|
+
>
|
|
175
|
+
<div className="flex min-w-0 items-center gap-3">
|
|
176
|
+
<Avatar className="h-9 w-9 rounded-xl border border-border/60">
|
|
177
|
+
<AvatarImage src={option.avatarUrl ?? undefined} />
|
|
178
|
+
<AvatarFallback className="rounded-xl bg-muted text-xs font-semibold text-foreground">
|
|
179
|
+
{getInitials(option.label)}
|
|
180
|
+
</AvatarFallback>
|
|
181
|
+
</Avatar>
|
|
182
|
+
|
|
183
|
+
<div className="min-w-0">
|
|
184
|
+
<p className="truncate text-sm font-medium text-foreground">
|
|
185
|
+
{option.label}
|
|
186
|
+
</p>
|
|
187
|
+
{option.meta ? (
|
|
188
|
+
<p className="truncate text-xs text-muted-foreground">
|
|
189
|
+
{option.meta}
|
|
190
|
+
</p>
|
|
191
|
+
) : null}
|
|
192
|
+
</div>
|
|
193
|
+
</div>
|
|
194
|
+
|
|
195
|
+
<Button
|
|
196
|
+
type="button"
|
|
197
|
+
variant="ghost"
|
|
198
|
+
size="icon"
|
|
199
|
+
className="h-8 w-8 rounded-lg text-muted-foreground hover:text-foreground"
|
|
200
|
+
onClick={() =>
|
|
201
|
+
onChange(value.filter((item) => item !== option.value))
|
|
202
|
+
}
|
|
203
|
+
aria-label={`Remover ${option.label}`}
|
|
204
|
+
>
|
|
205
|
+
<X className="h-4 w-4" />
|
|
206
|
+
</Button>
|
|
207
|
+
</div>
|
|
208
|
+
) : (
|
|
209
|
+
<Badge
|
|
210
|
+
key={option.value}
|
|
211
|
+
variant="secondary"
|
|
212
|
+
className="flex items-center gap-1.5 rounded-full border border-border/60 bg-background px-3 py-1.5 text-xs font-medium text-foreground"
|
|
213
|
+
>
|
|
214
|
+
<span className="max-w-[180px] truncate">{option.label}</span>
|
|
215
|
+
<button
|
|
216
|
+
type="button"
|
|
217
|
+
className="cursor-pointer text-muted-foreground transition-colors hover:text-foreground"
|
|
218
|
+
onClick={() =>
|
|
219
|
+
onChange(value.filter((item) => item !== option.value))
|
|
220
|
+
}
|
|
221
|
+
aria-label={`Remover ${option.label}`}
|
|
222
|
+
>
|
|
223
|
+
<X className="h-3.5 w-3.5" />
|
|
224
|
+
</button>
|
|
225
|
+
</Badge>
|
|
226
|
+
)
|
|
227
|
+
)}
|
|
228
|
+
</div>
|
|
229
|
+
) : (
|
|
230
|
+
<div className="rounded-2xl border border-dashed border-border/70 bg-muted/15 px-4 py-3 text-sm text-muted-foreground">
|
|
231
|
+
{emptyHint ?? `Nenhum ${entityLabel.toLowerCase()} vinculado ainda.`}
|
|
232
|
+
</div>
|
|
233
|
+
)}
|
|
234
|
+
</div>
|
|
235
|
+
);
|
|
236
|
+
}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import {
|
|
2
|
+
FormControl,
|
|
3
|
+
FormField,
|
|
4
|
+
FormItem,
|
|
5
|
+
FormLabel,
|
|
6
|
+
FormMessage,
|
|
7
|
+
} from '@/components/ui/form';
|
|
8
|
+
import { Textarea } from '@/components/ui/textarea';
|
|
9
|
+
import { Network } from 'lucide-react';
|
|
10
|
+
import type { UseFormReturn } from 'react-hook-form';
|
|
11
|
+
|
|
12
|
+
import { CourseMultiEntityPicker } from './CourseMultiEntityPicker';
|
|
13
|
+
import { CourseSectionCard } from './CourseSectionCard';
|
|
14
|
+
import type {
|
|
15
|
+
CourseEditFormValues,
|
|
16
|
+
PickerOption,
|
|
17
|
+
TranslationFn,
|
|
18
|
+
} from './course-edit-types';
|
|
19
|
+
|
|
20
|
+
type CourseRelationsCardProps = {
|
|
21
|
+
form: UseFormReturn<CourseEditFormValues>;
|
|
22
|
+
t: TranslationFn;
|
|
23
|
+
categoryOptions: PickerOption[];
|
|
24
|
+
instructorOptions: PickerOption[];
|
|
25
|
+
onCreateCategory: (values: Record<string, string>) => Promise<PickerOption | null>;
|
|
26
|
+
onCreateInstructor: () => void;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export function CourseRelationsCard({
|
|
30
|
+
form,
|
|
31
|
+
t,
|
|
32
|
+
categoryOptions,
|
|
33
|
+
instructorOptions,
|
|
34
|
+
onCreateCategory,
|
|
35
|
+
onCreateInstructor,
|
|
36
|
+
}: CourseRelationsCardProps) {
|
|
37
|
+
return (
|
|
38
|
+
<CourseSectionCard
|
|
39
|
+
title={t('form.sections.relations')}
|
|
40
|
+
description="Agrupe os vínculos que ajudam a encontrar, operar e ensinar este curso."
|
|
41
|
+
icon={Network}
|
|
42
|
+
>
|
|
43
|
+
<div className="space-y-5">
|
|
44
|
+
<FormField
|
|
45
|
+
control={form.control}
|
|
46
|
+
name="categorias"
|
|
47
|
+
render={({ field }) => (
|
|
48
|
+
<FormItem>
|
|
49
|
+
<FormLabel>{t('form.fields.categories.label')}</FormLabel>
|
|
50
|
+
<CourseMultiEntityPicker
|
|
51
|
+
value={field.value}
|
|
52
|
+
onChange={field.onChange}
|
|
53
|
+
options={categoryOptions}
|
|
54
|
+
placeholder={t('form.fields.categories.selectPlaceholder')}
|
|
55
|
+
searchPlaceholder={t('form.fields.categories.searchPlaceholder')}
|
|
56
|
+
entityLabel="categoria"
|
|
57
|
+
emptyStateDescription={t('form.fields.categories.noResults')}
|
|
58
|
+
emptyHint="Nenhuma categoria vinculada ainda."
|
|
59
|
+
createActionLabel="Criar categoria"
|
|
60
|
+
createTitle="Criar categoria"
|
|
61
|
+
createDescription="Cadastre uma categoria rapidamente sem sair da edição do curso."
|
|
62
|
+
createFields={[
|
|
63
|
+
{
|
|
64
|
+
name: 'name',
|
|
65
|
+
label: 'Nome da categoria',
|
|
66
|
+
placeholder: 'Ex: Desenvolvimento Web',
|
|
67
|
+
required: true,
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
name: 'slug',
|
|
71
|
+
label: 'Slug',
|
|
72
|
+
placeholder: 'desenvolvimento-web',
|
|
73
|
+
required: true,
|
|
74
|
+
},
|
|
75
|
+
]}
|
|
76
|
+
mapSearchToCreateValues={(search) => ({
|
|
77
|
+
name: search,
|
|
78
|
+
slug: search
|
|
79
|
+
.trim()
|
|
80
|
+
.toLowerCase()
|
|
81
|
+
.normalize('NFD')
|
|
82
|
+
.replace(/[\u0300-\u036f]/g, '')
|
|
83
|
+
.replace(/[^a-z0-9]+/g, '-')
|
|
84
|
+
.replace(/^-+|-+$/g, ''),
|
|
85
|
+
})}
|
|
86
|
+
onCreate={onCreateCategory}
|
|
87
|
+
/>
|
|
88
|
+
<FormMessage />
|
|
89
|
+
</FormItem>
|
|
90
|
+
)}
|
|
91
|
+
/>
|
|
92
|
+
|
|
93
|
+
<FormField
|
|
94
|
+
control={form.control}
|
|
95
|
+
name="instrutores"
|
|
96
|
+
render={({ field }) => (
|
|
97
|
+
<FormItem>
|
|
98
|
+
<FormLabel>{t('form.fields.instructors.label')}</FormLabel>
|
|
99
|
+
<CourseMultiEntityPicker
|
|
100
|
+
value={field.value}
|
|
101
|
+
onChange={field.onChange}
|
|
102
|
+
options={instructorOptions}
|
|
103
|
+
placeholder={t('form.fields.instructors.selectPlaceholder')}
|
|
104
|
+
searchPlaceholder={t('form.fields.instructors.searchPlaceholder')}
|
|
105
|
+
entityLabel="instrutor"
|
|
106
|
+
emptyStateDescription={t('form.fields.instructors.noResults')}
|
|
107
|
+
emptyHint="Nenhum instrutor vinculado ainda."
|
|
108
|
+
createActionLabel="Cadastrar instrutor"
|
|
109
|
+
onCreateClick={onCreateInstructor}
|
|
110
|
+
variant="instructor"
|
|
111
|
+
renderOptionMeta
|
|
112
|
+
/>
|
|
113
|
+
<FormMessage />
|
|
114
|
+
</FormItem>
|
|
115
|
+
)}
|
|
116
|
+
/>
|
|
117
|
+
|
|
118
|
+
<FormField
|
|
119
|
+
control={form.control}
|
|
120
|
+
name="preRequisitos"
|
|
121
|
+
render={({ field }) => (
|
|
122
|
+
<FormItem>
|
|
123
|
+
<FormLabel>{t('form.fields.prerequisites.label')}</FormLabel>
|
|
124
|
+
<FormControl>
|
|
125
|
+
<Textarea
|
|
126
|
+
{...field}
|
|
127
|
+
rows={3}
|
|
128
|
+
placeholder={t('form.fields.prerequisites.placeholder')}
|
|
129
|
+
/>
|
|
130
|
+
</FormControl>
|
|
131
|
+
<p className="text-sm text-muted-foreground">
|
|
132
|
+
{t('form.fields.prerequisites.description')}
|
|
133
|
+
</p>
|
|
134
|
+
<FormMessage />
|
|
135
|
+
</FormItem>
|
|
136
|
+
)}
|
|
137
|
+
/>
|
|
138
|
+
</div>
|
|
139
|
+
</CourseSectionCard>
|
|
140
|
+
);
|
|
141
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
|
|
2
|
+
import { cn } from '@/lib/utils';
|
|
3
|
+
import type { LucideIcon } from 'lucide-react';
|
|
4
|
+
import type { ReactNode } from 'react';
|
|
5
|
+
|
|
6
|
+
type CourseSectionCardProps = {
|
|
7
|
+
title: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
icon?: LucideIcon;
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
className?: string;
|
|
12
|
+
contentClassName?: string;
|
|
13
|
+
action?: ReactNode;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export function CourseSectionCard({
|
|
17
|
+
title,
|
|
18
|
+
description,
|
|
19
|
+
icon: Icon,
|
|
20
|
+
children,
|
|
21
|
+
className,
|
|
22
|
+
contentClassName,
|
|
23
|
+
action,
|
|
24
|
+
}: CourseSectionCardProps) {
|
|
25
|
+
return (
|
|
26
|
+
<Card className={cn('border-border/70 shadow-sm', className)}>
|
|
27
|
+
<CardHeader className="space-y-3 pb-4">
|
|
28
|
+
<div className="flex items-start justify-between gap-3">
|
|
29
|
+
<div className="flex min-w-0 items-start gap-3">
|
|
30
|
+
{Icon ? (
|
|
31
|
+
<div className="flex h-10 w-10 shrink-0 items-center justify-center rounded-xl border border-border/60 bg-muted/30 text-foreground">
|
|
32
|
+
<Icon className="h-4 w-4" />
|
|
33
|
+
</div>
|
|
34
|
+
) : null}
|
|
35
|
+
|
|
36
|
+
<div className="min-w-0 space-y-1">
|
|
37
|
+
<CardTitle className="text-base font-semibold tracking-tight">
|
|
38
|
+
{title}
|
|
39
|
+
</CardTitle>
|
|
40
|
+
{description ? (
|
|
41
|
+
<p className="text-sm leading-5 text-muted-foreground">
|
|
42
|
+
{description}
|
|
43
|
+
</p>
|
|
44
|
+
) : null}
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
|
|
48
|
+
{action ? <div className="shrink-0">{action}</div> : null}
|
|
49
|
+
</div>
|
|
50
|
+
</CardHeader>
|
|
51
|
+
|
|
52
|
+
<CardContent className={cn('pt-0', contentClassName)}>
|
|
53
|
+
{children}
|
|
54
|
+
</CardContent>
|
|
55
|
+
</Card>
|
|
56
|
+
);
|
|
57
|
+
}
|