client homelessness start & summary updates (OUT-208, OUT-209, OUT-210, DEV-2408)#2003
Open
mikefeldberg wants to merge 8 commits intomainfrom
Open
client homelessness start & summary updates (OUT-208, OUT-209, OUT-210, DEV-2408)#2003mikefeldberg wants to merge 8 commits intomainfrom
mikefeldberg wants to merge 8 commits intomainfrom
Conversation
Reviewer's GuideAdds support for capturing and displaying a client’s approximate homelessness start date and living situation in profile forms, client detail, and client summary views, including date parsing/serialization updates and a new living situation summary panel. Sequence diagram for updating client homelessness start datesequenceDiagram
actor User
participant PersonalInfoForm
participant ReactHookForm
participant toUpdateClientProfileInputs
participant GraphQLClient as GraphQL_Client
participant Server
User->>PersonalInfoForm: Open personal info form
PersonalInfoForm->>ReactHookForm: useWatch on unhousedStartDate and livingSituation
User->>PersonalInfoForm: Select or clear unhoused start date in DatePicker
PersonalInfoForm->>ReactHookForm: setValue unhousedStartDate(date_or_null)
User->>PersonalInfoForm: Tap Save
PersonalInfoForm->>toUpdateClientProfileInputs: Build UpdateClientProfileInput(values, dirtyFields)
toUpdateClientProfileInputs->>toUpdateClientProfileInputs: Conditionally set updatedInputs.unhousedStartDate
toUpdateClientProfileInputs->>toUpdateClientProfileInputs: Convert Date to YYYY-MM-DD string
toUpdateClientProfileInputs-->>PersonalInfoForm: returns UpdateClientProfileInput
PersonalInfoForm->>GraphQLClient: mutate UpdateClientProfile with input
GraphQLClient->>Server: Send GraphQL mutation
Server-->>GraphQLClient: Persisted client with unhousedStartDate
GraphQLClient-->>PersonalInfoForm: Updated client profile
Class diagram for updated client profile personal info and summary componentsclassDiagram
class PersonalInfoState {
+string~id~
+string~californiaId~
+string~dateOfBirth~
+string~gender~
+string~givenName~
+string~middleName~
+string~surname~
+string~preferredLanguage~
+VeteranStatusEnum~veteranStatus~
+LivingSituationEnum~livingSituation~
+TProfilePhoto~profilePhoto~
+Date~unhousedStartDate~
}
class PersonalInfoForm {
+PersonalInfoForm()
-any control
-void setValue(fieldName, value)
}
class ClientProfile {
+ID~id~
+string~californiaId~
+string~dateOfBirth~
+string~gender~
+string~givenName~
+string~middleName~
+string~surname~
+LivingSituationEnum~livingSituation~
+string~unhousedStartDate~
+VeteranStatusEnum~veteranStatus~
+TProfilePhoto~profilePhoto~
}
class ClientSummaryLivingSituationProps {
+ClientProfilesQuery_client client
}
class ClientSummaryLivingSituation {
+ClientSummaryLivingSituation(props)
-ClientProfilesQuery_client client
}
class ClientProfileCardPersonalInfo {
+ClientProfileCardPersonalInfo(props)
-ClientProfile clientProfile
-string formattedDob
-string formattedUnhousedStartDate
}
class toUpdateClientProfileInputs {
+UpdateClientProfileInput toUpdateClientProfileInputs(values, dirtyFields)
}
class extractClientFormDataFn {
+PersonalInfoState extractClientFormData(clientProfile)
}
class UpdateClientProfileInput {
+ID~id~
+string~dateOfBirth~
+string~unhousedStartDate~
+string~gender~
+string~givenName~
+string~middleName~
+string~surname~
+LivingSituationEnum~livingSituation~
+VeteranStatusEnum~veteranStatus~
}
PersonalInfoForm --> PersonalInfoState : uses
PersonalInfoForm --> toUpdateClientProfileInputs : builds_update_input
extractClientFormDataFn --> PersonalInfoState : returns
extractClientFormDataFn --> ClientProfile : parses_unhousedStartDate
ClientSummaryLivingSituation --> ClientSummaryLivingSituationProps : uses
ClientSummaryLivingSituation --> ClientProfile : reads_livingSituation_and_unhousedStartDate
ClientProfileCardPersonalInfo --> ClientProfile : formats_unhousedStartDate
toUpdateClientProfileInputs --> UpdateClientProfileInput : returns
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 1 issue, and left some high level feedback:
- There are
console.logstatements left inextractClientFormDataforunhousedStartDate; these should be removed or guarded behind a debug flag before merging. - In
ClientSummaryLivingSituation.tsx, the interface and component are still namedClientSummaryIdentity; consider renaming them (and the props interface) to match the file's living-situation purpose for clarity and consistency. - The conversion/normalization logic for
dateOfBirthandunhousedStartDateintoUpdateClienProfileInputsis duplicated; consider extracting a small helper to keep the function more maintainable as additional date fields are added.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- There are `console.log` statements left in `extractClientFormData` for `unhousedStartDate`; these should be removed or guarded behind a debug flag before merging.
- In `ClientSummaryLivingSituation.tsx`, the interface and component are still named `ClientSummaryIdentity`; consider renaming them (and the props interface) to match the file's living-situation purpose for clarity and consistency.
- The conversion/normalization logic for `dateOfBirth` and `unhousedStartDate` in `toUpdateClienProfileInputs` is duplicated; consider extracting a small helper to keep the function more maintainable as additional date fields are added.
## Individual Comments
### Comment 1
<location path="libs/expo/betterangels/src/lib/screens/ClientProfileForms/ClientProfileForm/extractClientFormData.ts" line_range="71-72" />
<code_context>
+ });
+ }
+
+ console.log('unhousedStartDateAsDate', unhousedStartDateAsDate);
+ console.log('unhousedStartDate', unhousedStartDate);
return {
id,
</code_context>
<issue_to_address>
**🚨 issue (security):** Remove debugging console.log statements from the data extraction path
These logs run on every profile load, add avoidable noise, and may expose sensitive timeline data. Please remove them or guard them behind a debug flag/logger with appropriate log levels.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
...o/betterangels/src/lib/screens/ClientProfileForms/ClientProfileForm/extractClientFormData.ts
Outdated
Show resolved
Hide resolved
|
🚀 Expo continuous deployment is ready for betterangels!
iOS Simulator Build: Simulator Build Link |
Davit-BetterAngels
approved these changes
Apr 2, 2026
Contributor
Davit-BetterAngels
left a comment
There was a problem hiding this comment.
looks good. just remove 2 console logs sorcery mentioned
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.
OUT-208, OUT-209, OUT-210, DEV-2408
note: used a different house icon because asset wasn't provided. can update later
Summary by Sourcery
Capture and display a client’s living situation and approximate homelessness start date across profile forms, detail views, and client summary cards.
New Features:
Enhancements: