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] Add basic UI for editing an origin address #14838

Open
wants to merge 10 commits into
base: trunk
Choose a base branch
from

Conversation

rachelmcr
Copy link
Contributor

@rachelmcr rachelmcr commented Jan 9, 2025

Part of: #13781

Description

This introduces UI to be used for editing an origin address in the Woo Shipping label flow. It includes:

  • Tapping the edit (pencil) button on an origin address opens the editing UI in a sheet.
  • A navigation bar with a cancel button.
  • Text fields for each of the text-editable address fields. If the address doesn't have a company name, it will show an "Add company" button by default.
  • Two menu-style buttons for country and state. For now these are non-actionable.
  • A toggle to set the address as the default origin address.

The following UI elements (and a view model to handle the logic) will be added in a later PR:

  • Selecting the country and (if applicable) state from a list.
  • Navigation between text fields in the form.
  • Local validation for each of the fields.
  • A label for whether the address is verified.
  • A button to save the changes.

Testing information

  1. Ensure the latest production version of WooCommerce Shipping (Version 1.3.2) is installed, activated, and set up on your store.
  2. Create or open an order with at least one physical product and the processing status.
  3. Tap "Create Shipping Label" in order details.
  4. Open the "Shipment details" bottom sheet.
  5. Tap the "Ship from" origin address.
  6. Tap the edit (pencil) icon on one of the origin addresses.
  7. Confirm a sheet opens with the details of the selected origin address prefilled.
  8. If the origin address does not have a company name, confirm the "Add company" button appears. Tap the button and confirm it is replaced by the "Company" field.
  9. Confirm all fields are marked as required (marked with a * by the label) except Company.
  10. Confirm the Company field has an "Optional" prompt when empty.
  11. Tap the "Cancel" button and confirm the sheet is dismissed.

Screenshots

No company name After tapping "Add company"
Simulator Screenshot - iPhone 16 Pro - 2025-01-09 at 18 05 12 Simulator Screenshot - iPhone 16 Pro - 2025-01-09 at 18 05 15

Screencast:

Simulator.Screen.Recording.-.iPhone.16.Pro.-.2025-01-09.at.18.05.58.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.

@rachelmcr rachelmcr added the feature: shipping labels Related to creating, ordering, or printing shipping labels. label Jan 9, 2025
@rachelmcr rachelmcr added this to the 21.4 milestone Jan 9, 2025
@dangermattic
Copy link
Collaborator

dangermattic commented Jan 9, 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 9, 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 Numberpr14838-d8f43fd
Version21.3
Bundle IDcom.automattic.alpha.woocommerce
Commitd8f43fd
App Center BuildWooCommerce - Prototype Builds #12451
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.

Comment on lines +87 to +89
if field.required {
Text("*")
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we maybe have explicit spacing for the HStack when we have "*" as required mark, or to add " " to the text string to have the spacing same as in Figma?
On Figma it appears that the "
" is part of the string itself so it has a bit less spacing.

Screenshot 2025-01-09 at 22 04 25

@wpmobilebot wpmobilebot modified the milestones: 21.4, 21.5 Jan 10, 2025
@wpmobilebot
Copy link
Collaborator

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

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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants