fix(#544): fold translation purpose into residents speak; make all fields optional#545
Merged
need4deed merged 2 commits intoMay 20, 2026
Conversation
…elds optional
- formatLanguagesByPurpose now accepts LangPurpose | LangPurpose[] and dedupes by id
- OpportunityDetailsDisplay: residents speak aggregates RECIPIENT + TRANSLATION (deduped)
- OpportunityDetailsEdit: seed residents speak from RECIPIENT + TRANSLATION (deduped);
on save, sent as languagesResidents → BE stores all as TRANSLATION per API contract
- Save button: disabled={!isValid} only — empty fields no longer block saving
- opportunityDetailsSchema: dropped description.min(1), numberOfVolunteers refine,
languagesValidator required check, activities.min(1); kept description.max only
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…s typecheck Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #544
Changes
formatters.tsformatLanguagesByPurposenow acceptsLangPurpose | LangPurpose[]and dedupes byid— single-purpose callers are unaffectedOpportunityDetailsDisplay.tsxRECIPIENT+TRANSLATIONlanguages, deduped by idOpportunityDetailsEdit.tsxRECIPIENT+TRANSLATIONlanguages, deduped by idlanguagesResidents→ BE (parser-opportunity-patch-data.ts) stores all asTRANSLATIONper API contract (confirmed via source)disabled={!isValid}only —!isDirtyguard removedopportunityDetailsSchema.tsdescription.min(1),numberOfVolunteersrequired refine,languagesValidator"at least one" check,activities.min(1)description.max(MAX_DESCRIPTION_LENGTH)(real validation failure, not a required check)API contract note (re: Arturas' comment)
parseOpportunityin BE mapslanguagesResidents → LangPurpose.TRANSLATION. After the first save through this UI, any legacyRECIPIENT-purpose languages will be persisted asTRANSLATION. The display/edit aggregation is the same either way.