@royalschedule/maps 4.0.24 → 4.0.25
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.
|
@@ -3,22 +3,19 @@ function courses_default(scheduledGroups, school, importErrors, importWarnings)
|
|
|
3
3
|
const courses = [];
|
|
4
4
|
scheduledGroups?.forEach((scheduledGroup) => {
|
|
5
5
|
const subjects = school.school_type == "GR" ? scheduledGroup.subjects : scheduledGroup.courses;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
for (const subject of subjects) {
|
|
7
|
+
if (scheduledGroup.teachers?.length == 0) {
|
|
8
|
+
const warn = `The schedule group "${scheduledGroup.name}" with id "${scheduledGroup.id}" did not contain any teachers.`;
|
|
9
|
+
importWarnings.push(warn);
|
|
10
|
+
}
|
|
11
|
+
courses.push({
|
|
12
|
+
ids: scheduledGroup.id.toString(),
|
|
13
|
+
displayName: scheduledGroup.name,
|
|
14
|
+
subject: subject.name,
|
|
15
|
+
groups: scheduledGroup.users_primary_groups.map((x) => ({ to: x.toString() })),
|
|
16
|
+
teachers: scheduledGroup.teachers?.map((x) => ({ to: x.id.toString() }))
|
|
17
|
+
});
|
|
10
18
|
}
|
|
11
|
-
if (scheduledGroup.teachers?.length == 0) {
|
|
12
|
-
const warn = `The schedule group "${scheduledGroup.name}" with id "${scheduledGroup.id}" did not contain any teachers.`;
|
|
13
|
-
importWarnings.push(warn);
|
|
14
|
-
}
|
|
15
|
-
courses.push({
|
|
16
|
-
ids: scheduledGroup.id.toString(),
|
|
17
|
-
displayName: scheduledGroup.name,
|
|
18
|
-
subject: subjects.map((x) => x.name).join(", "),
|
|
19
|
-
groups: scheduledGroup.users_primary_groups.map((x) => ({ to: x.toString() })),
|
|
20
|
-
teachers: scheduledGroup.teachers?.map((x) => ({ to: x.id.toString() }))
|
|
21
|
-
});
|
|
22
19
|
});
|
|
23
20
|
return courses;
|
|
24
21
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"courses.js","names":["courses: OutTypes.course[]"],"sources":["../../../src/Admentum/from/courses.ts"],"sourcesContent":["import type { ScheduleGroup } from '../types/schedule-groups';\nimport type { School } from '../types/schools';\nimport type { OutTypes } from './schedules';\n\n\nexport default function (\n scheduledGroups: ScheduleGroup[] | undefined,\n school: School,\n importErrors: string[],\n importWarnings: string[],\n): OutTypes.course[] {\n\n const courses: OutTypes.course[] = [];\n\n scheduledGroups?.forEach(scheduledGroup => {\n\n ////\n //// check number of subjects/courses\n ////\n const subjects = school.school_type == 'GR' ? scheduledGroup.subjects : scheduledGroup.courses;\n
|
|
1
|
+
{"version":3,"file":"courses.js","names":["courses: OutTypes.course[]"],"sources":["../../../src/Admentum/from/courses.ts"],"sourcesContent":["import type { ScheduleGroup } from '../types/schedule-groups';\nimport type { School } from '../types/schools';\nimport type { OutTypes } from './schedules';\n\n\nexport default function (\n scheduledGroups: ScheduleGroup[] | undefined,\n school: School,\n importErrors: string[],\n importWarnings: string[],\n): OutTypes.course[] {\n\n const courses: OutTypes.course[] = [];\n\n scheduledGroups?.forEach(scheduledGroup => {\n\n ////\n //// check number of subjects/courses\n ////\n const subjects = school.school_type == 'GR' ? scheduledGroup.subjects : scheduledGroup.courses;\n // Nikos takes full responsibility for this line of code and the decision to allow multiple subjects per schedule group, which is a scenario that we have observed in the wild but that we do not fully understand the implications of.\n for (const subject of subjects) {\n ////\n //// check number of teachers\n ////\n if (scheduledGroup.teachers?.length == 0) {\n const warn = `The schedule group \"${scheduledGroup.name}\" with id \"${scheduledGroup.id}\" did not contain any teachers.`;\n importWarnings.push(warn);\n }\n\n courses.push({\n ids: scheduledGroup.id.toString(),\n displayName: scheduledGroup.name,\n subject: subject.name,\n groups: scheduledGroup.users_primary_groups.map(x => ({ to: x.toString() })),\n teachers: scheduledGroup.teachers?.map(x => ({ to: x.id.toString() }))\n } satisfies OutTypes.course);\n }\n });\n\n return courses;\n}\n"],"mappings":";AAKA,yBACE,iBACA,QACA,cACA,gBACmB;CAEnB,MAAMA,UAA6B,EAAE;AAErC,kBAAiB,SAAQ,mBAAkB;EAKzC,MAAM,WAAW,OAAO,eAAe,OAAO,eAAe,WAAW,eAAe;AAEvF,OAAK,MAAM,WAAW,UAAU;AAI9B,OAAI,eAAe,UAAU,UAAU,GAAG;IACxC,MAAM,OAAO,uBAAuB,eAAe,KAAK,aAAa,eAAe,GAAG;AACvF,mBAAe,KAAK,KAAK;;AAG3B,WAAQ,KAAK;IACX,KAAa,eAAe,GAAG,UAAU;IACzC,aAAa,eAAe;IAC5B,SAAa,QAAQ;IACrB,QAAa,eAAe,qBAAqB,KAAI,OAAM,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE;IACjF,UAAa,eAAe,UAAU,KAAI,OAAM,EAAE,IAAI,EAAE,GAAG,UAAU,EAAE,EAAE;IAC1E,CAA2B;;GAE9B;AAEF,QAAO"}
|