Skip to content

fix(web): scope email template languages to active languages - #1810

Open
thomasbeaudry wants to merge 2 commits into
mainfrom
fix/email-template-languages
Open

thomasbeaudry wants to merge 2 commits into
mainfrom
fix/email-template-languages

Conversation

@thomasbeaudry

@thomasbeaudry thomasbeaudry commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Added missing Spanish translations to both default email templates (new-user and remote-assignment) in packages/schemas
  • Scoped the language picker and validation in email template editors to the instance's active languages, so disabled languages no longer appear in the dropdown or trigger validation errors
  • Alphabetized language options on the admin settings page by their translated display name

Test plan

  • Unit tests pass for packages/schemas/src/mail (31 tests, including new es coverage)
  • Unit tests pass for NewUserTemplateSection, MailSettings, mail route (46 tests)
  • Unit tests pass for GroupEmailTemplates, CreateTemplateForm, EmailTemplateEditor (120 tests)
  • Manually verify: with only English and French enabled, Spanish does not appear in email template language dropdowns
  • Manually verify: language checkboxes on admin settings are sorted alphabetically

🤖 Generated with Claude Code

…Spanish defaults

Email template editors (new-user and group assignment) showed all three
languages regardless of which were enabled in the instance settings.
This scoped the language picker and validation to activeLanguages from
the setup state, so disabled languages no longer appear.

Also added the missing Spanish translations to both default email
templates and alphabetized the language options on the settings page.

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

@gdevenyi gdevenyi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The lint-and-test check fails, so review is on hold.

@opendatacapture/web#lint stops at tsc. The new required activeLanguages prop is not passed in the existing unit tests:

  • apps/web/src/components/GroupEmailTemplates/__tests__/EditTemplateDialog.test.tsx (line 35)
  • apps/web/src/components/GroupEmailTemplates/__tests__/ViewDefaultTemplateDialog.test.tsx (lines 18, 23, 33, 40)

Please pass activeLanguages in these tests, run pnpm lint and pnpm test:coverage locally, and push. Review continues when CI is green.

Reviewed at commit a338e3b.

`activeLanguages` became a required prop on EditTemplateDialog and
ViewDefaultTemplateDialog, but their own tests were not updated, so
`@opendatacapture/web#lint` stopped at tsc with five TS2741s.

Both fixtures leave Spanish out, which lets a new case assert the picker offers
only the languages the instance has enabled — the behaviour this branch adds.

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

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.

2 participants