Merge pull request 'chore: fix LIMCO courses' names' (#13) from dev into main
continuous-integration/drone/push Build is passing
continuous-integration/drone/push Build is passing
Reviewed-on: #13
This commit was merged in pull request #13.
This commit is contained in:
+8
-5
@@ -50,15 +50,18 @@ const TIMETABLE_IDS = {
|
||||
// }
|
||||
|
||||
function specialEventPatches(eventi) {
|
||||
// Il laboratorio del primo anno in realtà è in due canali separati
|
||||
let i = 1
|
||||
// Il laboratorio del primo anno in realtà è in due gruppi separati
|
||||
eventi.forEach(evento => {
|
||||
if (
|
||||
evento.nome ===
|
||||
'LABORATORIO DI INTRODUZIONE ALLA MATEMATICA COMPUTAZIONALE'
|
||||
) {
|
||||
evento.nome += ` (${i})`
|
||||
i++
|
||||
if (evento.docenti[0].nome === 'GIOVANNI') {
|
||||
evento.nome += ' (A)'
|
||||
}
|
||||
if (evento.docenti[0].nome === 'PAOLO') {
|
||||
evento.nome += ' (B)'
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -131,7 +134,7 @@ async function loadCalendari(date) {
|
||||
const timetablesRaw = results.map(timetable =>
|
||||
specialEventPatches(_.uniqBy(timetable, 'id'))
|
||||
)
|
||||
const allRaw = specialEventPatches(_.uniqBy(_.concat(...results), 'id'))
|
||||
const allRaw = specialEventPatches(_.concat(...results), 'id')
|
||||
|
||||
return {
|
||||
'anno-1': formatEvents(timetablesRaw[0]),
|
||||
|
||||
@@ -61,6 +61,7 @@ export function prettyCourseName(name) {
|
||||
.replaceAll('IIi', 'III')
|
||||
.replaceAll('Iii', 'III')
|
||||
.replaceAll(/'(.)/g, ({}, letter) => "'" + letter.toUpperCase())
|
||||
.replaceAll(/\((a|b)\)/g, ({}, letter) => "(" + letter.toUpperCase() + ")")
|
||||
}
|
||||
|
||||
export function prettyAulaName(name) {
|
||||
|
||||
Reference in New Issue
Block a user