Skip to content

Prototype: network page visible to group organisers (RESDISCO-249) - #945

Draft
edwh wants to merge 10 commits into
developfrom
resdisco-249-network-page-visibility
Draft

edwh wants to merge 10 commits into
developfrom
resdisco-249-network-page-visibility

Conversation

@edwh

@edwh edwh commented Oct 19, 2026 •

Copy link
Copy Markdown
Collaborator

Draft prototype for discussion (RESDISCO-249). Not for merge as is.

The network page for existing volunteers and organisers of groups in the network. They can open it and see their network, without the coordinator-only parts. It is not a recruitment page and not the coordinators' admin view.

What it does now

  • New NetworkPolicy::viewPublic. It is true for admins, coordinators of the network, and any current member (volunteer or host) of a group in the network. view is unchanged. index and the navbar are unchanged.
  • NetworkController::show authorizes with viewPublic and computes canModerate. For non-coordinators, reporting_url is left out of the page data and tags are not loaded.
  • Coordinators' names and profile photos are shown to everyone who can open the page, so organisers know who to contact.
  • Groups near you: the five nearest approved, active groups in the network, sorted by distance. Distance comes from group latitude and longitude, not the area field. Each group is linked and shows its distance in km.
  • A viewer in several groups gets the nearest groups to any of them. Each group appears once, at its smallest distance. The viewer's own groups are left out. The section is hidden if the viewer has no group with a location in the network.
  • All time / Last 12 months toggle above the impact figures. All time is the default. Last 12 months means the last 12 completed calendar months (for example Oct 2025 to Sep 2026), and the page says which. The group count is always the current one.
  • The page loads its figures from the public GET /api/v2/networks/{id}/stats. It now takes period=last_12_months and returns the months covered. The v1 stats endpoint is coordinators only, so it would give organisers no figures.
  • Group::bulkGroupStats and Network::stats take an optional date window. The window comes from App\Helpers\StatsPeriod. The toggle is a PeriodToggle component used with v-model. The Fixometer and group pages can reuse both later. Only this page uses them now.
  • NetworkPage.vue: the groups and events moderation sections are behind canModerate. The "Export event list" item is hidden for non-coordinators. The Actions dropdown is hidden if empty. The tag, add-groups and reporting-link gates are unchanged.
  • The moderation APIs (/api/v2/moderate/*) already scope results to the caller's role. The export route is unchanged. The Export action is only hidden in the UI.
  • Leak fixes: the network iCal feed and the network CSV export now include only approved events from approved groups.
  • en / fr / fr-BE strings.
  • Tests:
    • NetworkPageVisibilityTest: a host and a volunteer get 200 with coordinators but no reporting link. A user with no group in the network gets 403. Coordinators and admins keep the full page. The nearest five groups come back sorted, without unapproved, archived or other networks' groups. A user in several groups gets the nearest to any, once each. There is no section without a located group.
    • testNetworkStatsForLastTwelveCompletedMonths and StatsPeriodTest cover the date window.
    • CalendarTest covers the feed. ExportTest is updated for the unapproved-group exclusion.
    • Jest covers the toggle and the nearby list.

Decisions (catch-up, 21 Oct)

  • Audience: existing volunteers and organisers of groups in the network, logged in. Not public, and not for recruiting groups.
  • Coordinators' names and photos are shown. We will ask coordinators for feedback on that later.
  • The reporting link is for coordinators and funders only, never ordinary organisers.
  • No pilot gating and no per-group opt-out. Leaving the network is the opt-out.
  • Nearby groups use distance between group coordinates.
  • Headline stats default to all time.

Screenshots

As a host of Hackney Fixers (all time, last 12 months, coordinators, nearby groups):

host view

In French:

host view in French

Not done

No per-network visibility setting, no public tier, no RESDISCO-248 events list (#944) integration. The same period toggle could go on the Fixometer and group headline stats later.

Adds NetworkPolicy::viewPublic; the network page hides coordinator names, the
reporting link, moderation queues and export for non-coordinators. Also only
include approved events/groups in the network calendar feed and CSV export.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@edwh edwh added the preview Deploy a Fly.io preview for this PR label Oct 19, 2026
…copes

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tion

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
edwh and others added 2 commits October 23, 2026 17:58
- Hosts of groups in the network see the coordinators' names and photos.
- A "Groups near you" section lists the five nearest approved, active groups in the network to the viewer's own
  group there (one they host if they have several), with the distance.
- The impact figures have an All time / Last 12 months toggle. /api/v2/networks/{id}/stats takes
  period=last_12_months: events in the last 12 completed calendar months, with the months returned; the group
  count stays the current one. bulkGroupStats and Network::stats take the window.
- The page loads its stats from that public v2 endpoint, so hosts get figures too; the v1 endpoint is
  coordinators only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
95b4636 stopped using partials.emissions_equivalent_consume_{low,high}_explanation, so translations:check
failed on them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 6a6061a)
…, reusable period toggle

Any volunteer or host of a group in the network can open the page (not only hosts).
The nearby section takes the nearest groups to any of the viewer's own groups in the
network, one entry per group at its smallest distance, excluding their own groups.
The last-12-completed-months window moves to App\Helpers\StatsPeriod and the toggle to
a PeriodToggle component so the Fixometer and group pages can reuse them later.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
3.9% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

This branch is waiting to be deployed

1 waiting deployment
preview — 59e17902 Waiting Oct 26, 2026 by edwh via Deploy preview #698
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

preview Deploy a Fly.io preview for this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant