From 2269dd540f2a05ccbf77449025e0158054a61e7f Mon Sep 17 00:00:00 2001 From: Raito Bezarius Date: Mon, 25 Jul 2022 21:49:01 +0200 Subject: [PATCH] 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" + ] +}