@hed-hog/lms 0.0.314 → 0.0.316
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/dist/enterprise/dto/enterprise-profile.dto.d.ts +13 -0
- package/dist/enterprise/dto/enterprise-profile.dto.d.ts.map +1 -0
- package/dist/enterprise/dto/enterprise-profile.dto.js +3 -0
- package/dist/enterprise/dto/enterprise-profile.dto.js.map +1 -0
- package/dist/enterprise/enterprise.controller.d.ts +3 -0
- package/dist/enterprise/enterprise.controller.d.ts.map +1 -1
- package/dist/enterprise/enterprise.controller.js +14 -0
- package/dist/enterprise/enterprise.controller.js.map +1 -1
- package/dist/enterprise/enterprise.service.d.ts +3 -0
- package/dist/enterprise/enterprise.service.d.ts.map +1 -1
- package/dist/enterprise/enterprise.service.js +128 -1
- package/dist/enterprise/enterprise.service.js.map +1 -1
- package/dist/instructor/instructor.controller.d.ts +23 -0
- package/dist/instructor/instructor.controller.d.ts.map +1 -1
- package/dist/instructor/instructor.controller.js +41 -0
- package/dist/instructor/instructor.controller.js.map +1 -1
- package/dist/instructor/instructor.service.d.ts +25 -0
- package/dist/instructor/instructor.service.d.ts.map +1 -1
- package/dist/instructor/instructor.service.js +126 -8
- package/dist/instructor/instructor.service.js.map +1 -1
- package/hedhog/data/menu.yaml +23 -7
- package/hedhog/data/role.yaml +17 -1
- package/hedhog/data/route.yaml +48 -0
- package/hedhog/frontend/app/_components/class-form-sheet.tsx.ejs +2 -1
- package/hedhog/frontend/app/courses/[id]/structure/_components/confirm-dialog.tsx.ejs +44 -44
- package/hedhog/frontend/app/courses/[id]/structure/_components/course-tree-dnd.tsx.ejs +362 -362
- package/hedhog/frontend/app/courses/[id]/structure/_components/course-tree-panel.tsx.ejs +111 -111
- package/hedhog/frontend/app/courses/[id]/structure/_components/course-tree.tsx.ejs +134 -134
- package/hedhog/frontend/app/courses/[id]/structure/_components/detail-course.tsx.ejs +113 -113
- package/hedhog/frontend/app/courses/[id]/structure/_components/detail-lesson.tsx.ejs +314 -314
- package/hedhog/frontend/app/courses/[id]/structure/_components/detail-panel.tsx.ejs +62 -62
- package/hedhog/frontend/app/courses/[id]/structure/_components/detail-session.tsx.ejs +173 -173
- package/hedhog/frontend/app/courses/[id]/structure/_components/drag-handle.tsx.ejs +58 -58
- package/hedhog/frontend/app/courses/[id]/structure/_components/drag-overlay.tsx.ejs +51 -51
- package/hedhog/frontend/app/courses/[id]/structure/_components/editor-bulk.tsx.ejs +276 -276
- package/hedhog/frontend/app/courses/[id]/structure/_components/editor-course.tsx.ejs +1216 -1216
- package/hedhog/frontend/app/courses/[id]/structure/_components/editor-lesson.tsx.ejs +1824 -1824
- package/hedhog/frontend/app/courses/[id]/structure/_components/editor-session.tsx.ejs +443 -443
- package/hedhog/frontend/app/courses/[id]/structure/_components/highlighted-text.tsx.ejs +40 -40
- package/hedhog/frontend/app/courses/[id]/structure/_components/mock-data.ts.ejs +185 -185
- package/hedhog/frontend/app/courses/[id]/structure/_components/multi-select-bar.tsx.ejs +264 -264
- package/hedhog/frontend/app/courses/[id]/structure/_components/search-filter.tsx.ejs +95 -95
- package/hedhog/frontend/app/courses/[id]/structure/_components/session-picker-dialog.tsx.ejs +73 -73
- package/hedhog/frontend/app/courses/[id]/structure/_components/shortcuts-help.tsx.ejs +136 -136
- package/hedhog/frontend/app/courses/[id]/structure/_components/sortable-tree-row.tsx.ejs +80 -80
- package/hedhog/frontend/app/courses/[id]/structure/_components/store.ts.ejs +949 -949
- package/hedhog/frontend/app/courses/[id]/structure/_components/tree-context-menu.tsx.ejs +525 -525
- package/hedhog/frontend/app/courses/[id]/structure/_components/tree-helpers.ts.ejs +181 -181
- package/hedhog/frontend/app/courses/[id]/structure/_components/tree-row-course.tsx.ejs +51 -51
- package/hedhog/frontend/app/courses/[id]/structure/_components/tree-row-lesson.tsx.ejs +271 -271
- package/hedhog/frontend/app/courses/[id]/structure/_components/tree-row-session.tsx.ejs +167 -167
- package/hedhog/frontend/app/courses/[id]/structure/_components/tree-row.tsx.ejs +108 -108
- package/hedhog/frontend/app/courses/[id]/structure/_components/use-course-structure-shortcuts.ts.ejs +318 -318
- package/hedhog/frontend/app/courses/[id]/structure/page.tsx.ejs +10 -10
- package/hedhog/frontend/app/enterprise/_components/enterprise-course-create-sheet.tsx.ejs +2 -1
- package/hedhog/frontend/app/instructors/_components/instructor-form-sheet.tsx.ejs +438 -0
- package/hedhog/frontend/app/instructors/_components/instructor-types.ts.ejs +40 -0
- package/hedhog/frontend/app/instructors/page.tsx.ejs +696 -0
- package/hedhog/frontend/app/training/page.tsx.ejs +2339 -0
- package/hedhog/query/add_route_role.sql +15 -0
- package/hedhog/table/enterprise_user.yaml +1 -1
- package/package.json +6 -6
- package/src/enterprise/dto/enterprise-profile.dto.ts +17 -0
- package/src/enterprise/enterprise.controller.ts +9 -1
- package/src/enterprise/enterprise.service.ts +147 -4
- package/src/instructor/instructor.controller.ts +36 -9
- package/src/instructor/instructor.service.ts +140 -10
|
@@ -1,80 +1,80 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { useSortable } from '@dnd-kit/sortable';
|
|
4
|
-
import { CSS } from '@dnd-kit/utilities';
|
|
5
|
-
|
|
6
|
-
import { DragHandle } from './drag-handle';
|
|
7
|
-
import { TreeRow } from './tree-row';
|
|
8
|
-
import type { FlatItem } from './types';
|
|
9
|
-
|
|
10
|
-
interface SortableTreeRowProps {
|
|
11
|
-
item: FlatItem;
|
|
12
|
-
isActive: boolean;
|
|
13
|
-
isSelected: boolean;
|
|
14
|
-
query: string;
|
|
15
|
-
isMatched: boolean;
|
|
16
|
-
isEffectivelyExpanded: boolean;
|
|
17
|
-
lessonCountMap: Map<string, number>;
|
|
18
|
-
visibleItems: FlatItem[];
|
|
19
|
-
/** When true (filter active) drag is disabled. */
|
|
20
|
-
dragDisabled: boolean;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export function SortableTreeRow({
|
|
24
|
-
item,
|
|
25
|
-
isActive,
|
|
26
|
-
isSelected,
|
|
27
|
-
query,
|
|
28
|
-
isMatched,
|
|
29
|
-
isEffectivelyExpanded,
|
|
30
|
-
lessonCountMap,
|
|
31
|
-
visibleItems,
|
|
32
|
-
dragDisabled,
|
|
33
|
-
}: SortableTreeRowProps) {
|
|
34
|
-
const {
|
|
35
|
-
attributes,
|
|
36
|
-
listeners,
|
|
37
|
-
setNodeRef,
|
|
38
|
-
transform,
|
|
39
|
-
transition,
|
|
40
|
-
isDragging,
|
|
41
|
-
} = useSortable({
|
|
42
|
-
id: `${item.type}:${item.id}`,
|
|
43
|
-
disabled: dragDisabled || item.type === 'course',
|
|
44
|
-
data: { item },
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
const style: React.CSSProperties = {
|
|
48
|
-
transform: CSS.Transform.toString(transform),
|
|
49
|
-
transition,
|
|
50
|
-
opacity: isDragging ? 0.35 : undefined,
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
return (
|
|
54
|
-
<div ref={setNodeRef} style={style} className="flex items-stretch h-full">
|
|
55
|
-
{/* Drag handle — only for sortable types */}
|
|
56
|
-
{item.type !== 'course' && (
|
|
57
|
-
<DragHandle
|
|
58
|
-
listeners={listeners}
|
|
59
|
-
attributes={attributes}
|
|
60
|
-
disabled={dragDisabled}
|
|
61
|
-
className="my-auto"
|
|
62
|
-
/>
|
|
63
|
-
)}
|
|
64
|
-
|
|
65
|
-
{/* Row content fills remaining space */}
|
|
66
|
-
<div className="flex-1 min-w-0">
|
|
67
|
-
<TreeRow
|
|
68
|
-
item={item}
|
|
69
|
-
isActive={isActive}
|
|
70
|
-
isSelected={isSelected}
|
|
71
|
-
query={query}
|
|
72
|
-
isMatched={isMatched}
|
|
73
|
-
isEffectivelyExpanded={isEffectivelyExpanded}
|
|
74
|
-
lessonCountMap={lessonCountMap}
|
|
75
|
-
visibleItems={visibleItems}
|
|
76
|
-
/>
|
|
77
|
-
</div>
|
|
78
|
-
</div>
|
|
79
|
-
);
|
|
80
|
-
}
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { useSortable } from '@dnd-kit/sortable';
|
|
4
|
+
import { CSS } from '@dnd-kit/utilities';
|
|
5
|
+
|
|
6
|
+
import { DragHandle } from './drag-handle';
|
|
7
|
+
import { TreeRow } from './tree-row';
|
|
8
|
+
import type { FlatItem } from './types';
|
|
9
|
+
|
|
10
|
+
interface SortableTreeRowProps {
|
|
11
|
+
item: FlatItem;
|
|
12
|
+
isActive: boolean;
|
|
13
|
+
isSelected: boolean;
|
|
14
|
+
query: string;
|
|
15
|
+
isMatched: boolean;
|
|
16
|
+
isEffectivelyExpanded: boolean;
|
|
17
|
+
lessonCountMap: Map<string, number>;
|
|
18
|
+
visibleItems: FlatItem[];
|
|
19
|
+
/** When true (filter active) drag is disabled. */
|
|
20
|
+
dragDisabled: boolean;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function SortableTreeRow({
|
|
24
|
+
item,
|
|
25
|
+
isActive,
|
|
26
|
+
isSelected,
|
|
27
|
+
query,
|
|
28
|
+
isMatched,
|
|
29
|
+
isEffectivelyExpanded,
|
|
30
|
+
lessonCountMap,
|
|
31
|
+
visibleItems,
|
|
32
|
+
dragDisabled,
|
|
33
|
+
}: SortableTreeRowProps) {
|
|
34
|
+
const {
|
|
35
|
+
attributes,
|
|
36
|
+
listeners,
|
|
37
|
+
setNodeRef,
|
|
38
|
+
transform,
|
|
39
|
+
transition,
|
|
40
|
+
isDragging,
|
|
41
|
+
} = useSortable({
|
|
42
|
+
id: `${item.type}:${item.id}`,
|
|
43
|
+
disabled: dragDisabled || item.type === 'course',
|
|
44
|
+
data: { item },
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
const style: React.CSSProperties = {
|
|
48
|
+
transform: CSS.Transform.toString(transform),
|
|
49
|
+
transition,
|
|
50
|
+
opacity: isDragging ? 0.35 : undefined,
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
return (
|
|
54
|
+
<div ref={setNodeRef} style={style} className="flex items-stretch h-full">
|
|
55
|
+
{/* Drag handle — only for sortable types */}
|
|
56
|
+
{item.type !== 'course' && (
|
|
57
|
+
<DragHandle
|
|
58
|
+
listeners={listeners}
|
|
59
|
+
attributes={attributes}
|
|
60
|
+
disabled={dragDisabled}
|
|
61
|
+
className="my-auto"
|
|
62
|
+
/>
|
|
63
|
+
)}
|
|
64
|
+
|
|
65
|
+
{/* Row content fills remaining space */}
|
|
66
|
+
<div className="flex-1 min-w-0">
|
|
67
|
+
<TreeRow
|
|
68
|
+
item={item}
|
|
69
|
+
isActive={isActive}
|
|
70
|
+
isSelected={isSelected}
|
|
71
|
+
query={query}
|
|
72
|
+
isMatched={isMatched}
|
|
73
|
+
isEffectivelyExpanded={isEffectivelyExpanded}
|
|
74
|
+
lessonCountMap={lessonCountMap}
|
|
75
|
+
visibleItems={visibleItems}
|
|
76
|
+
/>
|
|
77
|
+
</div>
|
|
78
|
+
</div>
|
|
79
|
+
);
|
|
80
|
+
}
|