-
Notifications
You must be signed in to change notification settings - Fork 3
SDKS-4200: Support pre-filled phone field #396
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
Conversation
🦋 Changeset detectedLatest commit: 036f495 The changes in this PR will be included in the next version bump. This PR includes changesets to release 10 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
View your CI Pipeline Execution ↗ for commit 036f495
☁️ Nx Cloud last updated this comment at |
d670f1d to
af9d7cb
Compare
| case 'PHONE_NUMBER': { | ||
| // No data to send | ||
| return returnObjectValueCollector(field, idx); | ||
| const defaultValues = data as PhoneNumberOutputValue; |
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.
This is a bit semantic, but the data represented here is the existing or "prefilled" data, rather than the default values which are found directly on the collector field, yeah?
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.
That's right, let me change this to pre-filled data
| required: boolean; // TODO: add to phone collector | ||
| validatePhoneNumber: boolean; // TODO: add to phone collector |
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.
Do these TODOs still need to be completed?
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.
I wasn't sure if we wanted to do this within the scope of this ticket. required was there before but we didn't do anything with it. validatePhoneNumber is new but I'm not sure if it's of value to the user or if DaVinci automatically validates on their end. And if we add them to the collector then where should they go in the output?
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.
If required has always been there, then it's a bug that we don't include it. It should be added to the output just like the other collectors.
As for validatePhoneNumber, if it's new, then we need to communicate this to the team and understand its purpose.
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.
We'll handle required and validatePhoneNumber in other tickets:
https://pingidentity.atlassian.net/browse/SDKS-4371
https://pingidentity.atlassian.net/browse/SDKS-4373
| // await expect(page.locator('#countryCode')).toBeVisible(); | ||
| // await page.locator('#countryCode').selectOption('US'); |
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.
Was the DaVinci flow this relies on changed?
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.
Yes, the form that the flow used was changed but it doesn't really have to do with this. If you look at the component that handles the phone collector in the app you'll find that it doesn't actually do anything with the #countryCode dropdown field. It just uses the country code value from the collector's input (which I've changed to output). That country code dropdown is separate from the phone number field and it was too messy to pass the dropdown value to the phone collector. So I opted to use the prefilled country code value from the collector.
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.
Some of these tests are growing pretty long and complex. That makes me a bit anxious that they will get more and more fragile.
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.
I agree, I also tried to reduce the amount of lines in these tests as much as I could. The last step in the tests, authentication with the registered device, doesn't seem to actually do anything according to the flow other than redirect back to the start of the flow so honestly we could remove the device authentication segment all together.
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.
Okay, let's remove anything that doesn't directly test the collectors themselves ... just to make them a tad more resilient.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #396 +/- ##
==========================================
+ Coverage 55.47% 55.63% +0.15%
==========================================
Files 32 32
Lines 2044 2051 +7
Branches 340 344 +4
==========================================
+ Hits 1134 1141 +7
Misses 910 910
🚀 New features to boost your workflow:
|
|
Deployed 002fc3d to https://ForgeRock.github.io/ping-javascript-sdk/pr-396/002fc3dc0e71aaacce501dc176570d07ad4ae07d branch gh-pages in ForgeRock/ping-javascript-sdk |
📦 Bundle Size Analysis📦 Bundle Size Analysis📊 Minor Changes📈 @forgerock/davinci-client - 34.2 KB (+0.1 KB) ➖ No Changes➖ @forgerock/sdk-utilities - 4.0 KB 11 packages analyzed • Baseline from latest Legend🆕 New package ℹ️ How bundle sizes are calculated
🔄 Updated automatically on each push to this PR |
af9d7cb to
036f495
Compare
JIRA Ticket
https://pingidentity.atlassian.net/browse/SDKS-4200
Description
Pre-fills both
phoneNumberandcountryCodein the PhoneCollector input and output when available. Updates unit tests and failing e2e tests.Added changeset