@mui-toolpad-extended-tuni/courses 3.0.0
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 +320 -0
- package/dist/CourseCodeLoader.d.ts +15 -0
- package/dist/CourseEventPublisher.d.ts +8 -0
- package/dist/CourseInstanceLoader.d.ts +16 -0
- package/dist/CourseInstanceSelector.d.ts +15 -0
- package/dist/CourseItem/CourseActions.d.ts +6 -0
- package/dist/CourseItem/CourseHeader.d.ts +6 -0
- package/dist/CourseItem/CourseHeaderActions.d.ts +12 -0
- package/dist/CourseItem/CourseIcon.d.ts +8 -0
- package/dist/CourseItem/CourseInfo.d.ts +8 -0
- package/dist/CourseItem/CourseItem.d.ts +9 -0
- package/dist/CourseList.d.ts +6 -0
- package/dist/CourseManager.d.ts +2 -0
- package/dist/CourseMicroservice.d.ts +42 -0
- package/dist/CourseRoutesProvider.d.ts +12 -0
- package/dist/CourseTools.d.ts +21 -0
- package/dist/Forms/CourseSettings/CourseSettings.d.ts +23 -0
- package/dist/Forms/CourseSettings/CourseSettingsTabs.d.ts +9 -0
- package/dist/Forms/CourseSettings/tabs/BasicInfoTab.d.ts +7 -0
- package/dist/Forms/CourseSettings/tabs/DataProcessingTab.d.ts +24 -0
- package/dist/Forms/CourseSettings/tabs/EnrollmentTab.d.ts +28 -0
- package/dist/Forms/CourseSettings/tabs/RelationshipsTab.d.ts +25 -0
- package/dist/Forms/CourseSettings/tabs/StaffTab.d.ts +26 -0
- package/dist/Forms/CourseSettings/tabs/VisibilityTab.d.ts +24 -0
- package/dist/LtiLoginUrlForm.d.ts +3 -0
- package/dist/Navigation/CourseNavigationbuilder.d.ts +2 -0
- package/dist/components/ToolDisplayer/ToolCard.d.ts +8 -0
- package/dist/components/ToolDisplayer/ToolDisplayer.d.ts +11 -0
- package/dist/config/subjectConfig.d.ts +10 -0
- package/dist/context/CourseMicroserviceContext.d.ts +26 -0
- package/dist/hooks/useCourseRoutes.d.ts +6 -0
- package/dist/index.cjs +127 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.es.js +5594 -0
- package/dist/mocks/commented.d.ts +0 -0
- package/dist/mocks/constants.d.ts +9 -0
- package/dist/mocks/endpoints.d.ts +8 -0
- package/dist/mocks/generators.d.ts +19 -0
- package/dist/mocks/types.d.ts +109 -0
- package/dist/network/courses.d.ts +37 -0
- package/dist/store/useCourseStore.d.ts +146 -0
- package/dist/utils/courseFilters.d.ts +21 -0
- package/package.json +52 -0
package/README.md
ADDED
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
# @mui-toolpad-extended-tuni/courses
|
|
2
|
+
|
|
3
|
+
Courses microservice extension for MUI Toolpad Extended TUNI. This package provides course management functionality, course routing, course tools, and course-related components.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @mui-toolpad-extended-tuni/courses
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
**Note**: This package requires `mui-toolpad-extended-tuni@^3.0.0` as a peer dependency.
|
|
12
|
+
|
|
13
|
+
## Peer Dependencies
|
|
14
|
+
|
|
15
|
+
- `mui-toolpad-extended-tuni@^3.0.0`
|
|
16
|
+
- `react@^19.0.0`
|
|
17
|
+
- `react-dom@^19.0.0`
|
|
18
|
+
- `react-router-dom@^7.0.0`
|
|
19
|
+
- `@mui/material@^7.0.0`
|
|
20
|
+
- `@mui/icons-material@^7.0.0`
|
|
21
|
+
- `@mui/x-date-pickers@^7.0.0`
|
|
22
|
+
- `@emotion/react@^11.0.0`
|
|
23
|
+
- `@emotion/styled@^11.0.0`
|
|
24
|
+
- `axios@^1.7.0`
|
|
25
|
+
- `zustand@^4.5.0`
|
|
26
|
+
|
|
27
|
+
## Usage
|
|
28
|
+
|
|
29
|
+
### Basic Setup
|
|
30
|
+
|
|
31
|
+
The courses microservice automatically registers itself when imported:
|
|
32
|
+
|
|
33
|
+
```tsx
|
|
34
|
+
import { BrowserRouter } from 'react-router-dom';
|
|
35
|
+
import { LMSProvider, Microservices } from 'mui-toolpad-extended-tuni';
|
|
36
|
+
import { CourseMicroservice } from '@mui-toolpad-extended-tuni/courses';
|
|
37
|
+
|
|
38
|
+
function App() {
|
|
39
|
+
return (
|
|
40
|
+
<BrowserRouter>
|
|
41
|
+
<LMSProvider>
|
|
42
|
+
<Microservices>
|
|
43
|
+
<CourseMicroservice />
|
|
44
|
+
{/* Other microservices */}
|
|
45
|
+
</Microservices>
|
|
46
|
+
</LMSProvider>
|
|
47
|
+
</BrowserRouter>
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Using Course Store
|
|
53
|
+
|
|
54
|
+
```tsx
|
|
55
|
+
import { useCourseStore } from '@mui-toolpad-extended-tuni/courses';
|
|
56
|
+
|
|
57
|
+
function MyComponent() {
|
|
58
|
+
const { courses, learningCourses, teachingCourses, getCourses } = useCourseStore();
|
|
59
|
+
|
|
60
|
+
useEffect(() => {
|
|
61
|
+
getCourses();
|
|
62
|
+
}, [getCourses]);
|
|
63
|
+
|
|
64
|
+
return (
|
|
65
|
+
<div>
|
|
66
|
+
{learningCourses.map(course => (
|
|
67
|
+
<div key={course.id}>{course.title}</div>
|
|
68
|
+
))}
|
|
69
|
+
</div>
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Course Components
|
|
75
|
+
|
|
76
|
+
```tsx
|
|
77
|
+
import { CourseList, CourseItem, CourseTools } from '@mui-toolpad-extended-tuni/courses';
|
|
78
|
+
|
|
79
|
+
function CoursesPage() {
|
|
80
|
+
return (
|
|
81
|
+
<CourseList displayMode="course" />
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Course Navigation Builder
|
|
87
|
+
|
|
88
|
+
```tsx
|
|
89
|
+
import { CourseNavigationBuilder } from '@mui-toolpad-extended-tuni/courses';
|
|
90
|
+
|
|
91
|
+
function Navigation() {
|
|
92
|
+
return <CourseNavigationBuilder />;
|
|
93
|
+
}
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### Creating Custom Course Microservices
|
|
97
|
+
|
|
98
|
+
You can create custom microservices that integrate with the course system. Here's a complete example:
|
|
99
|
+
|
|
100
|
+
```tsx
|
|
101
|
+
import ScienceIcon from "@mui/icons-material/Science";
|
|
102
|
+
import { useMemo, useEffect } from "react";
|
|
103
|
+
import { NavigationPageStoreItem } from "mui-toolpad-extended-tuni";
|
|
104
|
+
import { useCourseMicroserviceRegistration } from '@mui-toolpad-extended-tuni/courses';
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Example: EduTest Course Microservice
|
|
108
|
+
*
|
|
109
|
+
* This demonstrates how to create a self-contained tool that integrates
|
|
110
|
+
* with the Course system. Must be rendered as a child of CourseMicroservice.
|
|
111
|
+
*/
|
|
112
|
+
const EduTest = () => {
|
|
113
|
+
const {
|
|
114
|
+
registerCourseMicroservice,
|
|
115
|
+
unregisterCourseMicroservice,
|
|
116
|
+
} = useCourseMicroserviceRegistration();
|
|
117
|
+
|
|
118
|
+
// Define navigation structure with nested routes
|
|
119
|
+
const eduTestNavigation: NavigationPageStoreItem = useMemo(
|
|
120
|
+
() => ({
|
|
121
|
+
kind: "page",
|
|
122
|
+
segment: "edutest",
|
|
123
|
+
title: "EduTest",
|
|
124
|
+
iconFC: ScienceIcon,
|
|
125
|
+
metadata: {
|
|
126
|
+
description: "EduTest is a microservice for testing",
|
|
127
|
+
forRoles: ["teacher", "student"],
|
|
128
|
+
isRootTool: true,
|
|
129
|
+
},
|
|
130
|
+
children: [
|
|
131
|
+
{
|
|
132
|
+
kind: "page",
|
|
133
|
+
segment: "dashboard",
|
|
134
|
+
title: "Dashboard",
|
|
135
|
+
view: DashboardView,
|
|
136
|
+
metadata: {
|
|
137
|
+
description: "Dashboard for EduTest",
|
|
138
|
+
forRoles: ["teacher", "student"],
|
|
139
|
+
},
|
|
140
|
+
children: [
|
|
141
|
+
{
|
|
142
|
+
kind: "page",
|
|
143
|
+
segment: "subdashboard",
|
|
144
|
+
title: "SubDashboard",
|
|
145
|
+
showTitle: false, // Hide title in UI
|
|
146
|
+
view: SubDashboardView,
|
|
147
|
+
metadata: {
|
|
148
|
+
description: "SubDashboard for EduTest",
|
|
149
|
+
forRoles: ["teacher", "student"],
|
|
150
|
+
},
|
|
151
|
+
},
|
|
152
|
+
],
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
kind: "page",
|
|
156
|
+
segment: "assignments",
|
|
157
|
+
title: "Assignments",
|
|
158
|
+
view: AssignmentsView,
|
|
159
|
+
metadata: {
|
|
160
|
+
description: "Assignments for EduTest",
|
|
161
|
+
forRoles: ["teacher", "student"],
|
|
162
|
+
},
|
|
163
|
+
},
|
|
164
|
+
],
|
|
165
|
+
}),
|
|
166
|
+
[]
|
|
167
|
+
);
|
|
168
|
+
|
|
169
|
+
useEffect(() => {
|
|
170
|
+
registerCourseMicroservice(eduTestNavigation);
|
|
171
|
+
return () => {
|
|
172
|
+
unregisterCourseMicroservice(eduTestNavigation.segment);
|
|
173
|
+
};
|
|
174
|
+
}, [registerCourseMicroservice, unregisterCourseMicroservice, eduTestNavigation]);
|
|
175
|
+
|
|
176
|
+
return null; // This component doesn't render anything
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
// Your view components
|
|
180
|
+
const DashboardView = () => <div>Dashboard View</div>;
|
|
181
|
+
const AssignmentsView = () => <div>Assignments View</div>;
|
|
182
|
+
const SubDashboardView = () => <div>SubDashboard View</div>;
|
|
183
|
+
|
|
184
|
+
export default EduTest;
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
**Usage in your app:**
|
|
188
|
+
|
|
189
|
+
```tsx
|
|
190
|
+
import { CourseMicroservice } from '@mui-toolpad-extended-tuni/courses';
|
|
191
|
+
import EduTest from './EduTest';
|
|
192
|
+
|
|
193
|
+
function App() {
|
|
194
|
+
return (
|
|
195
|
+
<CourseMicroservice>
|
|
196
|
+
<EduTest />
|
|
197
|
+
{/* Other course microservices */}
|
|
198
|
+
</CourseMicroservice>
|
|
199
|
+
);
|
|
200
|
+
}
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
This creates routes like:
|
|
204
|
+
- `/courses/:courseCode/:instance/edutest` - Shows tool selector
|
|
205
|
+
- `/courses/:courseCode/:instance/edutest/dashboard` - Shows Dashboard view
|
|
206
|
+
- `/courses/:courseCode/:instance/edutest/dashboard/subdashboard` - Shows SubDashboard view
|
|
207
|
+
- `/courses/:courseCode/:instance/edutest/assignments` - Shows Assignments view
|
|
208
|
+
|
|
209
|
+
## EventBus Integration with Calendar Package
|
|
210
|
+
|
|
211
|
+
The courses package automatically publishes course events to the EventBus, which the calendar package can consume for automatic calendar integration. **This integration is automatic** - no additional setup needed!
|
|
212
|
+
|
|
213
|
+
### How It Works
|
|
214
|
+
|
|
215
|
+
1. **Courses Package** includes `CourseEventPublisher` (automatically included in `CourseMicroservice`) which:
|
|
216
|
+
- Monitors course data from `useCourseStore`
|
|
217
|
+
- Converts course events (lectures, exercises, exams, deadlines) to generic calendar events
|
|
218
|
+
- Publishes them to the EventBus via `eventBus.publish('courses', events)`
|
|
219
|
+
|
|
220
|
+
2. **Calendar Package** includes `CalendarEventAggregator` (automatically included in `CalendarMicroservice`) which:
|
|
221
|
+
- Subscribes to EventBus events
|
|
222
|
+
- Converts generic events to calendar events with proper colors
|
|
223
|
+
- Updates the calendar display automatically
|
|
224
|
+
|
|
225
|
+
### Setup for EventBus Integration
|
|
226
|
+
|
|
227
|
+
Simply include both microservices - the integration happens automatically:
|
|
228
|
+
|
|
229
|
+
```tsx
|
|
230
|
+
import { BrowserRouter } from 'react-router-dom';
|
|
231
|
+
import { LMSProvider, Microservices } from 'mui-toolpad-extended-tuni';
|
|
232
|
+
import { CourseMicroservice } from '@mui-toolpad-extended-tuni/courses';
|
|
233
|
+
import { CalendarMicroservice } from '@mui-toolpad-extended-tuni/calendar';
|
|
234
|
+
|
|
235
|
+
function App() {
|
|
236
|
+
return (
|
|
237
|
+
<BrowserRouter>
|
|
238
|
+
<LMSProvider>
|
|
239
|
+
<Microservices>
|
|
240
|
+
{/* CourseEventPublisher is automatically included */}
|
|
241
|
+
<CourseMicroservice />
|
|
242
|
+
|
|
243
|
+
{/* CalendarEventAggregator is automatically included */}
|
|
244
|
+
<CalendarMicroservice />
|
|
245
|
+
</Microservices>
|
|
246
|
+
</LMSProvider>
|
|
247
|
+
</BrowserRouter>
|
|
248
|
+
);
|
|
249
|
+
}
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
**That's it!** When both packages are installed:
|
|
253
|
+
- ✅ Course events (lectures, exercises, exams, deadlines) are automatically published to the EventBus
|
|
254
|
+
- ✅ The calendar automatically receives and displays these events
|
|
255
|
+
- ✅ Events are color-coded by course subject and level
|
|
256
|
+
- ✅ No additional configuration needed - it works automatically!
|
|
257
|
+
|
|
258
|
+
### Event Structure
|
|
259
|
+
|
|
260
|
+
Course events are published with this structure:
|
|
261
|
+
|
|
262
|
+
```typescript
|
|
263
|
+
{
|
|
264
|
+
id: string;
|
|
265
|
+
title: string;
|
|
266
|
+
start: string; // ISO date string
|
|
267
|
+
end: string; // ISO date string
|
|
268
|
+
metadata: {
|
|
269
|
+
source: 'courses',
|
|
270
|
+
courseCode: string;
|
|
271
|
+
courseTitle: string;
|
|
272
|
+
subject: string;
|
|
273
|
+
courseLevel: 'basic' | 'intermediate' | 'advanced';
|
|
274
|
+
type: 'lecture' | 'exercise' | 'exam' | 'deadline' | 'other';
|
|
275
|
+
description?: string;
|
|
276
|
+
location?: string;
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
## Exports
|
|
282
|
+
|
|
283
|
+
### Components
|
|
284
|
+
- `CourseMicroservice` - Main microservice component
|
|
285
|
+
- `CourseList` - List of courses
|
|
286
|
+
- `CourseItem` - Individual course item
|
|
287
|
+
- `CourseTools` - Course tools displayer
|
|
288
|
+
- `CourseNavigationBuilder` - Navigation builder for courses
|
|
289
|
+
- `CourseCodeLoader` - Loader for course code routes
|
|
290
|
+
- `CourseInstanceLoader` - Loader for course instance routes
|
|
291
|
+
- `CourseInstanceSelector` - Selector for course instances
|
|
292
|
+
- `LtiLoginUrlForm` - LTI login URL form
|
|
293
|
+
|
|
294
|
+
### Hooks
|
|
295
|
+
- `useCourseMicroserviceRegistration` - Hook for registering custom course microservices (must be used within `CourseMicroservice` context)
|
|
296
|
+
|
|
297
|
+
### Store
|
|
298
|
+
- `useCourseStore` - Zustand store for course management
|
|
299
|
+
|
|
300
|
+
### Types
|
|
301
|
+
- `Course` - Course type
|
|
302
|
+
- `CourseRaw` - Raw course data type
|
|
303
|
+
- `courseRole` - Course role type
|
|
304
|
+
- `courseLevel` - Course level type
|
|
305
|
+
- `courseEventType` - Course event type
|
|
306
|
+
- `enrollmentStatus` - Enrollment status type
|
|
307
|
+
|
|
308
|
+
## Features
|
|
309
|
+
|
|
310
|
+
- Course management and CRUD operations
|
|
311
|
+
- Course enrollment handling
|
|
312
|
+
- Course navigation integration
|
|
313
|
+
- Course tools and microservices
|
|
314
|
+
- Course filtering and grouping
|
|
315
|
+
- Course instance support
|
|
316
|
+
- LTI integration support
|
|
317
|
+
|
|
318
|
+
## License
|
|
319
|
+
|
|
320
|
+
MIT
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** @format */
|
|
2
|
+
/**
|
|
3
|
+
* Component for loading and managing course code level data.
|
|
4
|
+
*
|
|
5
|
+
* @version 2.1.0
|
|
6
|
+
* @new-component
|
|
7
|
+
* - Handles course code level routing
|
|
8
|
+
* - Manages course code state in store
|
|
9
|
+
* - Provides course instance list context
|
|
10
|
+
* - Supports navigation between instances
|
|
11
|
+
* @description - This component is responsible for loading the course data and rendering the course tools
|
|
12
|
+
* @returns {React.ReactElement} - Returns the course loader component
|
|
13
|
+
*/
|
|
14
|
+
declare const CourseCodeLoader: () => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export default CourseCodeLoader;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** @format */
|
|
2
|
+
/**
|
|
3
|
+
* CourseEventPublisher publishes course events to the EventBus.
|
|
4
|
+
* This component converts course data to generic events and publishes them.
|
|
5
|
+
* It maintains separation by only knowing about courses and the EventBus API.
|
|
6
|
+
*/
|
|
7
|
+
declare const CourseEventPublisher: React.FC;
|
|
8
|
+
export default CourseEventPublisher;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** @format */
|
|
2
|
+
/**
|
|
3
|
+
* Component for loading specific course instance data.
|
|
4
|
+
*
|
|
5
|
+
* @version 2.1.0
|
|
6
|
+
* @new-component
|
|
7
|
+
* - Manages course instance state
|
|
8
|
+
* - Handles instance-specific data loading
|
|
9
|
+
* - Provides instance context to children
|
|
10
|
+
* - Supports microservice integration
|
|
11
|
+
* - Handles instance not found scenarios
|
|
12
|
+
* @description - This component is responsible for loading the course data and rendering the course tools
|
|
13
|
+
* @returns {React.ReactElement} - Returns the course loader component
|
|
14
|
+
*/
|
|
15
|
+
declare const CourseInstanceLoader: () => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export default CourseInstanceLoader;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** @format */
|
|
2
|
+
/**
|
|
3
|
+
* Component for selecting course instances from a filtered list.
|
|
4
|
+
*
|
|
5
|
+
* @version 2.1.0
|
|
6
|
+
* @new-component
|
|
7
|
+
* - Provides instance selection UI for courses
|
|
8
|
+
* - Groups instances by course code
|
|
9
|
+
* - Handles active/inactive instance states
|
|
10
|
+
* - Supports nested navigation structure
|
|
11
|
+
*
|
|
12
|
+
* @param {Course[]} courses - Available course instances
|
|
13
|
+
*/
|
|
14
|
+
declare const CourseInstanceSelector: () => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export default CourseInstanceSelector;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Course } from '../store/useCourseStore';
|
|
2
|
+
type CourseHeaderActionsProps = {
|
|
3
|
+
course: Course;
|
|
4
|
+
courseColor: string;
|
|
5
|
+
isTeacher: boolean;
|
|
6
|
+
showEnrollmentOpen?: boolean;
|
|
7
|
+
onSettingsClick: (e: React.MouseEvent<HTMLElement>) => void;
|
|
8
|
+
onEnroll?: (e: React.MouseEvent<HTMLElement>) => void;
|
|
9
|
+
onTeacherEnroll?: (e: React.MouseEvent<HTMLElement>) => void;
|
|
10
|
+
};
|
|
11
|
+
export declare const CourseHeaderActions: ({ course, courseColor, isTeacher, showEnrollmentOpen, onSettingsClick, onEnroll, onTeacherEnroll, }: CourseHeaderActionsProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { SvgIconComponent } from '@mui/icons-material';
|
|
2
|
+
export interface SubjectConfig {
|
|
3
|
+
icon: string;
|
|
4
|
+
baseColor: string;
|
|
5
|
+
levelShades: Record<string, string>;
|
|
6
|
+
}
|
|
7
|
+
export declare const createCourseIcon: (courseColor: string, config: SubjectConfig) => SvgIconComponent;
|
|
8
|
+
export default createCourseIcon;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Course } from '../store/useCourseStore';
|
|
2
|
+
type CourseInfoProps = {
|
|
3
|
+
course: Course;
|
|
4
|
+
displayMode: "course" | "instance" | "instanceList";
|
|
5
|
+
hasUpcomingEvents: boolean;
|
|
6
|
+
};
|
|
7
|
+
export declare const CourseInfo: ({ course, displayMode, hasUpcomingEvents, }: CourseInfoProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Course } from '../store/useCourseStore';
|
|
2
|
+
type CourseItemProps = {
|
|
3
|
+
course: Course;
|
|
4
|
+
isSelected?: boolean;
|
|
5
|
+
displayMode?: "course" | "instance" | "instanceList";
|
|
6
|
+
onClick: (course: Course) => void;
|
|
7
|
+
};
|
|
8
|
+
declare const CourseItem: ({ course, displayMode, onClick, }: CourseItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export default CourseItem;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
type CourseListProps = {
|
|
2
|
+
displayMode?: "course" | "instance" | "instanceList";
|
|
3
|
+
containerHeight?: string | number;
|
|
4
|
+
};
|
|
5
|
+
declare const CourseList: ({ displayMode, containerHeight, }: CourseListProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export default CourseList;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { default as React, ReactNode } from 'react';
|
|
2
|
+
interface CourseMicroserviceProps {
|
|
3
|
+
children?: ReactNode;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* CourseMicroservice Component
|
|
7
|
+
*
|
|
8
|
+
* @version 3.0.0
|
|
9
|
+
*
|
|
10
|
+
* Fully self-contained microservice that handles all course-related functionality:
|
|
11
|
+
* - Course data fetching and management (via CourseManager)
|
|
12
|
+
* - Course navigation building
|
|
13
|
+
* - Course code and instance routing (/:code, /:code/:instance)
|
|
14
|
+
* - Course tools display
|
|
15
|
+
* - Course microservice registration and routing (/:code/:instance/:microservice)
|
|
16
|
+
* - Route registration with NavigationRegistry (via CourseRoutesProvider)
|
|
17
|
+
*
|
|
18
|
+
* Course microservices (like EduTest) are passed as children and register
|
|
19
|
+
* themselves through the CourseMicroserviceContext.
|
|
20
|
+
*
|
|
21
|
+
* Routes handled:
|
|
22
|
+
* - /:code - Course code selection (CourseCodeLoader + CourseInstanceSelector)
|
|
23
|
+
* - /:code/:instance - Course instance (CourseInstanceLoader + CourseTools)
|
|
24
|
+
* - /:code/:instance/:microservice/* - Course microservice routes
|
|
25
|
+
*
|
|
26
|
+
* @breaking-changes
|
|
27
|
+
* - v3.0.0: Now fully self-contained - includes CourseManager and CourseRoutesProvider
|
|
28
|
+
* - v2.0.0: Uses local state instead of Zustand store
|
|
29
|
+
* - Context provides allCourseMicroserviceNavigation array
|
|
30
|
+
* - Integrates with useNavigationStore to notify about course microservices
|
|
31
|
+
* - v3.1.0: Context logic extracted to separate context file
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```tsx
|
|
35
|
+
* <CourseMicroservice>
|
|
36
|
+
* <EduTest />
|
|
37
|
+
* <EduTest2 />
|
|
38
|
+
* </CourseMicroservice>
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
declare const CourseMicroservice: React.FC<CourseMicroserviceProps>;
|
|
42
|
+
export default CourseMicroservice;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** @format */
|
|
2
|
+
/**
|
|
3
|
+
* CourseRoutesProvider Component
|
|
4
|
+
*
|
|
5
|
+
* Registers course routes with the NavigationRegistry as a route provider.
|
|
6
|
+
* This allows Microservices.tsx to be microservice-agnostic - it doesn't need
|
|
7
|
+
* to know about course routes specifically.
|
|
8
|
+
*
|
|
9
|
+
* @version 1.0.0
|
|
10
|
+
*/
|
|
11
|
+
declare const CourseRoutesProvider: () => null;
|
|
12
|
+
export default CourseRoutesProvider;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { NavigationPageStoreItem } from 'mui-toolpad-extended-tuni';
|
|
2
|
+
interface CourseToolsProps {
|
|
3
|
+
microservices?: NavigationPageStoreItem[];
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Component for managing and displaying course-specific tools.
|
|
7
|
+
*
|
|
8
|
+
* @version 2.1.0
|
|
9
|
+
* @updates
|
|
10
|
+
* - Added support for microservice-based tool management
|
|
11
|
+
* - Introduced enabled/available tools separation
|
|
12
|
+
* - Added service enablement/disablement functionality
|
|
13
|
+
* - Enhanced teacher-specific tool configuration
|
|
14
|
+
* - Improved UI with centered headings and tool groups
|
|
15
|
+
*
|
|
16
|
+
* @component
|
|
17
|
+
* @param {CourseToolsProps} props
|
|
18
|
+
* @param {NavigationPageStoreItem[]} props.microservices - Array of available microservice tools
|
|
19
|
+
*/
|
|
20
|
+
declare const CourseTools: ({ microservices }: CourseToolsProps) => import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export default CourseTools;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** @format */
|
|
2
|
+
/**
|
|
3
|
+
* CourseSettings Component
|
|
4
|
+
*
|
|
5
|
+
* @version 3.0.0
|
|
6
|
+
* @breaking-changes
|
|
7
|
+
* - Restructured import paths to follow feature-based organization
|
|
8
|
+
* - Enhanced notification handling through dedicated store
|
|
9
|
+
* - Improved dialog management with better state handling
|
|
10
|
+
* - Updated course store integration with new path structure
|
|
11
|
+
* - Enhanced TypeScript strict mode compliance
|
|
12
|
+
* - Standardized string literals for consistency
|
|
13
|
+
*
|
|
14
|
+
* Provides interface for:
|
|
15
|
+
* - Managing course basic information
|
|
16
|
+
* - Configuring course visibility
|
|
17
|
+
* - Managing enrollment settings
|
|
18
|
+
* - Configuring staff access
|
|
19
|
+
* - Setting data processing preferences
|
|
20
|
+
* - Managing course relationships
|
|
21
|
+
*/
|
|
22
|
+
declare const CourseSettings: () => import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export default CourseSettings;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CourseRaw } from '../../store/useCourseStore';
|
|
2
|
+
import { UserData } from 'mui-toolpad-extended-tuni';
|
|
3
|
+
type CourseSettingsProps = {
|
|
4
|
+
formData: CourseRaw;
|
|
5
|
+
handleUpdateFormData: (newData: CourseRaw) => void;
|
|
6
|
+
courseUsers?: UserData[];
|
|
7
|
+
};
|
|
8
|
+
export default function CourseSettingsTabs({ formData, handleUpdateFormData, courseUsers, }: CourseSettingsProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { CourseRaw } from '../../../store/useCourseStore';
|
|
2
|
+
interface BasicInfoTabProps {
|
|
3
|
+
formData: CourseRaw;
|
|
4
|
+
setFormData: (data: CourseRaw) => void;
|
|
5
|
+
}
|
|
6
|
+
export default function BasicInfoTab({ formData, setFormData, }: BasicInfoTabProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { CourseRaw } from '../../../store/useCourseStore';
|
|
2
|
+
interface DataProcessingTabProps {
|
|
3
|
+
formData: CourseRaw;
|
|
4
|
+
setFormData: (data: CourseRaw) => void;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* DataProcessingTab Component
|
|
8
|
+
*
|
|
9
|
+
* @version 3.0.0
|
|
10
|
+
* @breaking-changes
|
|
11
|
+
* - Updated component import paths to feature-based structure
|
|
12
|
+
* - Enhanced type safety for data processing options
|
|
13
|
+
* - Standardized string literals for legal bases
|
|
14
|
+
* - Improved default value handling
|
|
15
|
+
* - Added proper type definitions for processing settings
|
|
16
|
+
*
|
|
17
|
+
* Provides interface for:
|
|
18
|
+
* - Setting data processing legal basis
|
|
19
|
+
* - Managing special category data handling
|
|
20
|
+
* - Configuring retention periods
|
|
21
|
+
* - Setting data processing purposes
|
|
22
|
+
*/
|
|
23
|
+
export default function DataProcessingTab({ formData, setFormData, }: DataProcessingTabProps): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { UserData } from 'mui-toolpad-extended-tuni';
|
|
2
|
+
import { CourseRaw } from '../../../store/useCourseStore';
|
|
3
|
+
interface EnrollmentTabProps {
|
|
4
|
+
formData: CourseRaw;
|
|
5
|
+
setFormData: (data: CourseRaw) => void;
|
|
6
|
+
courseUsers?: UserData[];
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* EnrollmentTab Component
|
|
10
|
+
*
|
|
11
|
+
* @version 3.0.0
|
|
12
|
+
* @breaking-changes
|
|
13
|
+
* - Enhanced TypeScript string literal types
|
|
14
|
+
* - Improved student list management with better state handling
|
|
15
|
+
* - Updated styling for better visual hierarchy
|
|
16
|
+
* - Enhanced date handling with proper typing
|
|
17
|
+
* - Improved responsive design for mobile and desktop views
|
|
18
|
+
* - Added proper type definitions for enrollment statuses
|
|
19
|
+
*
|
|
20
|
+
* Provides interface for:
|
|
21
|
+
* - Managing course enrollment settings
|
|
22
|
+
* - Handling student enrollment requests
|
|
23
|
+
* - Setting enrollment periods
|
|
24
|
+
* - Managing enrollment capacity
|
|
25
|
+
* - Viewing enrolled and pending students
|
|
26
|
+
*/
|
|
27
|
+
export default function EnrollmentTab({ formData, setFormData, courseUsers: _courseUsers, }: EnrollmentTabProps): import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { CourseRaw } from '../../../store/useCourseStore';
|
|
2
|
+
interface RelationshipsTabProps {
|
|
3
|
+
formData: CourseRaw;
|
|
4
|
+
setFormData: (data: CourseRaw) => void;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* RelationshipsTab Component
|
|
8
|
+
*
|
|
9
|
+
* @version 3.0.0
|
|
10
|
+
* @breaking-changes
|
|
11
|
+
* - Updated course store import path to feature-based structure
|
|
12
|
+
* - Enhanced type definitions for course relationships
|
|
13
|
+
* - Standardized string literals for relationship types
|
|
14
|
+
* - Improved relationship type descriptions
|
|
15
|
+
* - Added better type safety for relationship management
|
|
16
|
+
*
|
|
17
|
+
* Provides interface for:
|
|
18
|
+
* - Managing course prerequisites
|
|
19
|
+
* - Setting up course continuations
|
|
20
|
+
* - Defining alternative courses
|
|
21
|
+
* - Managing course dependencies
|
|
22
|
+
* - Creating course relationship networks
|
|
23
|
+
*/
|
|
24
|
+
export default function RelationshipsTab({ formData, setFormData, }: RelationshipsTabProps): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { CourseRaw } from '../../../store/useCourseStore';
|
|
2
|
+
import { UserData } from 'mui-toolpad-extended-tuni';
|
|
3
|
+
interface StaffTabProps {
|
|
4
|
+
formData: CourseRaw;
|
|
5
|
+
setFormData: (data: CourseRaw) => void;
|
|
6
|
+
courseUsers?: UserData[];
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* StaffTab Component
|
|
10
|
+
*
|
|
11
|
+
* @version 3.0.0
|
|
12
|
+
* @breaking-changes
|
|
13
|
+
* - Updated course store import path to feature-based structure
|
|
14
|
+
* - Enhanced TypeScript type definitions for staff roles
|
|
15
|
+
* - Improved staff removal confirmation handling
|
|
16
|
+
* - Updated styling for better accessibility
|
|
17
|
+
* - Added proper aria labels for actions
|
|
18
|
+
*
|
|
19
|
+
* Provides interface for:
|
|
20
|
+
* - Managing course staff members
|
|
21
|
+
* - Adding/removing teaching staff
|
|
22
|
+
* - Viewing staff permissions
|
|
23
|
+
* - Managing staff roles
|
|
24
|
+
*/
|
|
25
|
+
export default function StaffTab({ formData, setFormData }: StaffTabProps): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
export {};
|