-
Notifications
You must be signed in to change notification settings - Fork 112
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
[Shipping labels] Remotely validate edited address #15023
Conversation
📲 You can test the changes from this Pull Request in WooCommerce iOS by scanning the QR code below to install the corresponding build.
|
891d5da
to
4269372
Compare
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.
LGTM! Just a minor non blocker comment 🚀 🚢
// MARK: Remote validation | ||
|
||
/// Whether the address is being remotely validated. | ||
@Published private(set) var isRemotelyValidating: Bool = false |
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.
According to the comment, would the property be named isRemotelyValidated
instead of validating
?
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.
No, this property is like an isLoading
property, tracking when the remote validation is in progress (so we can show the loading indicator on the button). I'll update the comment to make that clearer 👍
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.
Awesome, thanks for the clarification
Version |
Part of: #13781
⚠️ Based on #15020 ⚠️
Description
This adds remote validation to the address editing view in the Woo Shipping label flow.
When the "Validate & Save" button is tapped, it remotely validates the address and opens a sheet to confirm the address. This suggests the normalized address provided by the backend. (Note that we are matching the web behavior and displaying this view even if the entered and suggested addresses match.)
Changes
WooShippingEditAddressView
:unverified
tapping the primary button now calls the view model'sremotelyValidateAddress()
method (and shows a loading indicator while the request is in progress).normalizeAddressVM
is set, it opens a sheet with the normalize address view.WooShippingEditAddressViewModel
, we prepare the address to be validated with the current field values, call the remote action, and setnormalizeAddressVM
based on the response.WooShippingNormalizeAddressViewModel
is updated to include an ID (so it can be used as a SwiftUI sheet item) and its closure is now optional for convenience.Notes:
Testing information
Screenshots
Simulator.Screen.Recording.-.iPhone.16.Pro.-.2025-01-30.at.15.31.36.mp4
RELEASE-NOTES.txt
if necessary.Reviewer (or Author, in the case of optional code reviews):
Please make sure these conditions are met before approving the PR, or request changes if the PR needs improvement: