-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Myinfo Child DOB #6648
Merged
Merged
fix: Myinfo Child DOB #6648
Conversation
This file contains 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
c0f2fef
to
c2000bb
Compare
foochifa
approved these changes
Aug 27, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally LGTM! Thanks for locating the problem @wanlingt
src/app/modules/submission/email-submission/email-submission.constants.ts
Show resolved
Hide resolved
frontend/src/templates/Field/ChildrenCompound/ChildrenCompoundField.tsx
Outdated
Show resolved
Hide resolved
foochifa
approved these changes
Aug 28, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving again haha LGTM Thanks @wanlingt
wanlingt
added a commit
that referenced
this pull request
Aug 29, 2023
* ref: shift MYINFO_DATE_FORMAT const to DateField * feat: parse and format myinfo DOB * fix: change dateFormat of ChildDateOfBirth * fix: add space to CHILD_PREFIX * fix: undo date formatting * fix: change date format * fix: add validation to backend * fix: move date constants to shared * ref: use shared formatMyinfoDate function * test: use correct import * fix: remove unused imports * docs: add explanation * ref: use const for myInfoFormattedValue
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.
Problem
Myinfo Child DOB is not showing up in the correct format in the frontend.
Solution
When the Myinfo Child DOB value is set, convert the date from the formats 'yyyy-MM-dd' to 'dd/MM/yyyy'.
The way the Myinfo Child values are processed is different from normal Myinfo fields. For example, for normal Myinfo fields, the preview of the field is distinct from the value of the field that's submitted. However, for Myinfo child fields, the value shown in the field is what's submitted. Hence, in this case, the formatting takes place in 2 areas:
ChildrenCompoundField
) before the field value is setmyinfo.util.ts
)(TODO for the future - Ideally, the Myinfo child values will be processed in the same way as the normal Myinfo fields)
Details
formatMyinfoDate
)Breaking Changes
Before & After Screenshots
(Look at the Child DOB field)
BEFORE:
![image](https://private-user-images.githubusercontent.com/56983748/262644812-a768f27a-f132-4f01-ae6d-4e4666df72c8.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjA3OTQ1OTEsIm5iZiI6MTcyMDc5NDI5MSwicGF0aCI6Ii81Njk4Mzc0OC8yNjI2NDQ4MTItYTc2OGYyN2EtZjEzMi00ZjAxLWFlNmQtNGU0NjY2ZGY3MmM4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MTIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzEyVDE0MjQ1MVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTkwYzRiNmQ1MWQ5ZWMwZTc1NzE2MDA1ZGRkMDYzNjJhYzQxMDBmNjNjMjUzZjhkN2NhYjA0MGU4N2FkMWJhMjkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.DQh6i3EgQZauG86Nsndcf10lzJ-T_TadkkbZUVJHzSQ)
AFTER:
![image](https://private-user-images.githubusercontent.com/56983748/262640266-93845398-5921-45a5-b92f-140c20b65796.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjA3OTQ1OTEsIm5iZiI6MTcyMDc5NDI5MSwicGF0aCI6Ii81Njk4Mzc0OC8yNjI2NDAyNjYtOTM4NDUzOTgtNTkyMS00NWE1LWI5MmYtMTQwYzIwYjY1Nzk2LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MTIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzEyVDE0MjQ1MVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWViNGQ2OGVmYzFjZjBkYTFjZDBhNjcyYTIxY2FjNWRmNjBlNTQ3NGIwNzRlMTg1ZGU3YTMzMDJlNzNiZjgxMDMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0._qdXIIqCkOTiQuiNlrqkp4JF0KQDE2-NjRaLZm4OkZY)
Tests
DOB
(already has existing Myinfo data) andMarriage Date
(has no existing Myinfo data)