Skip to content

feat(dashboard): admin setting to choose which event kinds appear in the "next meeting" widget #186

Description

@mindsers

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    Wishlist

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions