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

[Revamp Shipping Labels • Customs] Sync form #14959

Merged
merged 8 commits into from
Jan 27, 2025

Conversation

toupper
Copy link
Contributor

@toupper toupper commented Jan 23, 2025

Part of: #13784

Description

With this PR we sync the customs form to be sent remotely. We also implement the logic of whether the customs information is completed, and keep the customs view model so the data can be edited after the view is closed and re-opened.

Steps to reproduce

  1. Tap on Create Shipping Label on an order
  2. Tap on the Customs pencil
  3. Fill the customs form
  4. Tap on Save on Customs Details
  5. Check that the Customs badge is set to Completed in the Create Shipping Labels
  6. Open again the Customs form. Check that you can edit the data.

Verify in Xcode through a breakpoint in onCustomsFormFilled: in WooShippingCreateLabelsViewModel to verify that the data is changed.

Testing information

We don't sync the data remotely yet, we will test that the customs information is properly sent after implementing the shipping label request.

We also fix here this comment where selections aren't being preserved on device rotation. Here, as we keep a reference to the WooShippingCustomsFormViewModel the input data remains.

Screenshots

Simulator.Screen.Recording.-.iPhone.16.-.2025-01-23.at.11.03.51.mp4

  • I have considered if this change warrants user-facing release notes and have added them to 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:

  • The PR is small and has a clear, single focus, or a valid explanation is provided in the description. If needed, please request to split it into smaller PRs.
  • Ensure Adequate Unit Test Coverage: The changes are reasonably covered by unit tests or an explanation is provided in the PR description.
  • Manual Testing: The author listed all the tests they ran, including smoke tests when needed (e.g., for refactorings). The reviewer confirmed that the PR works as expected on all devices (phone/tablet) and no regressions are added.

@toupper toupper added type: task An internally driven task. feature: shipping labels Related to creating, ordering, or printing shipping labels. labels Jan 23, 2025
@toupper toupper added this to the 21.5 milestone Jan 23, 2025
@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Jan 23, 2025

WooCommerce iOS📲 You can test the changes from this Pull Request in WooCommerce iOS by scanning the QR code below to install the corresponding build.

App NameWooCommerce iOS WooCommerce iOS
Build Numberpr14959-0fafeb8
Version21.4
Bundle IDcom.automattic.alpha.woocommerce
Commit0fafeb8
App Center BuildWooCommerce - Prototype Builds #12693
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.

Base automatically changed from issue/13784-shipping-labels-customs-extra-details to trunk January 23, 2025 12:02
@toupper toupper requested a review from rachelmcr January 24, 2025 09:20
Copy link
Contributor

@rachelmcr rachelmcr left a comment

Choose a reason for hiding this comment

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

Works as expected!

We don't sync the data remotely yet, we will test that the customs information is properly sent after implementing the shipping label request.

We did already implement support for the shipping label purchase (as part of M1). But for the full flow to make sense I believe we need to limit the customs form to only international shipments.

@@ -38,7 +38,7 @@ final class WooShippingCustomsFormViewModel: ObservableObject {
@Published var itemsViewModels: [WooShippingCustomsItemViewModel] = []

func onDismiss() {
// TODO: Add missing values if possible
// Package Id and Name not necessary to sync remotely
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm curious about this; won't we eventually need to include the package ID/name so we can support multiple shipments (where each shipment may have its own customs form)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point, I updated the comment here 0fafeb8

@wpmobilebot wpmobilebot modified the milestones: 21.5, 21.6 Jan 24, 2025
@wpmobilebot
Copy link
Collaborator

Version 21.5 has now entered code-freeze, so the milestone of this PR has been updated to 21.6.

@toupper toupper merged commit d56364e into trunk Jan 27, 2025
13 checks passed
@toupper toupper deleted the issue/13784-shipping-labels-customs-send-form branch January 27, 2025 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature: shipping labels Related to creating, ordering, or printing shipping labels. type: task An internally driven task.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants