Skip to content

Lay foundation for sending emails in the user preferred language#111

Draft
wasafiri wants to merge 371 commits into
wasafiri:mainfrom
mdod-tam:feature/i18n-email-locale
Draft

Lay foundation for sending emails in the user preferred language#111
wasafiri wants to merge 371 commits into
wasafiri:mainfrom
mdod-tam:feature/i18n-email-locale

Conversation

@wasafiri

Copy link
Copy Markdown
Owner
  • Add new locale column and needs_sync flag to email_templates
  • Surface sync state in admin UI to give editors visual feedback and ensure templates remain in sync
  • Move medical certification actions into MAILER_MAP instead of using
    fragile start_with? fallback in resolve_mailer to reduce complexity and improve maintainability

mepps and others added 30 commits December 19, 2025 12:48
Fix evaluators dashboard redirect
Fixed broken dashboard link in trainer view
… of direct modal replacements; improve error handling; refactor InvoicesController error handling into handle_update_error method; add explicit error messages for validation failures; fix missing_gad_reference? guard
- Replace turbo_modals_to_remove with 'modals' => 'modals' pattern
- Modals are now replaced (not removed), allowing them to be reopened
- Remove unused methods: standard_application_modals, build_proof_review_success_streams
- Mark turbo_modals_to_remove parameter as deprecated
- Update tests to expect modal container replacement instead of individual removals

Fixes the issue where modals couldn't be reopened after approving/rejecting proofs.
- Add constituent_full_name required by proof_rejected template
- Replace nil with empty strings for optional variables to prevent removal by .compact
- Fixes rejection emails failing with ArgumentError
- Fixes approval emails showing raw placeholder text
…bles

Fix missing email template variables
Refactor modal handling to use turbo_modals_to_remove; other fixes
Creates db:seed_policies rake task that seeds Policy records without requiring FactoryBot, enabling production deployment on Heroku and similar platforms. The existing db:seed command requires factory_bot_rails which is only available in the test group, causing LoadError in production.

Changes:
- Add lib/tasks/seed_policies.rake with production-safe task that uses find_or_initialize_by
- Update README.md with Production Deployment section documenting both policy and email template seeding for production environments
- Include clear warnings about not running db:seed in production
- Add instructions for creating admin users in production console

The task is idempotent and can be run multiple times safely.
…eeding

Add production-safe policy seeding rake task
Fixes to locale according to Rubocop report
mepps and others added 30 commits March 5, 2026 16:04
Move javascript to stiumulus controller, use setVisible
…ead of hardcoded header title literals; tweaks to views to reflect changes in template management; improve locale behavior with rejection reason selection
…in favor of recipient locale; update mailers to align; update tests
Paper application UX improvements
Redirect user to dashboard on sign up
Remove unsupported language options
…vice caused duplicate provider emails and misleading delivery_error noise; leave NotificationService read-only for tracking; enforce channel continuity in fallback behavior when sending rejection notes; update tests
…k to persist paper + portal applications language preference; honor guardian/dependent locale
…r needed

- Store medical cert rejection reason/code on proof_reviews (proof_type: medical_certification)
- Add delegators on Application to centralize the lookup
- Remove latest_medical_rejection_review(application) logic from MedicalProviderMailer; use logic in CertificationManagement
- Align paper medical form to use RejectionReason; pass reason_code
- Add missing_signature, illegible, incomplete_documentation to income/residency seeds
- Add illegible to medical_certification seeds
- Remove migration adding medical_certification_rejection_reason_code; add migration to drop both rejection columns
- Make predefined rejection reasons read-only
- Show custom note textarea only with "Other" and store custom note text as rejection reason
- Show guidance for income/residency rejection notes regarding applicant's preferred language
- Update tests
- Fix service test data setup to avoid seeded RejectionReason uniqueness conflicts
…tion reason in paper_applications#new and applications#show and other cleanups

- Fix stale custom text bug: medical cert upload now clears/disables the custom textarea when switching away from "Other"
- Update UI to reflect changes in rejection reason selection and display appropriate language notice
- Adjust tests to ensure proper validation of rejection reasons without notes
- Stop passing notes: from callers to downstream services (services still accept nil default; proof_reviews.notes will be nil for new rejections)
- Remove unused/dead proof upload view
- Update tests for renamed fields
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.

4 participants