Skip to content
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

feat: upgrade myinfo-gov-client to 4.0.0 #1925

Merged
merged 2 commits into from
May 19, 2021

Conversation

mantariksh
Copy link
Contributor

@mantariksh mantariksh commented May 19, 2021

Upgrades @opengovsg/myinfo-gov-client to the latest version, and makes the necessary update to accommodate the breaking changes.

The latest version includes a breaking change which makes nested scope data optional (see PR). This is because there is no way of knowing whether a given MyInfoPerson data object contains the given nested scopes without knowing which scopes were requested in advance.

In FormSG's case, vehicles.vehicleno is the only nested scope we deal with, and this property is only accessed if the vehicleno field is requested, so the property access is safe. Hence the additional ? optional chain was added purely to accommodate the new types from myinfo-gov-client.

Manual tests

  • Add a Vehicle Number field to a MyInfo form. Test that the form can be submitted for a MyInfo profile with no prefilled vehicle number.
  • Use a profile with a prefilled vehicle number and check that the form can be submitted without editing the field.
  • Use a profile with a prefilled vehicle number and edit the field. Check that the form can still be submitted.

Copy link
Contributor

@seaerchin seaerchin left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Contributor

@karrui karrui left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Contributor

@chowyiyin chowyiyin left a comment

Choose a reason for hiding this comment

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

lgtm

@mantariksh mantariksh merged commit 7da9f2a into develop May 19, 2021
@mantariksh mantariksh deleted the feat/upgrade-myinfo-gov-client branch May 24, 2021 15:56
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