From 2269dd540f2a05ccbf77449025e0158054a61e7f Mon Sep 17 00:00:00 2001 From: Raito Bezarius Date: Mon, 25 Jul 2022 21:49:01 +0200 Subject: [PATCH 1/6] feat: add resource timelines with ENS locations --- package-lock.json | 255 ++++++++++++++++++++++++++++++++++ package.json | 2 + rollup.config.js | 3 + src/App.svelte | 25 +++- src/static-ens-locations.json | 22 +++ 5 files changed, 305 insertions(+), 2 deletions(-) create mode 100644 src/static-ens-locations.json diff --git a/package-lock.json b/package-lock.json index be2c8be..9b8fc94 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,6 +11,7 @@ "@fullcalendar/adaptive": "^5.10.1", "@fullcalendar/bootstrap5": "^5.10.2", "@fullcalendar/list": "^5.10.1", + "@fullcalendar/resource-timeline": "^5.11.0", "@fullcalendar/rrule": "^5.10.1", "@nextcloud/cdav-library": "^1.0.0", "bootstrap": "^5.1.3", @@ -27,6 +28,7 @@ "@fullcalendar/daygrid": "^5.10.1", "@fullcalendar/timegrid": "^5.10.1", "@rollup/plugin-commonjs": "^17.0.0", + "@rollup/plugin-json": "^4.1.0", "@rollup/plugin-node-resolve": "^11.0.0", "dav": "^1.8.0", "postcss": "^8.3.11", @@ -166,6 +168,63 @@ "tslib": "^2.1.0" } }, + "node_modules/@fullcalendar/resource-common": { + "version": "5.11.0", + "resolved": "https://registry.npmjs.org/@fullcalendar/resource-common/-/resource-common-5.11.0.tgz", + "integrity": "sha512-zO6UK9IKo7O8Uj5Y1t9sLMsLyNmxAliriAlz/NNhk//O/yGmQZ5MQOgVDg2qCZpDOWgQeuSZOkTTJdud5ISe2Q==", + "dependencies": { + "@fullcalendar/common": "~5.11.0", + "@fullcalendar/premium-common": "~5.11.0", + "tslib": "^2.1.0" + } + }, + "node_modules/@fullcalendar/resource-common/node_modules/@fullcalendar/common": { + "version": "5.11.0", + "resolved": "https://registry.npmjs.org/@fullcalendar/common/-/common-5.11.0.tgz", + "integrity": "sha512-gWjbMAnN1u73Oqlgjbyky7i+3bY0hvFSnGT0YBPx44n874AkQa9e9OU12PMLTMOPy0tXPb8DEwRelFQ7CJNbcw==", + "dependencies": { + "tslib": "^2.1.0" + } + }, + "node_modules/@fullcalendar/resource-common/node_modules/@fullcalendar/premium-common": { + "version": "5.11.0", + "resolved": "https://registry.npmjs.org/@fullcalendar/premium-common/-/premium-common-5.11.0.tgz", + "integrity": "sha512-XVLJwJQ26EhuglBM1flmrKtNt0BEUBHoazko/wvMiz5Yz17eABKQreFTidipOwjL3s74ifQzDoYpkQVn8TzpZQ==", + "dependencies": { + "@fullcalendar/common": "~5.11.0", + "tslib": "^2.1.0" + } + }, + "node_modules/@fullcalendar/resource-timeline": { + "version": "5.11.0", + "resolved": "https://registry.npmjs.org/@fullcalendar/resource-timeline/-/resource-timeline-5.11.0.tgz", + "integrity": "sha512-+40sKEQj/ig6oh+8/FZPaFYtqI4e9wa/2XT2MTtzwDr3modHU0mQChlpcY8WQ+c6kyPjVwhO89BFiv2OeilLWw==", + "dependencies": { + "@fullcalendar/common": "~5.11.0", + "@fullcalendar/premium-common": "~5.11.0", + "@fullcalendar/resource-common": "~5.11.0", + "@fullcalendar/scrollgrid": "~5.11.0", + "@fullcalendar/timeline": "~5.11.0", + "tslib": "^2.1.0" + } + }, + "node_modules/@fullcalendar/resource-timeline/node_modules/@fullcalendar/common": { + "version": "5.11.0", + "resolved": "https://registry.npmjs.org/@fullcalendar/common/-/common-5.11.0.tgz", + "integrity": "sha512-gWjbMAnN1u73Oqlgjbyky7i+3bY0hvFSnGT0YBPx44n874AkQa9e9OU12PMLTMOPy0tXPb8DEwRelFQ7CJNbcw==", + "dependencies": { + "tslib": "^2.1.0" + } + }, + "node_modules/@fullcalendar/resource-timeline/node_modules/@fullcalendar/premium-common": { + "version": "5.11.0", + "resolved": "https://registry.npmjs.org/@fullcalendar/premium-common/-/premium-common-5.11.0.tgz", + "integrity": "sha512-XVLJwJQ26EhuglBM1flmrKtNt0BEUBHoazko/wvMiz5Yz17eABKQreFTidipOwjL3s74ifQzDoYpkQVn8TzpZQ==", + "dependencies": { + "@fullcalendar/common": "~5.11.0", + "tslib": "^2.1.0" + } + }, "node_modules/@fullcalendar/rrule": { "version": "5.10.1", "resolved": "https://registry.npmjs.org/@fullcalendar/rrule/-/rrule-5.10.1.tgz", @@ -178,6 +237,33 @@ "rrule": "^2.6.0" } }, + "node_modules/@fullcalendar/scrollgrid": { + "version": "5.11.0", + "resolved": "https://registry.npmjs.org/@fullcalendar/scrollgrid/-/scrollgrid-5.11.0.tgz", + "integrity": "sha512-OPwLGLr0YF2qQYa9K1vPIGsodfAqPnugcwKLwnkiLprC2UybnPaIXvY6xMAHyVWSiBaeJSmkQ0J8mZDmfKjdTw==", + "dependencies": { + "@fullcalendar/common": "~5.11.0", + "@fullcalendar/premium-common": "~5.11.0", + "tslib": "^2.1.0" + } + }, + "node_modules/@fullcalendar/scrollgrid/node_modules/@fullcalendar/common": { + "version": "5.11.0", + "resolved": "https://registry.npmjs.org/@fullcalendar/common/-/common-5.11.0.tgz", + "integrity": "sha512-gWjbMAnN1u73Oqlgjbyky7i+3bY0hvFSnGT0YBPx44n874AkQa9e9OU12PMLTMOPy0tXPb8DEwRelFQ7CJNbcw==", + "dependencies": { + "tslib": "^2.1.0" + } + }, + "node_modules/@fullcalendar/scrollgrid/node_modules/@fullcalendar/premium-common": { + "version": "5.11.0", + "resolved": "https://registry.npmjs.org/@fullcalendar/premium-common/-/premium-common-5.11.0.tgz", + "integrity": "sha512-XVLJwJQ26EhuglBM1flmrKtNt0BEUBHoazko/wvMiz5Yz17eABKQreFTidipOwjL3s74ifQzDoYpkQVn8TzpZQ==", + "dependencies": { + "@fullcalendar/common": "~5.11.0", + "tslib": "^2.1.0" + } + }, "node_modules/@fullcalendar/timegrid": { "version": "5.10.1", "resolved": "https://registry.npmjs.org/@fullcalendar/timegrid/-/timegrid-5.10.1.tgz", @@ -189,6 +275,34 @@ "tslib": "^2.1.0" } }, + "node_modules/@fullcalendar/timeline": { + "version": "5.11.0", + "resolved": "https://registry.npmjs.org/@fullcalendar/timeline/-/timeline-5.11.0.tgz", + "integrity": "sha512-2mASvwsXMR42Vlvwjnb5w0OvMDf8z2WCZXpLCd11lP/b+ZYOosCrJZZQWpzNfWYf7Y4Sqjo7q+YMPxnJqlichg==", + "dependencies": { + "@fullcalendar/common": "~5.11.0", + "@fullcalendar/premium-common": "~5.11.0", + "@fullcalendar/scrollgrid": "~5.11.0", + "tslib": "^2.1.0" + } + }, + "node_modules/@fullcalendar/timeline/node_modules/@fullcalendar/common": { + "version": "5.11.0", + "resolved": "https://registry.npmjs.org/@fullcalendar/common/-/common-5.11.0.tgz", + "integrity": "sha512-gWjbMAnN1u73Oqlgjbyky7i+3bY0hvFSnGT0YBPx44n874AkQa9e9OU12PMLTMOPy0tXPb8DEwRelFQ7CJNbcw==", + "dependencies": { + "tslib": "^2.1.0" + } + }, + "node_modules/@fullcalendar/timeline/node_modules/@fullcalendar/premium-common": { + "version": "5.11.0", + "resolved": "https://registry.npmjs.org/@fullcalendar/premium-common/-/premium-common-5.11.0.tgz", + "integrity": "sha512-XVLJwJQ26EhuglBM1flmrKtNt0BEUBHoazko/wvMiz5Yz17eABKQreFTidipOwjL3s74ifQzDoYpkQVn8TzpZQ==", + "dependencies": { + "@fullcalendar/common": "~5.11.0", + "tslib": "^2.1.0" + } + }, "node_modules/@hapi/hoek": { "version": "9.2.1", "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-9.2.1.tgz", @@ -283,6 +397,18 @@ "rollup": "^2.30.0" } }, + "node_modules/@rollup/plugin-json": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@rollup/plugin-json/-/plugin-json-4.1.0.tgz", + "integrity": "sha512-yfLbTdNS6amI/2OpmbiBoW12vngr5NW2jCJVZSBEz+H5KfUJZ2M7sDjk0U6GOOdCWFVScShte29o9NezJ53TPw==", + "dev": true, + "dependencies": { + "@rollup/pluginutils": "^3.0.8" + }, + "peerDependencies": { + "rollup": "^1.20.0 || ^2.0.0" + } + }, "node_modules/@rollup/plugin-node-resolve": { "version": "11.2.1", "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-11.2.1.tgz", @@ -4124,6 +4250,67 @@ "tslib": "^2.1.0" } }, + "@fullcalendar/resource-common": { + "version": "5.11.0", + "resolved": "https://registry.npmjs.org/@fullcalendar/resource-common/-/resource-common-5.11.0.tgz", + "integrity": "sha512-zO6UK9IKo7O8Uj5Y1t9sLMsLyNmxAliriAlz/NNhk//O/yGmQZ5MQOgVDg2qCZpDOWgQeuSZOkTTJdud5ISe2Q==", + "requires": { + "@fullcalendar/common": "~5.11.0", + "@fullcalendar/premium-common": "~5.11.0", + "tslib": "^2.1.0" + }, + "dependencies": { + "@fullcalendar/common": { + "version": "5.11.0", + "resolved": "https://registry.npmjs.org/@fullcalendar/common/-/common-5.11.0.tgz", + "integrity": "sha512-gWjbMAnN1u73Oqlgjbyky7i+3bY0hvFSnGT0YBPx44n874AkQa9e9OU12PMLTMOPy0tXPb8DEwRelFQ7CJNbcw==", + "requires": { + "tslib": "^2.1.0" + } + }, + "@fullcalendar/premium-common": { + "version": "5.11.0", + "resolved": "https://registry.npmjs.org/@fullcalendar/premium-common/-/premium-common-5.11.0.tgz", + "integrity": "sha512-XVLJwJQ26EhuglBM1flmrKtNt0BEUBHoazko/wvMiz5Yz17eABKQreFTidipOwjL3s74ifQzDoYpkQVn8TzpZQ==", + "requires": { + "@fullcalendar/common": "~5.11.0", + "tslib": "^2.1.0" + } + } + } + }, + "@fullcalendar/resource-timeline": { + "version": "5.11.0", + "resolved": "https://registry.npmjs.org/@fullcalendar/resource-timeline/-/resource-timeline-5.11.0.tgz", + "integrity": "sha512-+40sKEQj/ig6oh+8/FZPaFYtqI4e9wa/2XT2MTtzwDr3modHU0mQChlpcY8WQ+c6kyPjVwhO89BFiv2OeilLWw==", + "requires": { + "@fullcalendar/common": "~5.11.0", + "@fullcalendar/premium-common": "~5.11.0", + "@fullcalendar/resource-common": "~5.11.0", + "@fullcalendar/scrollgrid": "~5.11.0", + "@fullcalendar/timeline": "~5.11.0", + "tslib": "^2.1.0" + }, + "dependencies": { + "@fullcalendar/common": { + "version": "5.11.0", + "resolved": "https://registry.npmjs.org/@fullcalendar/common/-/common-5.11.0.tgz", + "integrity": "sha512-gWjbMAnN1u73Oqlgjbyky7i+3bY0hvFSnGT0YBPx44n874AkQa9e9OU12PMLTMOPy0tXPb8DEwRelFQ7CJNbcw==", + "requires": { + "tslib": "^2.1.0" + } + }, + "@fullcalendar/premium-common": { + "version": "5.11.0", + "resolved": "https://registry.npmjs.org/@fullcalendar/premium-common/-/premium-common-5.11.0.tgz", + "integrity": "sha512-XVLJwJQ26EhuglBM1flmrKtNt0BEUBHoazko/wvMiz5Yz17eABKQreFTidipOwjL3s74ifQzDoYpkQVn8TzpZQ==", + "requires": { + "@fullcalendar/common": "~5.11.0", + "tslib": "^2.1.0" + } + } + } + }, "@fullcalendar/rrule": { "version": "5.10.1", "resolved": "https://registry.npmjs.org/@fullcalendar/rrule/-/rrule-5.10.1.tgz", @@ -4133,6 +4320,35 @@ "tslib": "^2.1.0" } }, + "@fullcalendar/scrollgrid": { + "version": "5.11.0", + "resolved": "https://registry.npmjs.org/@fullcalendar/scrollgrid/-/scrollgrid-5.11.0.tgz", + "integrity": "sha512-OPwLGLr0YF2qQYa9K1vPIGsodfAqPnugcwKLwnkiLprC2UybnPaIXvY6xMAHyVWSiBaeJSmkQ0J8mZDmfKjdTw==", + "requires": { + "@fullcalendar/common": "~5.11.0", + "@fullcalendar/premium-common": "~5.11.0", + "tslib": "^2.1.0" + }, + "dependencies": { + "@fullcalendar/common": { + "version": "5.11.0", + "resolved": "https://registry.npmjs.org/@fullcalendar/common/-/common-5.11.0.tgz", + "integrity": "sha512-gWjbMAnN1u73Oqlgjbyky7i+3bY0hvFSnGT0YBPx44n874AkQa9e9OU12PMLTMOPy0tXPb8DEwRelFQ7CJNbcw==", + "requires": { + "tslib": "^2.1.0" + } + }, + "@fullcalendar/premium-common": { + "version": "5.11.0", + "resolved": "https://registry.npmjs.org/@fullcalendar/premium-common/-/premium-common-5.11.0.tgz", + "integrity": "sha512-XVLJwJQ26EhuglBM1flmrKtNt0BEUBHoazko/wvMiz5Yz17eABKQreFTidipOwjL3s74ifQzDoYpkQVn8TzpZQ==", + "requires": { + "@fullcalendar/common": "~5.11.0", + "tslib": "^2.1.0" + } + } + } + }, "@fullcalendar/timegrid": { "version": "5.10.1", "resolved": "https://registry.npmjs.org/@fullcalendar/timegrid/-/timegrid-5.10.1.tgz", @@ -4144,6 +4360,36 @@ "tslib": "^2.1.0" } }, + "@fullcalendar/timeline": { + "version": "5.11.0", + "resolved": "https://registry.npmjs.org/@fullcalendar/timeline/-/timeline-5.11.0.tgz", + "integrity": "sha512-2mASvwsXMR42Vlvwjnb5w0OvMDf8z2WCZXpLCd11lP/b+ZYOosCrJZZQWpzNfWYf7Y4Sqjo7q+YMPxnJqlichg==", + "requires": { + "@fullcalendar/common": "~5.11.0", + "@fullcalendar/premium-common": "~5.11.0", + "@fullcalendar/scrollgrid": "~5.11.0", + "tslib": "^2.1.0" + }, + "dependencies": { + "@fullcalendar/common": { + "version": "5.11.0", + "resolved": "https://registry.npmjs.org/@fullcalendar/common/-/common-5.11.0.tgz", + "integrity": "sha512-gWjbMAnN1u73Oqlgjbyky7i+3bY0hvFSnGT0YBPx44n874AkQa9e9OU12PMLTMOPy0tXPb8DEwRelFQ7CJNbcw==", + "requires": { + "tslib": "^2.1.0" + } + }, + "@fullcalendar/premium-common": { + "version": "5.11.0", + "resolved": "https://registry.npmjs.org/@fullcalendar/premium-common/-/premium-common-5.11.0.tgz", + "integrity": "sha512-XVLJwJQ26EhuglBM1flmrKtNt0BEUBHoazko/wvMiz5Yz17eABKQreFTidipOwjL3s74ifQzDoYpkQVn8TzpZQ==", + "requires": { + "@fullcalendar/common": "~5.11.0", + "tslib": "^2.1.0" + } + } + } + }, "@hapi/hoek": { "version": "9.2.1", "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-9.2.1.tgz", @@ -4216,6 +4462,15 @@ "resolve": "^1.17.0" } }, + "@rollup/plugin-json": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@rollup/plugin-json/-/plugin-json-4.1.0.tgz", + "integrity": "sha512-yfLbTdNS6amI/2OpmbiBoW12vngr5NW2jCJVZSBEz+H5KfUJZ2M7sDjk0U6GOOdCWFVScShte29o9NezJ53TPw==", + "dev": true, + "requires": { + "@rollup/pluginutils": "^3.0.8" + } + }, "@rollup/plugin-node-resolve": { "version": "11.2.1", "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-11.2.1.tgz", diff --git a/package.json b/package.json index 9c46cd2..dc9000d 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "@fullcalendar/daygrid": "^5.10.1", "@fullcalendar/timegrid": "^5.10.1", "@rollup/plugin-commonjs": "^17.0.0", + "@rollup/plugin-json": "^4.1.0", "@rollup/plugin-node-resolve": "^11.0.0", "dav": "^1.8.0", "postcss": "^8.3.11", @@ -33,6 +34,7 @@ "@fullcalendar/adaptive": "^5.10.1", "@fullcalendar/bootstrap5": "^5.10.2", "@fullcalendar/list": "^5.10.1", + "@fullcalendar/resource-timeline": "^5.11.0", "@fullcalendar/rrule": "^5.10.1", "@nextcloud/cdav-library": "^1.0.0", "bootstrap": "^5.1.3", diff --git a/rollup.config.js b/rollup.config.js index 53c1a1e..6bc4c2e 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -7,6 +7,7 @@ import css from 'rollup-plugin-css-only' import postcss from 'rollup-plugin-postcss' import dev from 'rollup-plugin-dev' import copy from 'rollup-plugin-copy' +import json from '@rollup/plugin-json'; const production = !process.env.ROLLUP_WATCH @@ -48,6 +49,8 @@ export default { } }), + json(), + // Copy font files copy({ targets: [ diff --git a/src/App.svelte b/src/App.svelte index 359568f..c78c4fa 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -7,6 +7,7 @@ import rrulePlugin from '@fullcalendar/rrule'; import dayGridPlugin from '@fullcalendar/daygrid'; import listPlugin from '@fullcalendar/list'; + import resourceTimelinePlugin from '@fullcalendar/resource-timeline'; import frLocale from '@fullcalendar/core/locales/fr'; import EventModal from './EventModal.svelte'; import FilterBar from './FilterBar.svelte'; @@ -18,6 +19,8 @@ import 'bootstrap-icons/font/bootstrap-icons.css'; import bootstrap5Plugin from '@fullcalendar/bootstrap5'; + import ENSLocations from './static-ens-locations.json'; + const event = writable(null); let openModal = false; @@ -36,12 +39,12 @@ ? { left: 'title', center: 'prev,today,next', - right: 'dayGridMonth,timeGridWeek,timeGridDay,listWeek' + right: 'resourceTimelineDay dayGridMonth,timeGridWeek,timeGridDay,listWeek' } : { left: 'prev,next today', center: 'title', - right: 'dayGridMonth,timeGridWeek,timeGridDay,listWeek' + right: 'resourceTimelineDay dayGridMonth,timeGridWeek,timeGridDay,listWeek' }; let calendar; @@ -53,12 +56,30 @@ dayGridPlugin, rrulePlugin, listPlugin, + resourceTimelinePlugin, adaptivePlugin, bootstrap5Plugin ], locale: frLocale, allDayContent: '', headerToolbar: headers, + resourceAreaWidth: '40%', + resourceAreaColumns: [ + { + group: true, + field: 'building', + headerContent: 'Bâtiment' + }, + { + field: 'room', + headerContent: 'Salle' + } + ], + resources: Object.entries(ENSLocations).flatMap(([building, rooms]) => rooms.map(room => ({ + id: `${building}-${room}`, + building, + room + }))), height: '100%', schedulerLicenseKey: 'CC-Attribution-NonCommercial-NoDerivatives', nowIndicator: true, diff --git a/src/static-ens-locations.json b/src/static-ens-locations.json new file mode 100644 index 0000000..b514479 --- /dev/null +++ b/src/static-ens-locations.json @@ -0,0 +1,22 @@ +{ "45 rue d'Ulm": + [ + "Amphithéâtre Galois", + "Salle Histoire", + "Salle Cavaillès", + "Salle Dussane", + "Salle des Actes", + "Cour aux Ernest", + "Salle Jaurès" + ], + "29 rue d'Ulm": [ + "Bibliothèque des sciences expérimentales" + ], + "Jourdan": [ + "Bibliothèque de Jourdan", + "Salle Marcel Roncayolo (R2-05)", + "Salle Madeleine Rebérioux (R2-02)", + "Amphithéâtre Jourdan", + "R2-21", + "Salle Jean Ibanes" + ] +} From 788694dae566bcd5141d02aa3246a5ba74a1e90f Mon Sep 17 00:00:00 2001 From: Raito Bezarius Date: Mon, 25 Jul 2022 22:01:37 +0200 Subject: [PATCH 2/6] dependencies: downgrade to ^5.10.1 because of upstream issues --- package-lock.json | 242 ++++++++++------------------------------------ package.json | 2 +- 2 files changed, 50 insertions(+), 194 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9b8fc94..b4397d6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "@fullcalendar/adaptive": "^5.10.1", "@fullcalendar/bootstrap5": "^5.10.2", "@fullcalendar/list": "^5.10.1", - "@fullcalendar/resource-timeline": "^5.11.0", + "@fullcalendar/resource-timeline": "^5.10.1", "@fullcalendar/rrule": "^5.10.1", "@nextcloud/cdav-library": "^1.0.0", "bootstrap": "^5.1.3", @@ -169,59 +169,25 @@ } }, "node_modules/@fullcalendar/resource-common": { - "version": "5.11.0", - "resolved": "https://registry.npmjs.org/@fullcalendar/resource-common/-/resource-common-5.11.0.tgz", - "integrity": "sha512-zO6UK9IKo7O8Uj5Y1t9sLMsLyNmxAliriAlz/NNhk//O/yGmQZ5MQOgVDg2qCZpDOWgQeuSZOkTTJdud5ISe2Q==", + "version": "5.10.1", + "resolved": "https://registry.npmjs.org/@fullcalendar/resource-common/-/resource-common-5.10.1.tgz", + "integrity": "sha512-20JR8cucAeJEXSbWVSj9USwsPGKb3dVQr8CBiXuHPbD0OLK93j7jhKjBlp/pRldtcJW9mIXC8ENQvw/aNZJ9Cw==", "dependencies": { - "@fullcalendar/common": "~5.11.0", - "@fullcalendar/premium-common": "~5.11.0", - "tslib": "^2.1.0" - } - }, - "node_modules/@fullcalendar/resource-common/node_modules/@fullcalendar/common": { - "version": "5.11.0", - "resolved": "https://registry.npmjs.org/@fullcalendar/common/-/common-5.11.0.tgz", - "integrity": "sha512-gWjbMAnN1u73Oqlgjbyky7i+3bY0hvFSnGT0YBPx44n874AkQa9e9OU12PMLTMOPy0tXPb8DEwRelFQ7CJNbcw==", - "dependencies": { - "tslib": "^2.1.0" - } - }, - "node_modules/@fullcalendar/resource-common/node_modules/@fullcalendar/premium-common": { - "version": "5.11.0", - "resolved": "https://registry.npmjs.org/@fullcalendar/premium-common/-/premium-common-5.11.0.tgz", - "integrity": "sha512-XVLJwJQ26EhuglBM1flmrKtNt0BEUBHoazko/wvMiz5Yz17eABKQreFTidipOwjL3s74ifQzDoYpkQVn8TzpZQ==", - "dependencies": { - "@fullcalendar/common": "~5.11.0", + "@fullcalendar/common": "~5.10.1", + "@fullcalendar/premium-common": "~5.10.1", "tslib": "^2.1.0" } }, "node_modules/@fullcalendar/resource-timeline": { - "version": "5.11.0", - "resolved": "https://registry.npmjs.org/@fullcalendar/resource-timeline/-/resource-timeline-5.11.0.tgz", - "integrity": "sha512-+40sKEQj/ig6oh+8/FZPaFYtqI4e9wa/2XT2MTtzwDr3modHU0mQChlpcY8WQ+c6kyPjVwhO89BFiv2OeilLWw==", + "version": "5.10.1", + "resolved": "https://registry.npmjs.org/@fullcalendar/resource-timeline/-/resource-timeline-5.10.1.tgz", + "integrity": "sha512-gsqjr6Z+LQcNbQlHgaTtg/kF8l6yDRtIuMQbhFlTy71RJI//x2mHhLXgV40FJeEE+srp48xJPd89+rIhlyJ5Tw==", "dependencies": { - "@fullcalendar/common": "~5.11.0", - "@fullcalendar/premium-common": "~5.11.0", - "@fullcalendar/resource-common": "~5.11.0", - "@fullcalendar/scrollgrid": "~5.11.0", - "@fullcalendar/timeline": "~5.11.0", - "tslib": "^2.1.0" - } - }, - "node_modules/@fullcalendar/resource-timeline/node_modules/@fullcalendar/common": { - "version": "5.11.0", - "resolved": "https://registry.npmjs.org/@fullcalendar/common/-/common-5.11.0.tgz", - "integrity": "sha512-gWjbMAnN1u73Oqlgjbyky7i+3bY0hvFSnGT0YBPx44n874AkQa9e9OU12PMLTMOPy0tXPb8DEwRelFQ7CJNbcw==", - "dependencies": { - "tslib": "^2.1.0" - } - }, - "node_modules/@fullcalendar/resource-timeline/node_modules/@fullcalendar/premium-common": { - "version": "5.11.0", - "resolved": "https://registry.npmjs.org/@fullcalendar/premium-common/-/premium-common-5.11.0.tgz", - "integrity": "sha512-XVLJwJQ26EhuglBM1flmrKtNt0BEUBHoazko/wvMiz5Yz17eABKQreFTidipOwjL3s74ifQzDoYpkQVn8TzpZQ==", - "dependencies": { - "@fullcalendar/common": "~5.11.0", + "@fullcalendar/common": "~5.10.1", + "@fullcalendar/premium-common": "~5.10.1", + "@fullcalendar/resource-common": "~5.10.1", + "@fullcalendar/scrollgrid": "~5.10.1", + "@fullcalendar/timeline": "~5.10.1", "tslib": "^2.1.0" } }, @@ -238,29 +204,12 @@ } }, "node_modules/@fullcalendar/scrollgrid": { - "version": "5.11.0", - "resolved": "https://registry.npmjs.org/@fullcalendar/scrollgrid/-/scrollgrid-5.11.0.tgz", - "integrity": "sha512-OPwLGLr0YF2qQYa9K1vPIGsodfAqPnugcwKLwnkiLprC2UybnPaIXvY6xMAHyVWSiBaeJSmkQ0J8mZDmfKjdTw==", + "version": "5.10.1", + "resolved": "https://registry.npmjs.org/@fullcalendar/scrollgrid/-/scrollgrid-5.10.1.tgz", + "integrity": "sha512-Hj6gzj2/sUUnozIMC0GBK60/ZTeDchp/Gc2S4F+05W6V4BoUXbIwav+EdAerfNFOv7EXWa9vM9Lq3A53iVWFVg==", "dependencies": { - "@fullcalendar/common": "~5.11.0", - "@fullcalendar/premium-common": "~5.11.0", - "tslib": "^2.1.0" - } - }, - "node_modules/@fullcalendar/scrollgrid/node_modules/@fullcalendar/common": { - "version": "5.11.0", - "resolved": "https://registry.npmjs.org/@fullcalendar/common/-/common-5.11.0.tgz", - "integrity": "sha512-gWjbMAnN1u73Oqlgjbyky7i+3bY0hvFSnGT0YBPx44n874AkQa9e9OU12PMLTMOPy0tXPb8DEwRelFQ7CJNbcw==", - "dependencies": { - "tslib": "^2.1.0" - } - }, - "node_modules/@fullcalendar/scrollgrid/node_modules/@fullcalendar/premium-common": { - "version": "5.11.0", - "resolved": "https://registry.npmjs.org/@fullcalendar/premium-common/-/premium-common-5.11.0.tgz", - "integrity": "sha512-XVLJwJQ26EhuglBM1flmrKtNt0BEUBHoazko/wvMiz5Yz17eABKQreFTidipOwjL3s74ifQzDoYpkQVn8TzpZQ==", - "dependencies": { - "@fullcalendar/common": "~5.11.0", + "@fullcalendar/common": "~5.10.1", + "@fullcalendar/premium-common": "~5.10.1", "tslib": "^2.1.0" } }, @@ -276,30 +225,13 @@ } }, "node_modules/@fullcalendar/timeline": { - "version": "5.11.0", - "resolved": "https://registry.npmjs.org/@fullcalendar/timeline/-/timeline-5.11.0.tgz", - "integrity": "sha512-2mASvwsXMR42Vlvwjnb5w0OvMDf8z2WCZXpLCd11lP/b+ZYOosCrJZZQWpzNfWYf7Y4Sqjo7q+YMPxnJqlichg==", + "version": "5.10.1", + "resolved": "https://registry.npmjs.org/@fullcalendar/timeline/-/timeline-5.10.1.tgz", + "integrity": "sha512-pFMhK4nsCvpsA63GPJQtT1RSS2OLlT9a2+fvsf2oQregBLcottJSlCjIsIuKP7hpQLimaSdLr2kNjh5hs8jKlw==", "dependencies": { - "@fullcalendar/common": "~5.11.0", - "@fullcalendar/premium-common": "~5.11.0", - "@fullcalendar/scrollgrid": "~5.11.0", - "tslib": "^2.1.0" - } - }, - "node_modules/@fullcalendar/timeline/node_modules/@fullcalendar/common": { - "version": "5.11.0", - "resolved": "https://registry.npmjs.org/@fullcalendar/common/-/common-5.11.0.tgz", - "integrity": "sha512-gWjbMAnN1u73Oqlgjbyky7i+3bY0hvFSnGT0YBPx44n874AkQa9e9OU12PMLTMOPy0tXPb8DEwRelFQ7CJNbcw==", - "dependencies": { - "tslib": "^2.1.0" - } - }, - "node_modules/@fullcalendar/timeline/node_modules/@fullcalendar/premium-common": { - "version": "5.11.0", - "resolved": "https://registry.npmjs.org/@fullcalendar/premium-common/-/premium-common-5.11.0.tgz", - "integrity": "sha512-XVLJwJQ26EhuglBM1flmrKtNt0BEUBHoazko/wvMiz5Yz17eABKQreFTidipOwjL3s74ifQzDoYpkQVn8TzpZQ==", - "dependencies": { - "@fullcalendar/common": "~5.11.0", + "@fullcalendar/common": "~5.10.1", + "@fullcalendar/premium-common": "~5.10.1", + "@fullcalendar/scrollgrid": "~5.10.1", "tslib": "^2.1.0" } }, @@ -4251,64 +4183,26 @@ } }, "@fullcalendar/resource-common": { - "version": "5.11.0", - "resolved": "https://registry.npmjs.org/@fullcalendar/resource-common/-/resource-common-5.11.0.tgz", - "integrity": "sha512-zO6UK9IKo7O8Uj5Y1t9sLMsLyNmxAliriAlz/NNhk//O/yGmQZ5MQOgVDg2qCZpDOWgQeuSZOkTTJdud5ISe2Q==", + "version": "5.10.1", + "resolved": "https://registry.npmjs.org/@fullcalendar/resource-common/-/resource-common-5.10.1.tgz", + "integrity": "sha512-20JR8cucAeJEXSbWVSj9USwsPGKb3dVQr8CBiXuHPbD0OLK93j7jhKjBlp/pRldtcJW9mIXC8ENQvw/aNZJ9Cw==", "requires": { - "@fullcalendar/common": "~5.11.0", - "@fullcalendar/premium-common": "~5.11.0", + "@fullcalendar/common": "~5.10.1", + "@fullcalendar/premium-common": "~5.10.1", "tslib": "^2.1.0" - }, - "dependencies": { - "@fullcalendar/common": { - "version": "5.11.0", - "resolved": "https://registry.npmjs.org/@fullcalendar/common/-/common-5.11.0.tgz", - "integrity": "sha512-gWjbMAnN1u73Oqlgjbyky7i+3bY0hvFSnGT0YBPx44n874AkQa9e9OU12PMLTMOPy0tXPb8DEwRelFQ7CJNbcw==", - "requires": { - "tslib": "^2.1.0" - } - }, - "@fullcalendar/premium-common": { - "version": "5.11.0", - "resolved": "https://registry.npmjs.org/@fullcalendar/premium-common/-/premium-common-5.11.0.tgz", - "integrity": "sha512-XVLJwJQ26EhuglBM1flmrKtNt0BEUBHoazko/wvMiz5Yz17eABKQreFTidipOwjL3s74ifQzDoYpkQVn8TzpZQ==", - "requires": { - "@fullcalendar/common": "~5.11.0", - "tslib": "^2.1.0" - } - } } }, "@fullcalendar/resource-timeline": { - "version": "5.11.0", - "resolved": "https://registry.npmjs.org/@fullcalendar/resource-timeline/-/resource-timeline-5.11.0.tgz", - "integrity": "sha512-+40sKEQj/ig6oh+8/FZPaFYtqI4e9wa/2XT2MTtzwDr3modHU0mQChlpcY8WQ+c6kyPjVwhO89BFiv2OeilLWw==", + "version": "5.10.1", + "resolved": "https://registry.npmjs.org/@fullcalendar/resource-timeline/-/resource-timeline-5.10.1.tgz", + "integrity": "sha512-gsqjr6Z+LQcNbQlHgaTtg/kF8l6yDRtIuMQbhFlTy71RJI//x2mHhLXgV40FJeEE+srp48xJPd89+rIhlyJ5Tw==", "requires": { - "@fullcalendar/common": "~5.11.0", - "@fullcalendar/premium-common": "~5.11.0", - "@fullcalendar/resource-common": "~5.11.0", - "@fullcalendar/scrollgrid": "~5.11.0", - "@fullcalendar/timeline": "~5.11.0", + "@fullcalendar/common": "~5.10.1", + "@fullcalendar/premium-common": "~5.10.1", + "@fullcalendar/resource-common": "~5.10.1", + "@fullcalendar/scrollgrid": "~5.10.1", + "@fullcalendar/timeline": "~5.10.1", "tslib": "^2.1.0" - }, - "dependencies": { - "@fullcalendar/common": { - "version": "5.11.0", - "resolved": "https://registry.npmjs.org/@fullcalendar/common/-/common-5.11.0.tgz", - "integrity": "sha512-gWjbMAnN1u73Oqlgjbyky7i+3bY0hvFSnGT0YBPx44n874AkQa9e9OU12PMLTMOPy0tXPb8DEwRelFQ7CJNbcw==", - "requires": { - "tslib": "^2.1.0" - } - }, - "@fullcalendar/premium-common": { - "version": "5.11.0", - "resolved": "https://registry.npmjs.org/@fullcalendar/premium-common/-/premium-common-5.11.0.tgz", - "integrity": "sha512-XVLJwJQ26EhuglBM1flmrKtNt0BEUBHoazko/wvMiz5Yz17eABKQreFTidipOwjL3s74ifQzDoYpkQVn8TzpZQ==", - "requires": { - "@fullcalendar/common": "~5.11.0", - "tslib": "^2.1.0" - } - } } }, "@fullcalendar/rrule": { @@ -4321,32 +4215,13 @@ } }, "@fullcalendar/scrollgrid": { - "version": "5.11.0", - "resolved": "https://registry.npmjs.org/@fullcalendar/scrollgrid/-/scrollgrid-5.11.0.tgz", - "integrity": "sha512-OPwLGLr0YF2qQYa9K1vPIGsodfAqPnugcwKLwnkiLprC2UybnPaIXvY6xMAHyVWSiBaeJSmkQ0J8mZDmfKjdTw==", + "version": "5.10.1", + "resolved": "https://registry.npmjs.org/@fullcalendar/scrollgrid/-/scrollgrid-5.10.1.tgz", + "integrity": "sha512-Hj6gzj2/sUUnozIMC0GBK60/ZTeDchp/Gc2S4F+05W6V4BoUXbIwav+EdAerfNFOv7EXWa9vM9Lq3A53iVWFVg==", "requires": { - "@fullcalendar/common": "~5.11.0", - "@fullcalendar/premium-common": "~5.11.0", + "@fullcalendar/common": "~5.10.1", + "@fullcalendar/premium-common": "~5.10.1", "tslib": "^2.1.0" - }, - "dependencies": { - "@fullcalendar/common": { - "version": "5.11.0", - "resolved": "https://registry.npmjs.org/@fullcalendar/common/-/common-5.11.0.tgz", - "integrity": "sha512-gWjbMAnN1u73Oqlgjbyky7i+3bY0hvFSnGT0YBPx44n874AkQa9e9OU12PMLTMOPy0tXPb8DEwRelFQ7CJNbcw==", - "requires": { - "tslib": "^2.1.0" - } - }, - "@fullcalendar/premium-common": { - "version": "5.11.0", - "resolved": "https://registry.npmjs.org/@fullcalendar/premium-common/-/premium-common-5.11.0.tgz", - "integrity": "sha512-XVLJwJQ26EhuglBM1flmrKtNt0BEUBHoazko/wvMiz5Yz17eABKQreFTidipOwjL3s74ifQzDoYpkQVn8TzpZQ==", - "requires": { - "@fullcalendar/common": "~5.11.0", - "tslib": "^2.1.0" - } - } } }, "@fullcalendar/timegrid": { @@ -4361,33 +4236,14 @@ } }, "@fullcalendar/timeline": { - "version": "5.11.0", - "resolved": "https://registry.npmjs.org/@fullcalendar/timeline/-/timeline-5.11.0.tgz", - "integrity": "sha512-2mASvwsXMR42Vlvwjnb5w0OvMDf8z2WCZXpLCd11lP/b+ZYOosCrJZZQWpzNfWYf7Y4Sqjo7q+YMPxnJqlichg==", + "version": "5.10.1", + "resolved": "https://registry.npmjs.org/@fullcalendar/timeline/-/timeline-5.10.1.tgz", + "integrity": "sha512-pFMhK4nsCvpsA63GPJQtT1RSS2OLlT9a2+fvsf2oQregBLcottJSlCjIsIuKP7hpQLimaSdLr2kNjh5hs8jKlw==", "requires": { - "@fullcalendar/common": "~5.11.0", - "@fullcalendar/premium-common": "~5.11.0", - "@fullcalendar/scrollgrid": "~5.11.0", + "@fullcalendar/common": "~5.10.1", + "@fullcalendar/premium-common": "~5.10.1", + "@fullcalendar/scrollgrid": "~5.10.1", "tslib": "^2.1.0" - }, - "dependencies": { - "@fullcalendar/common": { - "version": "5.11.0", - "resolved": "https://registry.npmjs.org/@fullcalendar/common/-/common-5.11.0.tgz", - "integrity": "sha512-gWjbMAnN1u73Oqlgjbyky7i+3bY0hvFSnGT0YBPx44n874AkQa9e9OU12PMLTMOPy0tXPb8DEwRelFQ7CJNbcw==", - "requires": { - "tslib": "^2.1.0" - } - }, - "@fullcalendar/premium-common": { - "version": "5.11.0", - "resolved": "https://registry.npmjs.org/@fullcalendar/premium-common/-/premium-common-5.11.0.tgz", - "integrity": "sha512-XVLJwJQ26EhuglBM1flmrKtNt0BEUBHoazko/wvMiz5Yz17eABKQreFTidipOwjL3s74ifQzDoYpkQVn8TzpZQ==", - "requires": { - "@fullcalendar/common": "~5.11.0", - "tslib": "^2.1.0" - } - } } }, "@hapi/hoek": { diff --git a/package.json b/package.json index dc9000d..843dd97 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "@fullcalendar/adaptive": "^5.10.1", "@fullcalendar/bootstrap5": "^5.10.2", "@fullcalendar/list": "^5.10.1", - "@fullcalendar/resource-timeline": "^5.11.0", + "@fullcalendar/resource-timeline": "^5.10.1", "@fullcalendar/rrule": "^5.10.1", "@nextcloud/cdav-library": "^1.0.0", "bootstrap": "^5.1.3", From 433568751c542eb8e4ae60376bf8c7f152fd4cd5 Mon Sep 17 00:00:00 2001 From: Raito Bezarius Date: Mon, 25 Jul 2022 22:57:05 +0200 Subject: [PATCH 3/6] feat: associate events with resource IDs --- src/calendar.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/calendar.js b/src/calendar.js index 8b0aca2..236aeb8 100644 --- a/src/calendar.js +++ b/src/calendar.js @@ -1,3 +1,5 @@ +import STATIC_LOCATIONS from './static-ens-locations.json'; + // https://stackoverflow.com/a/35970186 function invertColor(hex) { if (hex.indexOf('#') === 0) { @@ -231,6 +233,18 @@ class Calendar { } } +function findLocationId(location) { + // TODO: Perform ad-hoc patches of location so it can be better associated. + // Strip '(Jourdan)' + // Relocate room number + + const result = Object.entries(STATIC_LOCATIONS).find(([building, rooms]) => rooms.includes(location)); + + if (result === undefined) return undefined; + const [building, _] = result; + return `${building}-${location}`; +} + function fcEventFromjCalEvent(cal) { return function (evt) { const start = new Date(evt.dtstart) @@ -249,6 +263,10 @@ function fcEventFromjCalEvent(cal) { fcEvent.description = evt.description fcEvent.location = evt.location || cal.default_location + if (fcEvent.location) { + fcEvent.resourceId = findLocationId(fcEvent.location); + } + if (evt.status) { fcEvent.status = evt.status fcEvent.classNames = [`st-${evt.status.toLowerCase()}`] From def68685888e3a6195fbdebeaf7d84b1a2eab21b Mon Sep 17 00:00:00 2001 From: Tom Hubrecht Date: Tue, 26 Jul 2022 02:32:26 +0200 Subject: [PATCH 4/6] Add locations --- src/App.svelte | 15 +++++++++------ src/calendar.js | 24 +++++++++++++----------- src/static-ens-locations.json | 25 ++++++++++++++++++------- 3 files changed, 40 insertions(+), 24 deletions(-) diff --git a/src/App.svelte b/src/App.svelte index c78c4fa..7f8a24f 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -75,11 +75,13 @@ headerContent: 'Salle' } ], - resources: Object.entries(ENSLocations).flatMap(([building, rooms]) => rooms.map(room => ({ - id: `${building}-${room}`, - building, - room - }))), + resources: Object.entries(ENSLocations).flatMap(([building, rooms]) => + rooms.map(room => ({ + id: `${building}-${room}`, + building, + room + })) + ), height: '100%', schedulerLicenseKey: 'CC-Attribution-NonCommercial-NoDerivatives', nowIndicator: true, @@ -97,7 +99,8 @@ eventSources: [], themeSystem: 'bootstrap5', nextDayThreshold: '05:00:00', - progressiveEventRendering: true + progressiveEventRendering: true, + expandRows: true }); const flatten = d => { diff --git a/src/calendar.js b/src/calendar.js index 236aeb8..d46907e 100644 --- a/src/calendar.js +++ b/src/calendar.js @@ -1,4 +1,4 @@ -import STATIC_LOCATIONS from './static-ens-locations.json'; +import STATIC_LOCATIONS from './static-ens-locations.json' // https://stackoverflow.com/a/35970186 function invertColor(hex) { @@ -94,7 +94,7 @@ const calendars = { color: null, initial: false }, - 'Ekjb4kDqMMqwJXZF': { + Ekjb4kDqMMqwJXZF: { cloud: clouds.ELEVES_ENS, name: 'Rentrée des départements', short_name: 'Dpt', @@ -106,20 +106,20 @@ const calendars = { short_name: 'Conf', color: null }, - 'PnRXqeq4SsSC33FM': { + PnRXqeq4SsSC33FM: { cloud: clouds.ELEVES_ENS, name: 'Visites de bibliothèques', short_name: 'Bibli', initial: false, color: null }, - 'NWPtiEiz62LTtjo2': { + NWPtiEiz62LTtjo2: { cloud: clouds.ELEVES_ENS, name: 'Amphis de rentrée', short_name: 'Prés. de rentrée', color: null }, - 'JiRt58aJXay9kfyk': { + JiRt58aJXay9kfyk: { cloud: clouds.ELEVES_ENS, name: 'Réunions de rentrée des Masters', short_name: 'Masters', @@ -173,7 +173,7 @@ export const calendarTree = { 'Réunions de rentrée des Masters': {}, 'Activités pour les étudiants internationaux': {} }, - 'Divers': {} + Divers: {} } export function getSubCalendars(name, tree = calendarTree) { @@ -238,11 +238,13 @@ function findLocationId(location) { // Strip '(Jourdan)' // Relocate room number - const result = Object.entries(STATIC_LOCATIONS).find(([building, rooms]) => rooms.includes(location)); + const result = Object.entries(STATIC_LOCATIONS).find(([building, rooms]) => + rooms.includes(location) + ) - if (result === undefined) return undefined; - const [building, _] = result; - return `${building}-${location}`; + if (result === undefined) return undefined + const [building, _] = result + return `${building}-${location}` } function fcEventFromjCalEvent(cal) { @@ -264,7 +266,7 @@ function fcEventFromjCalEvent(cal) { fcEvent.location = evt.location || cal.default_location if (fcEvent.location) { - fcEvent.resourceId = findLocationId(fcEvent.location); + fcEvent.resourceId = findLocationId(fcEvent.location) } if (evt.status) { diff --git a/src/static-ens-locations.json b/src/static-ens-locations.json index b514479..831defb 100644 --- a/src/static-ens-locations.json +++ b/src/static-ens-locations.json @@ -1,16 +1,27 @@ -{ "45 rue d'Ulm": - [ +{ + "45 rue d'Ulm": [ "Amphithéâtre Galois", + "Bibliothèque Lettres", "Salle Histoire", "Salle Cavaillès", "Salle Dussane", "Salle des Actes", - "Cour aux Ernest", - "Salle Jaurès" - ], - "29 rue d'Ulm": [ - "Bibliothèque des sciences expérimentales" + "Salle des Résistants", + "Salle Cavaillès", + "Salle Cartan", + "Salle Noether", + "Salle Bourbaki", + "Cour aux Ernests", + "Cour du NIR", + "Cour Pasteur", + "Pôt", + "Petit pôt", + "Canopée", + "K-Fêt", + "Cave d'hackENS", + "Gymnase" ], + "29 rue d'Ulm": ["Bibliothèque des sciences expérimentales", "Salle Jaurès"], "Jourdan": [ "Bibliothèque de Jourdan", "Salle Marcel Roncayolo (R2-05)", From 5c1c12b413bda398c9f4bfdab7aa72aa4a43a22f Mon Sep 17 00:00:00 2001 From: Raito Bezarius Date: Tue, 26 Jul 2022 13:07:03 +0200 Subject: [PATCH 5/6] feat: group resources, decrease width, perform adhoc patches of location with a static map --- src/App.svelte | 18 +++++------------- src/calendar.js | 16 +++++++++++----- src/static-ens-locations.json | 1 + 3 files changed, 17 insertions(+), 18 deletions(-) diff --git a/src/App.svelte b/src/App.svelte index 7f8a24f..0cff600 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -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%', diff --git a/src/calendar.js b/src/calendar.js index d46907e..c386ad9 100644 --- a/src/calendar.js +++ b/src/calendar.js @@ -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) { diff --git a/src/static-ens-locations.json b/src/static-ens-locations.json index 831defb..7357054 100644 --- a/src/static-ens-locations.json +++ b/src/static-ens-locations.json @@ -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", From fb034e4b6527f8ffecc70f9ee5bf441ad3d422b8 Mon Sep 17 00:00:00 2001 From: Tom Hubrecht Date: Tue, 26 Jul 2022 14:34:26 +0200 Subject: [PATCH 6/6] Fix location --- src/static-ens-locations.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/static-ens-locations.json b/src/static-ens-locations.json index 7357054..ea6f529 100644 --- a/src/static-ens-locations.json +++ b/src/static-ens-locations.json @@ -21,7 +21,7 @@ "Cave d'hackENS", "Gymnase" ], - "24 rue d'Ulm": ["Salle CONF IV"], + "24 rue Lhomond": ["Salle CONF IV"], "29 rue d'Ulm": ["Bibliothèque des sciences expérimentales", "Salle Jaurès"], "Jourdan": [ "Bibliothèque de Jourdan",