Skip to content

Commit 1f28757

Browse files
committed
Accept Zoom links per room+slot
For online events such as Breakout Days, it does not make a lot of sense to reuse Zoom coordinates from one session to the next, as the notion of room does not make a lot of sense. The code now accepts to take an optional "Zoom" sheet in the spreadsheet that has "Room" and "Slot" as the first two columns, and Zoom information columns afterwards (as in the "Rooms" sheet). It uses the Zoom information in that sheet if it finds it and falls back to reusing the Zoom information at the room level otheriwse. When instructed to hide rooms, the code also no longer creates fake room names à la "R01", but rather sets the location to "Online" for Breakout days, and "No assigned room yet" otherwise. The new calendar grid still groups the sessions together in the same column, which is great. Via #333. The update also fixes a couple of hiccups that prevented it from actually setting Zoom coordinates in the new API calendar endpoint system...
1 parent 571b207 commit 1f28757

4 files changed

Lines changed: 19 additions & 6 deletions

File tree

test/stubs.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ async function getTestData(testDataId) {
188188
},
189189
rooms: toGraphQLRoomList(custom.rooms ?? ['Panic room (25)']),
190190
slots: toGraphQLSlotList(custom.slots ?? ['2042-04-07 9:00-10:00']),
191+
zoom: [],
191192
sessions: toGraphQLSessions(custom.sessions ?? [
192193
{ number: 1, title: 'A test session' }
193194
]),

tools/appscript/lib/project.mjs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ export function getProjectSheets(spreadsheet) {
1717
meetings: { titleMatch: /meetings/i },
1818
rooms: { titleMatch: /rooms/i },
1919
slots: { titleMatch: /slots/i },
20-
people: { titleMatch: /people/i }
20+
people: { titleMatch: /people/i },
21+
zoom: { titleMatch: /zoom/i }
2122
};
2223

2324
// Retrieve the sheets from the spreadsheet
@@ -216,6 +217,9 @@ export function getProject(spreadsheet) {
216217
})
217218
),
218219

220+
zoom: (sheets.zoom?.values ?? [])
221+
.filter(v => !!v.name),
222+
219223
sheets: sheets
220224
};
221225

tools/common/calendar.mjs

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -297,8 +297,12 @@ export function convertEntryToJSON({
297297
// Compute room location label
298298
let roomLocation = '';
299299
if (project.metadata.rooms === 'hide') {
300-
const roomIdx = project.rooms.findIndex(room => room.name === entry.meeting.room);
301-
roomLocation = 'R' + (roomIdx < 9 ? '0' : '') + (roomIdx + 1);
300+
if (project.metadata.fullType === 'breakouts-day') {
301+
roomLocation = 'Online';
302+
}
303+
else {
304+
roomLocation = 'No assigned room yet';
305+
}
302306
}
303307
else {
304308
const room = project.rooms.find(room => room.name === entry.meeting.room);
@@ -539,7 +543,8 @@ export async function synchronizeSessionWithCalendar(
539543
for (const entry of actions.update) {
540544
console.log(`- refresh calendar entry ${entry.url}, meeting in ${entry.meeting.room} on ${entry.day} ${entry.start} - ${entry.end}`);
541545
const room = project.rooms.find(room => room.name === entry.meeting.room);
542-
const zoom = project.metadata.rooms === 'hide' ? null : room;
546+
const zoom = project.zoom?.find(z => z.room === room.name && z.slot.startsWith(`${entry.day} ${entry.start}`)) ??
547+
(project.metadata.rooms === 'hide' ? null : room);
543548
entry.url = await updateCalendarEntry({
544549
calendarServer,
545550
entry, session, project,
@@ -550,7 +555,8 @@ export async function synchronizeSessionWithCalendar(
550555
for (const entry of actions.create) {
551556
console.log(`- create new calendar entry, meeting in ${entry.meeting.room} on ${entry.day} ${entry.start} - ${entry.end}`);
552557
const room = project.rooms.find(room => room.name === entry.meeting.room);
553-
const zoom = project.metadata.rooms === 'hide' ? null : room;
558+
const zoom = project.zoom?.find(z => z.room === room.name && z.slot.startsWith(`${entry.day} ${entry.start}`)) ??
559+
(project.metadata.rooms === 'hide' ? null : room);
554560
entry.url = await updateCalendarEntry({
555561
calendarServer,
556562
entry, session, project,
@@ -564,7 +570,7 @@ export async function synchronizeSessionWithCalendar(
564570
if (e1.day < e2.day) {
565571
return -1;
566572
}
567-
else if (e1.day > e2.date) {
573+
else if (e1.day > e2.day) {
568574
return 1;
569575
}
570576
else {

tools/common/project.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ export async function fetchProjectFromGitHub(reponame, sessionTemplate) {
5959
metadata: await importVariableFromGitHub(reponame, 'EVENT') ?? {},
6060
rooms: await importVariableFromGitHub(reponame, 'ROOMS') ?? [],
6161
slots: await importVariableFromGitHub(reponame, 'SLOTS') ?? [],
62+
zoom: await importVariableFromGitHub(reponame, 'ZOOM') ?? [],
6263
sessions: await fetchSessions(reponame)
6364
};
6465

@@ -139,6 +140,7 @@ export async function exportProjectToGitHub(project, { what }) {
139140
if (!what || what === 'all' || what === 'metadata') {
140141
await exportVariableToGitHub(reponame, 'EVENT', project.metadata);
141142
await exportVariableToGitHub(reponame, 'ROOMS', project.rooms);
143+
await exportVariableToGitHub(reponame, 'ZOOM', project.zoom);
142144
await exportVariableToGitHub(reponame, 'SLOTS', project.slots);
143145
}
144146

0 commit comments

Comments
 (0)