Conversation
changelog: Internal, PO search in identity-site, Move full address entry PO search into identity-address-search package
39c55cd to
d96c43b
Compare
| locationsURL: new URL('/verify/in_person/usps_locations', window.location.href).toString(), | ||
| addressSearchURL: new URL('/api/addresses', window.location.href).toString(), |
There was a problem hiding this comment.
The pattern for other URLs is for the backend to pass them to the javascript app. I didn't do that here because it's a larger refactor, but I'm leaning towards creating a ticket for it
| locationsURL: '', | ||
| addressSearchURL: '', |
There was a problem hiding this comment.
There aren't good default values for these. I could move the logic for constructing the URLs to here, or follow the pattern for inPersonURL (which is for it to be optional and no default is defined). Or just leave it as-is here
There was a problem hiding this comment.
I am not sure the best answer here. I'd like to hear opinions on this.
| @@ -6,6 +6,7 @@ import type { LocationQuery, FormattedLocation } from '@18f/identity-address-sea | |||
| import FullAddressSearchInput from './full-address-search-input'; | |||
|
|
|||
There was a problem hiding this comment.
I like that you shortened file name. Now component name is the same as the file name.
|
|
||
| function FullAddressSearch({ | ||
| usStatesTerritories, | ||
| registerField, |
There was a problem hiding this comment.
I understand why you decided to pass in usStatesTerritories as a prop. If we use this component in sites, I imagine we will need to write an issue to get usStateTerritories in sites (help center). (I did not look into how we are getting these- jumping into another meeting). I imagine the lift to do this in sites and pass it in is not large so am okay with passing it in- just calling it out as some additional work I think
There was a problem hiding this comment.
That's a good point. For reference how this works in identity-idp is:
- US states and territories are defined in the Ruby app
- They're passed into the javascript application on the document capture page
- They're loaded into the InPerson context, per this PR
- They're passed down into the components in the PO search step, per this PR
As-is we'll have to redefine them in the identity-site repo
An alternative is that we could write a script to read from the Ruby file and write to a javascript file, and then publish the generated javascript file as part of an npm package. And then in the Ruby file add a file comment saying something like,
If you change this set of states/territories be sure to go run script
bin/update-states-and-territories.shand publish a new version of the npm package
I'm going to go ahead and merge this PR. If we do refactor it in some way I think it should be part of a different ticket. But let me know your thoughts about it
There was a problem hiding this comment.
I think a new ticket is a good idea, extra work and out of scope to get this working in identity-sites. I think both are fine. I don't think the list will change much over time just as long as we can think of a way to try to ensure both get updated in the future
|
I did test your branch. I tested with mock facilities, with no mock facilities, and hit PO (usps dev) and was successful. For all tests, in_person_full_address_entry_enabled in my application.yml file was set to true. |
gina-yamada
left a comment
There was a problem hiding this comment.
I am not seeing any concerns here. Manual testing all checks out and code change all make sense. I did have one comment about usStateTerritories- not a blocker just a thought/something to consider.
…ove-full-entry-address-form-into-address-search-package
🎫 Ticket
LG-10785
🛠 Summary of changes
document-capturejavascript package into theaddress-searchpackageusStatesTerritoriesdown into the full address entry components instead of having the low level components depend on the InPerson context provider🗺️ Next Steps
Once this PR is merged I'll publish a new version of the @18f/address-search package