Skip to content

[8/10] Super-admin configurable countries list - #360

Open
hturnbull93 wants to merge 1 commit into
mainfrom
configurable-countries
Open

hturnbull93 wants to merge 1 commit into
mainfrom
configurable-countries

Conversation

@hturnbull93

@hturnbull93 hturnbull93 commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator

Screenshots: https://fedora.taila91c66.ts.net:8444/docs/20261021-134612-pr-360-configurable-countries.html

Moves the supported countries from a hardcoded list into the database. Global admins can now turn countries on and off under Platform settings.

Data

  • New Country table (code, name, enabled). code is the value already stored on volunteers, chapters and local groups (e.g. UK).
  • The migration seeds 32 countries from the old list: the 19 that were live are enabled, and the 13 that were commented out are disabled. It also adds any chapter country missing from that list, so no existing chapter breaks.
  • NationalChapter.country is now a foreign key to Country.code. A chapter already maps to exactly one country, so the chapter points at the country row instead of holding a copy of it.
  • Data impact: no existing rows change. Volunteer, project and local group country values are untouched. The anonymiser marks the new columns keep.

API

  • countries.list (public): every country, enabled or not, so a disabled one still shows its name wherever it is already stored.
  • admin.countries.setEnabled: global admins (ADMIN_EMAILS) only.
  • Signup, a first-time profile country and transfer requests only accept enabled countries (or Other). People who already gave a disabled country keep it.
  • Accepting a local group suggestion enables its country. So does opening a chapter, and the chapter picker now lists disabled countries too.
  • Server-side country names (notifications, the required-actions pool list, new chapter names) now come from the table.

UI

  • Platform settings has a new Countries section: one switch per country, and countries with a chapter are marked.
  • Every picker (signup, settings, confirm location, chapter move, admin local groups) offers only enabled countries. Displays use the names from the table.
  • The list is fetched once per page load and shared through React Query (useCountries). The settings page refreshes it after a toggle. Pages that show a country name wait for the list, so UK never flashes before United Kingdom.

Tests

  • Router tests: only global admins can toggle, on and off both work, an unknown code is refused, disabled countries are refused at signup, profile and transfer, and accepting a suggestion or opening a chapter enables the country.
  • Component tests: toggling on the platform settings page (including a failed save), the signup picker leaving out disabled countries, and settings still showing a disabled stored country's name.
  • e2e (spec 32): a super-admin disables a country and the signup picker stops offering it. Snapshots of the new section checked on desktop and mobile, in light and dark.

Decisions

  • "Super-admin" here means global admin. Since national chapters landed, the two are the same check.
  • The UI only enables and disables the seeded countries. Adding a brand-new country still needs a migration, because the issue only asked for enable/disable.
  • Someone in the holding pool can suggest a local group in any listed country, disabled ones included. That is how a new country gets asked for, and accepting the suggestion enables the country. A chapter still has to exist before a suggestion can be accepted.
  • Disabling a country that already has a chapter is allowed. The chapter keeps working; the country just stops appearing in signup pickers.
  • maintenance-checklist.md does not exist in the repo, so there was nothing to remove.

Closes #124

🤖 Generated with Claude Code

@hturnbull93
hturnbull93 force-pushed the gdpr-export-introspect branch from 13956ab to 2b2fc0e Compare October 21, 2026 13:15
@hturnbull93
hturnbull93 force-pushed the configurable-countries branch 2 times, most recently from f390f3a to 8c93daa Compare October 21, 2026 13:15
@hturnbull93 hturnbull93 changed the title Super-admin configurable countries list [9/12] Super-admin configurable countries list Oct 21, 2026
@hturnbull93 hturnbull93 changed the title [9/12] Super-admin configurable countries list [8/10] Super-admin configurable countries list Oct 22, 2026
@hturnbull93
hturnbull93 force-pushed the configurable-countries branch from 8c93daa to 8aa673a Compare October 22, 2026 17:17
@hturnbull93
hturnbull93 force-pushed the gdpr-export-introspect branch from 2b2fc0e to 03bd6a0 Compare October 22, 2026 17:17
@hturnbull93
hturnbull93 force-pushed the configurable-countries branch from 8aa673a to affdd2c Compare October 22, 2026 17:36
@hturnbull93
hturnbull93 force-pushed the gdpr-export-introspect branch 2 times, most recently from 27155df to 25d2199 Compare October 23, 2026 09:02
@hturnbull93
hturnbull93 force-pushed the configurable-countries branch from affdd2c to 1f17d73 Compare October 23, 2026 09:02
@hturnbull93
hturnbull93 force-pushed the gdpr-export-introspect branch from 25d2199 to a53a47d Compare October 23, 2026 09:16
@hturnbull93
hturnbull93 force-pushed the configurable-countries branch from 1f17d73 to 1a2fa73 Compare October 23, 2026 09:16
@hturnbull93
hturnbull93 force-pushed the gdpr-export-introspect branch from a53a47d to 52f6621 Compare October 23, 2026 09:17
@hturnbull93
hturnbull93 force-pushed the configurable-countries branch from 1a2fa73 to 1c57727 Compare October 23, 2026 09:17
@hturnbull93
hturnbull93 force-pushed the gdpr-export-introspect branch from 52f6621 to b7f5e60 Compare October 23, 2026 15:09
@hturnbull93
hturnbull93 force-pushed the configurable-countries branch from 1c57727 to 4e2fb1a Compare October 23, 2026 15:10
@hturnbull93
hturnbull93 force-pushed the gdpr-export-introspect branch from b7f5e60 to a80b95d Compare October 23, 2026 16:55
@hturnbull93
hturnbull93 force-pushed the configurable-countries branch from 4e2fb1a to 6d1f63d Compare October 23, 2026 16:55
@hturnbull93
hturnbull93 force-pushed the gdpr-export-introspect branch from a80b95d to 1a07121 Compare October 23, 2026 18:05
@hturnbull93
hturnbull93 force-pushed the configurable-countries branch from 6d1f63d to a7a2636 Compare October 23, 2026 18:05
@hturnbull93
hturnbull93 force-pushed the gdpr-export-introspect branch from 1a07121 to 229873c Compare October 23, 2026 23:10
@hturnbull93
hturnbull93 force-pushed the configurable-countries branch from a7a2636 to 4e890b5 Compare October 23, 2026 23:10
@hturnbull93
hturnbull93 force-pushed the gdpr-export-introspect branch from 229873c to b26831a Compare October 24, 2026 13:34
@hturnbull93
hturnbull93 force-pushed the configurable-countries branch from 4e890b5 to 3f6ad36 Compare October 24, 2026 13:34
@hturnbull93
hturnbull93 force-pushed the gdpr-export-introspect branch from b26831a to 0caeda5 Compare October 24, 2026 15:16
@hturnbull93
hturnbull93 force-pushed the configurable-countries branch from 3f6ad36 to 661e599 Compare October 24, 2026 15:16
A Country table (code, name, enabled) replaces the hardcoded list. The
migration seeds it from that list, with the entries it kept commented out
disabled, and a national chapter's country now references it. Global
admins turn countries on and off under Platform settings; a disabled
country leaves every picker and is refused for new choices, while values
already stored keep showing its name. Accepting a local group suggestion
or opening a chapter in a disabled country enables it, and someone in the
holding pool may suggest a group in any listed country.

The client reads the list once per page load from countries.list, and
pages showing a country name wait for it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@hturnbull93
hturnbull93 force-pushed the configurable-countries branch from 661e599 to 712fced Compare October 24, 2026 19:29
@railway-app

railway-app Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

🚅 Deployed to the catalyse-pr-360 environment in PauseAI Catalyse

Service Status Web Updated
web ❌ Build Failed (View Logs) Web Oct 24, 2026 at 7:34 pm UTC

This branch had an error being deployed

1 failed deployment
PauseAI Catalyse / catalyse-pr-360 — 712fced7 Deployed Oct 24, 2026 by railway-app[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Super-admin configurable countries list

1 participant