feat: group resources, decrease width, perform adhoc patches of location with a static map
This commit is contained in:
parent
def6868588
commit
5c1c12b413
3 changed files with 17 additions and 18 deletions
|
@ -63,23 +63,15 @@
|
||||||
locale: frLocale,
|
locale: frLocale,
|
||||||
allDayContent: '',
|
allDayContent: '',
|
||||||
headerToolbar: headers,
|
headerToolbar: headers,
|
||||||
resourceAreaWidth: '40%',
|
buttonText: { resourceTimelineDay: 'Salles' },
|
||||||
resourceAreaColumns: [
|
scrollTime: "08:00:00",
|
||||||
{
|
resourceGroupField: 'building',
|
||||||
group: true,
|
resourceAreaWidth: '27%',
|
||||||
field: 'building',
|
|
||||||
headerContent: 'Bâtiment'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
field: 'room',
|
|
||||||
headerContent: 'Salle'
|
|
||||||
}
|
|
||||||
],
|
|
||||||
resources: Object.entries(ENSLocations).flatMap(([building, rooms]) =>
|
resources: Object.entries(ENSLocations).flatMap(([building, rooms]) =>
|
||||||
rooms.map(room => ({
|
rooms.map(room => ({
|
||||||
id: `${building}-${room}`,
|
id: `${building}-${room}`,
|
||||||
building,
|
building,
|
||||||
room
|
title: room
|
||||||
}))
|
}))
|
||||||
),
|
),
|
||||||
height: '100%',
|
height: '100%',
|
||||||
|
|
|
@ -234,17 +234,23 @@ class Calendar {
|
||||||
}
|
}
|
||||||
|
|
||||||
function findLocationId(location) {
|
function findLocationId(location) {
|
||||||
// TODO: Perform ad-hoc patches of location so it can be better associated.
|
const adhocMap = {
|
||||||
// Strip '(Jourdan)'
|
'Amphi Jourdan': 'Amphithéâtre Jourdan',
|
||||||
// Relocate room number
|
'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]) =>
|
const result = Object.entries(STATIC_LOCATIONS).find(([building, rooms]) =>
|
||||||
rooms.includes(location)
|
rooms.includes(correctedLocation)
|
||||||
)
|
)
|
||||||
|
|
||||||
if (result === undefined) return undefined
|
if (result === undefined) return undefined
|
||||||
const [building, _] = result
|
const [building, _] = result
|
||||||
return `${building}-${location}`
|
return `${building}-${correctedLocation}`
|
||||||
}
|
}
|
||||||
|
|
||||||
function fcEventFromjCalEvent(cal) {
|
function fcEventFromjCalEvent(cal) {
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
"Cave d'hackENS",
|
"Cave d'hackENS",
|
||||||
"Gymnase"
|
"Gymnase"
|
||||||
],
|
],
|
||||||
|
"24 rue d'Ulm": ["Salle CONF IV"],
|
||||||
"29 rue d'Ulm": ["Bibliothèque des sciences expérimentales", "Salle Jaurès"],
|
"29 rue d'Ulm": ["Bibliothèque des sciences expérimentales", "Salle Jaurès"],
|
||||||
"Jourdan": [
|
"Jourdan": [
|
||||||
"Bibliothèque de Jourdan",
|
"Bibliothèque de Jourdan",
|
||||||
|
|
Loading…
Reference in a new issue