Context
The dashboard "Prochaine réunion" widget currently shows the next upcoming Event whose template is not a day off (see getNextMeeting in app/features/dashboard/server/dashboard.server.ts, which filters NOT: { template: { key: EventTemplateKey.DayOff } }). The visible template set is hard-coded.
Congregations differ on what should appear there:
- Some only want regular meetings (
midweek-meeting, weekend-meeting).
- Some want the memorial or one-off events to appear too.
- Some have custom
EventTemplate rows (field service meetings, elders' meetings, …) and want fine-grained control.
Proposal
Let an admin (Permission Admin or SettingsManager — TBD) configure which EventTemplates the widget surfaces.
UX sketch:
- New section in
/settings (or under congregation settings): "Tableau de bord — Prochaine réunion".
- Multi-select of the congregation's
EventTemplate rows. Default: all non-system templates.
- Persist as a
Setting row (key = 'dashboard.nextMeeting.visibleTemplateKeys', value = JSON array of EventTemplate.key strings).
Technical notes:
- Reuse the existing
Setting model + service. Setting has compound unique [key, congregationId] — remember to use findFirst({ where: { key } }), not findUnique (project gotcha).
- Store
EventTemplate.key strings (stable per-congregation, survive template renames), not IDs.
- Filter the picker with
!isSystemTemplate(key) (app/features/events/model/event-template.type.ts) — that excludes day-off (confidentiality guard from fix/event-widget) and freeform (arguably correct — freeform events shouldn't own the "next meeting" widget).
getNextMeeting reads the setting and, when unset, falls back to "all non-system templates". Replaces the current hard-coded NOT DayOff filter.
Estimate
~half a day. The EventTemplate rename (#267) removed the EventKind enum this issue was originally written against; the setting is now trivially a list of template keys, and isSystemTemplate() already exists.
Out of scope
- Per-user preference (this is a congregation-wide setting).
- Reordering / multiple "next" cards.
Related
Related to the security fix on branch fix/event-widget that stopped the widget from leaking other users' days off.
Context
The dashboard "Prochaine réunion" widget currently shows the next upcoming
Eventwhose template is not a day off (seegetNextMeetinginapp/features/dashboard/server/dashboard.server.ts, which filtersNOT: { template: { key: EventTemplateKey.DayOff } }). The visible template set is hard-coded.Congregations differ on what should appear there:
midweek-meeting,weekend-meeting).EventTemplaterows (field service meetings, elders' meetings, …) and want fine-grained control.Proposal
Let an admin (Permission
AdminorSettingsManager— TBD) configure whichEventTemplates the widget surfaces.UX sketch:
/settings(or under congregation settings): "Tableau de bord — Prochaine réunion".EventTemplaterows. Default: all non-system templates.Settingrow (key = 'dashboard.nextMeeting.visibleTemplateKeys', value = JSON array ofEventTemplate.keystrings).Technical notes:
Settingmodel + service.Settinghas compound unique[key, congregationId]— remember to usefindFirst({ where: { key } }), notfindUnique(project gotcha).EventTemplate.keystrings (stable per-congregation, survive template renames), not IDs.!isSystemTemplate(key)(app/features/events/model/event-template.type.ts) — that excludesday-off(confidentiality guard fromfix/event-widget) andfreeform(arguably correct — freeform events shouldn't own the "next meeting" widget).getNextMeetingreads the setting and, when unset, falls back to "all non-system templates". Replaces the current hard-codedNOT DayOfffilter.Estimate
~half a day. The
EventTemplaterename (#267) removed theEventKindenum this issue was originally written against; the setting is now trivially a list of template keys, andisSystemTemplate()already exists.Out of scope
Related
Related to the security fix on branch
fix/event-widgetthat stopped the widget from leaking other users' days off.