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

[Shipping Labels Revamp] Introduce Customs initial form #13378

Open
wants to merge 50 commits into
base: issue/add-initial-customs-entry-point
Choose a base branch
from

Conversation

ThomazFB
Copy link
Contributor

@ThomazFB ThomazFB commented Jan 22, 2025

Why

Partially fix issue #13366 by introducing the initial Customs form connected with the main Shipping Labels creation form.

The data validation and error handling will be delivered in the following PR.

The Product Details section will be delivered through issue #13367.

How

Introduces the ViewModel, Screen, and Fragment set for the Customs form, with the navigation action coming from the Shipping Labels creation form. It also defines the basic UI structure alongside the Content, Restriction, and ITN fields, with proper support for the Other option, opening an additional Text field for additional description.

Unit tests are also added for the ViewModel viewState and events controls.

Screen Capture

Screen_recording_20250130_144547.mp4

How to Test

In case you want to avoid having to fill the address data to access the Customs form, you can simply override the ShouldRequireCustomsForm use case always to return true to trigger the Customs data requirement forcefully.

  1. Open the Shipping Labels Creation form, click the edit button inside the Customs section
  2. Verify all UI options are operational and interactable.

Update release notes:

  • 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 big (tablet) and small (phone) in case of UI changes, and no regressions are added.

@ThomazFB ThomazFB added type: task An internally driven task. feature: shipping labels Related to creating, ordering, or printing shipping labels. labels Jan 22, 2025
@ThomazFB ThomazFB added this to the 21.5 milestone Jan 22, 2025
@ThomazFB ThomazFB linked an issue Jan 22, 2025 that may be closed by this pull request
@dangermattic
Copy link
Collaborator

dangermattic commented Jan 22, 2025

1 Warning
⚠️ This PR is larger than 300 lines of changes. Please consider splitting it into smaller PRs for easier and faster reviews.

Generated by 🚫 Danger

@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Jan 22, 2025

📲 You can test the changes from this Pull Request in WooCommerce-Wear Android by scanning the QR code below to install the corresponding build.
App Name WooCommerce-Wear Android
Platform⌚️ Wear OS
FlavorJalapeno
Build TypeDebug
Commit3fb4558
Direct Downloadwoocommerce-wear-prototype-build-pr13378-3fb4558.apk

@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Jan 22, 2025

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

App Name WooCommerce Android
Platform📱 Mobile
FlavorJalapeno
Build TypeDebug
Commit3fb4558
Direct Downloadwoocommerce-prototype-build-pr13378-3fb4558.apk

@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.

@ThomazFB ThomazFB changed the base branch from trunk to issue/add-initial-customs-entry-point January 28, 2025 19:38
@codecov-commenter
Copy link

codecov-commenter commented Jan 30, 2025

Codecov Report

Attention: Patch coverage is 85.00000% with 9 lines in your changes missing coverage. Please review.

Project coverage is 41.15%. Comparing base (092eeb8) to head (3fb4558).

Files with missing lines Patch % Lines
...glabels/customs/WooShippingCustomsFormViewModel.kt 89.47% 6 Missing ⚠️
...hippinglabels/WooShippingLabelCreationViewModel.kt 0.00% 3 Missing ⚠️
Additional details and impacted files
@@                             Coverage Diff                             @@
##             issue/add-initial-customs-entry-point   #13378      +/-   ##
===========================================================================
+ Coverage                                    41.12%   41.15%   +0.03%     
- Complexity                                    6497     6507      +10     
===========================================================================
  Files                                         1326     1327       +1     
  Lines                                        77601    77661      +60     
  Branches                                     10699    10701       +2     
===========================================================================
+ Hits                                         31913    31964      +51     
- Misses                                       42851    42860       +9     
  Partials                                      2837     2837              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ThomazFB ThomazFB marked this pull request as ready for review January 30, 2025 18:25
@ThomazFB ThomazFB requested a review from atorresveiga January 30, 2025 18:25
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. unit-tests-exemption
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Shipping Labels: Customs] Introduce Customs form main layout
4 participants