v1.14.2-present: event schedules, venues and map blocks, Present mode and its phone remote #33

Merged
ngu-git-admin merged 40 commits from event-schedule into main 2026-11-21 23:02:06 +00:00
Showing only changes of commit a79559d290 - Show all commits

View file

@ -135,9 +135,21 @@ const PREVIEWS = {
// the person, so it's looked up in the select options (a name, no // the person, so it's looked up in the select options (a name, no
// photo: the options carry no more). // photo: the options carry no more).
// A venue and an item's event and map location come from the // A venue and an item's event and map location come from the
// options the same way (088): an event as its title only. // options the same way (088): an event as its title only. A map
// block's sections (094) are made as the API makes them (shape.js):
// their keys the venue still has, the venue cut to those.
contentBlock: (row, options) => { contentBlock: (row, options) => {
const venue = venueFromOption(options?.venues?.find((v) => v.id === row.venue_id)); const venue = venueFromOption(options?.venues?.find((v) => v.id === row.venue_id));
const known = new Map((venue?.locations ?? []).map((l) => [l.key, l]));
const sections = (row.map_sections ?? [])
.map((section) => ({
name: section.name,
keys: (section.location_keys ?? "").split(",").filter((key) => known.has(key)),
}))
.filter((section) => section.keys.length);
const mapped = venue && sections.length
? { ...venue, locations: [...new Set(sections.flatMap((section) => section.keys))].map((key) => known.get(key)) }
: venue;
const shape = (item) => { const shape = (item) => {
const person = item.person_id ? options?.people?.find((p) => p.id === item.person_id) : null; const person = item.person_id ? options?.people?.find((p) => p.id === item.person_id) : null;
const event = item.event_id ? options?.events?.find((e) => e.id === item.event_id) : null; const event = item.event_id ? options?.events?.find((e) => e.id === item.event_id) : null;
@ -151,7 +163,11 @@ const PREVIEWS = {
items: (item.items ?? []).map(shape), items: (item.items ?? []).map(shape),
}; };
}; };
return <ContentBlocks blocks={[{ ...row, venue, items: (row.items ?? []).map(shape) }]} />; return (
<ContentBlocks
blocks={[{ ...row, venue: mapped, map_sections: sections, items: (row.items ?? []).map(shape) }]}
/>
);
}, },
}; };