Skip to content

feat(settings): searchable country field with currency auto-fill - #1812

Open
Dijeomah wants to merge 2 commits into
mainfrom
feature_request/fix-main-settings-country-dropdown
Open

Dijeomah wants to merge 2 commits into
mainfrom
feature_request/fix-main-settings-country-dropdown

Conversation

@Dijeomah

@Dijeomah Dijeomah commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Brief summary of the change made

Closes: #1811
The country dropdowns in Main Settings and Add Village were long lists that couldn't be searched. Both now use a new shared CountrySelect component: type a few letters to narrow the list, then pick a country.

In Main Settings, picking a country also fills in its currency, unless you've already chosen a currency yourself. The country-to-currency mapping lives in countryCurrencies.json, and it suggests only currencies MPM supports. 12 missing African currencies, such as the Zambian and Malawian kwacha, are now in currency.json.

This also fixes three problems around Sites:

  • Leaving the Clusters dashboard before it finished loading no longer crashes the app.
  • With no Sites yet, the Sites page asks you to add one instead of spinning forever.
  • After creating a Site, Add Village now opens with that Site instead of failing.

Are there any other side effects of this change that we should be aware of?

Describe how you tested your changes?

Pull Request checklist

Please confirm you have completed any of the necessary steps below.

  • Meaningful Pull Request title and description
  • Changes tested as described above
  • Added appropriate documentation for the change.
  • Created GitHub issues for any relevant followup/future enhancements if appropriate.

The country dropdowns in Main Settings and Add Village were long lists that couldn't be searched. Both now use a new shared CountrySelect component: type a few letters to narrow the list, then pick a country.

In Main Settings, picking a country also fills in its currency, unless
  you've already chosen a currency yourself. The country-to-currency
  mapping lives in countryCurrencies.json, and only currencies MPM
  supports are suggested. 12 African currencies that were missing, such
  as the Zambian and Malawian kwacha, are now in currency.json.

This also fixes three problems around Sites:
  - Leaving the Clusters dashboard before it finished loading no longer
    crashes the app.
  - With no Sites yet, the Sites page asks you to add one instead of
    spinning forever.
  - After creating a Site, Add Village now opens with that Site instead
    of failing.

@dmohns dmohns left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good!!

Just one question regarding countries... I always disliked the fact that we are essentially managing countries and currencies in sooo many different places. countries tables, backend countries JSON , currencies JSON and frontend JSON.

Can we use this opportunity to simplify to a single source of truth? I don't think we need to split currency and countries. It can all be tracked in a single.

Also, I think there is some benefit of having a countries table in SQL. But this would mean for the frontend to do HTTP request to get pretty constant data.

What about if we have one countries/currencies JSON and share that between Frontend/Backend and also use the same JSON to populate countries table.

WDYT?

@Dijeomah

Dijeomah commented Dec 4, 2026

Copy link
Copy Markdown
Contributor Author

Looking good!!

Just one question regarding countries... I always disliked the fact that we are essentially managing countries and currencies in sooo many different places. countries tables, backend countries JSON , currencies JSON and frontend JSON.

Can we use this opportunity to simplify to a single source of truth? I don't think we need to split currency and countries. It can all be tracked in a single.

Also, I think there is some benefit of having a countries table in SQL. But this would mean for the frontend to do HTTP request to get pretty constant data.

What about if we have one countries/currencies JSON and share that between Frontend/Backend and also use the same JSON to populate countries table.

WDYT?
Sounds great, It'll make the resource load faster and not dependent on api calls.

….json

- Country data was spread over several files, and the frontend had its own
  country-to-currency map. countries.json now holds each country's name and
  currency.
- A tenant migration copies the currency into a new
  countries.currency_code column, and GET /api/countries returns it, so the
  frontend no longer needs a copy.

This branch has not been deployed

No deployments
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.

[Feature Request]: Searchable country field with currency auto-fill

2 participants