feat: group resources, decrease width, perform adhoc patches of location with a static map

This commit is contained in:
Raito Bezarius 2022-07-26 13:07:03 +02:00
parent def6868588
commit 5c1c12b413
3 changed files with 17 additions and 18 deletions

View file

@ -63,23 +63,15 @@
locale: frLocale,
allDayContent: '',
headerToolbar: headers,
resourceAreaWidth: '40%',
resourceAreaColumns: [
{
group: true,
field: 'building',
headerContent: 'Bâtiment'
},
{
field: 'room',
headerContent: 'Salle'
}
],
buttonText: { resourceTimelineDay: 'Salles' },
scrollTime: "08:00:00",
resourceGroupField: 'building',
resourceAreaWidth: '27%',
resources: Object.entries(ENSLocations).flatMap(([building, rooms]) =>
rooms.map(room => ({
id: `${building}-${room}`,
building,
room
title: room
}))
),
height: '100%',

View file

@ -234,17 +234,23 @@ class Calendar {
}
function findLocationId(location) {
// TODO: Perform ad-hoc patches of location so it can be better associated.
// Strip '(Jourdan)'
// Relocate room number
const adhocMap = {
'Amphi Jourdan': 'Amphithéâtre Jourdan',
'R2-21 (Jourdan)': 'R2-21',
'Salle Jean Ibanes (Jourdan, R1-07)': 'Salle Jean Ibanes (R1-07)',
'Salle Madeleine Rebérioux (Jourdan, R2-02)': 'Salle Madeleine Rebérioux (R2-02)',
'Salle Marcel Roncayolo (Jourdan, R2-05)': 'Salle Marcel Roncayolo (R2-05)'
};
const correctedLocation = adhocMap[location] || location;
const result = Object.entries(STATIC_LOCATIONS).find(([building, rooms]) =>
rooms.includes(location)
rooms.includes(correctedLocation)
)
if (result === undefined) return undefined
const [building, _] = result
return `${building}-${location}`
return `${building}-${correctedLocation}`
}
function fcEventFromjCalEvent(cal) {

View file

@ -21,6 +21,7 @@
"Cave d'hackENS",
"Gymnase"
],
"24 rue d'Ulm": ["Salle CONF IV"],
"29 rue d'Ulm": ["Bibliothèque des sciences expérimentales", "Salle Jaurès"],
"Jourdan": [
"Bibliothèque de Jourdan",