|
|
@ -31,10 +31,10 @@ window._ = _
|
|
|
|
window.dataBuffer = {}
|
|
|
|
window.dataBuffer = {}
|
|
|
|
|
|
|
|
|
|
|
|
const TIMETABLE_IDS = {
|
|
|
|
const TIMETABLE_IDS = {
|
|
|
|
'anno-1': '64a7c1c651f079001d52e9c8',
|
|
|
|
'anno-1': '667e88275e9623041f0e43d4',
|
|
|
|
'anno-2': '6308e2dc09352a0208fefdd9',
|
|
|
|
'anno-2': '667e89055e9623041f0e43d6',
|
|
|
|
'anno-3': '6308e42a1df5cb026699ced4',
|
|
|
|
'anno-3': '667e89fcf748ed0415a11dcc',
|
|
|
|
'magistrale': '64a7c7091ab813002c5d9ede',
|
|
|
|
'magistrale': '667ebae63379a3046517ffd4',
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// const DEFAULT_DATE_RANGE = {
|
|
|
|
// const DEFAULT_DATE_RANGE = {
|
|
|
@ -50,15 +50,17 @@ const TIMETABLE_IDS = {
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
function specialEventPatches(eventi) {
|
|
|
|
function specialEventPatches(eventi) {
|
|
|
|
// Il laboratorio del primo anno in realtà è in due canali separati
|
|
|
|
// Il laboratorio del primo anno in realtà è in due gruppi separati
|
|
|
|
let i = 1
|
|
|
|
|
|
|
|
eventi.forEach(evento => {
|
|
|
|
eventi.forEach(evento => {
|
|
|
|
if (
|
|
|
|
if (
|
|
|
|
evento.nome ===
|
|
|
|
evento.nome === 'LABORATORIO DI INTRODUZIONE ALLA MATEMATICA COMPUTAZIONALE'
|
|
|
|
'LABORATORIO DI INTRODUZIONE ALLA MATEMATICA COMPUTAZIONALE'
|
|
|
|
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
evento.nome += ` (${i})`
|
|
|
|
if (evento.docenti[0].nome === 'GIOVANNI') {
|
|
|
|
i++
|
|
|
|
evento.nome += ' (A)'
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (evento.docenti[0].nome === 'PAOLO') {
|
|
|
|
|
|
|
|
evento.nome += ' (B)'
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
@ -72,9 +74,7 @@ function formatEvents(timetable) {
|
|
|
|
name: _.split(nome, '-', 1)[0].trim(),
|
|
|
|
name: _.split(nome, '-', 1)[0].trim(),
|
|
|
|
start: new Date(dataInizio),
|
|
|
|
start: new Date(dataInizio),
|
|
|
|
end: new Date(dataFine),
|
|
|
|
end: new Date(dataFine),
|
|
|
|
docenti: docenti.map(({ nome, cognome }) =>
|
|
|
|
docenti: docenti.map(({ nome, cognome }) => prettyProfName(nome, cognome)),
|
|
|
|
prettyProfName(nome, cognome)
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
aule: aule.map(aula => prettyAulaName(aula.codice)),
|
|
|
|
aule: aule.map(aula => prettyAulaName(aula.codice)),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
@ -131,7 +131,7 @@ async function loadCalendari(date) {
|
|
|
|
const timetablesRaw = results.map(timetable =>
|
|
|
|
const timetablesRaw = results.map(timetable =>
|
|
|
|
specialEventPatches(_.uniqBy(timetable, 'id'))
|
|
|
|
specialEventPatches(_.uniqBy(timetable, 'id'))
|
|
|
|
)
|
|
|
|
)
|
|
|
|
const allRaw = specialEventPatches(_.uniqBy(_.concat(...results), 'id'))
|
|
|
|
const allRaw = specialEventPatches(_.concat(...results), 'id')
|
|
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
'anno-1': formatEvents(timetablesRaw[0]),
|
|
|
|
'anno-1': formatEvents(timetablesRaw[0]),
|
|
|
@ -188,10 +188,7 @@ const App = ({}) => {
|
|
|
|
// const [mode, setMode] = usePersistentState('orario.mode', MODE_COURSES)
|
|
|
|
// const [mode, setMode] = usePersistentState('orario.mode', MODE_COURSES)
|
|
|
|
|
|
|
|
|
|
|
|
// Selection
|
|
|
|
// Selection
|
|
|
|
const [selectedCourses, setSelectedCourses] = usePersistentState(
|
|
|
|
const [selectedCourses, setSelectedCourses] = usePersistentState('selection', [])
|
|
|
|
'selection',
|
|
|
|
|
|
|
|
[]
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Menus
|
|
|
|
// Menus
|
|
|
|
const [helpVisible, setHelpVisible] = useState(false)
|
|
|
|
const [helpVisible, setHelpVisible] = useState(false)
|
|
|
@ -262,16 +259,15 @@ const App = ({}) => {
|
|
|
|
) : timetables['tutti'].length === 0 ? (
|
|
|
|
) : timetables['tutti'].length === 0 ? (
|
|
|
|
<div class="warning">
|
|
|
|
<div class="warning">
|
|
|
|
<p>
|
|
|
|
<p>
|
|
|
|
Non esistono corsi per la settimana selezionata:
|
|
|
|
Non esistono corsi per la settimana selezionata: buone
|
|
|
|
buone vacanze! 🎉
|
|
|
|
vacanze! 🎉
|
|
|
|
</p>
|
|
|
|
</p>
|
|
|
|
<p>
|
|
|
|
<p>
|
|
|
|
Per cambiare settimana puoi usare il widget
|
|
|
|
Per cambiare settimana puoi usare il widget Calendario (
|
|
|
|
Calendario (
|
|
|
|
|
|
|
|
<Icon name="calendar_month" />) in alto a destra
|
|
|
|
<Icon name="calendar_month" />) in alto a destra
|
|
|
|
<br />
|
|
|
|
<br />
|
|
|
|
In versione mobile, il widget Calendario è
|
|
|
|
In versione mobile, il widget Calendario è situato dentro
|
|
|
|
situato dentro il Menu (
|
|
|
|
il Menu (
|
|
|
|
<Icon name="menu" />)
|
|
|
|
<Icon name="menu" />)
|
|
|
|
</p>
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|