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] Print shipping label when print button is tapped #14545

Merged
merged 3 commits into from
Nov 27, 2024

Conversation

rachelmcr
Copy link
Contributor

Closes: #14538
Closes: #13685

Description

When the print button is tapped in the Woo Shipping label flow, we now fetch the label data from remote and present the print dialog. This doesn't change the behavior in the order details screen, which will be updated in a separate milestone.

How

  • Adds WooShippingPostPurchaseViewModel.printLabel(), which calls the action to fetch the label data and then presents it in the Air Print dialog.
  • Adds a new button style HighlightLoadingButtonStyle, which shows the HighlightButtonStyle with a loading indicator when the button is loading.
  • Updates WooShippingPostPurchaseView to use the new button style and printLabel() method when the button is tapped.

Testing information

Prerequisites: The WooCommerce Shipping extension is active on your store, and you have at least one order with a purchased shipping label.

  1. Enable the revampedShippingLabelCreation feature flag.
  2. Build and run the app.
  3. Go the Orders tab.
  4. Select an order with a purchased shipping label.
  5. Tap "View purchased shipping label."
  6. Select a paper size and tap the Print Shipping Label button.
  7. Confirm the button is disabled and shows a loading indicator while the label data is being fetched.
  8. After the label data loads, confirm the Air Print dialog appears with the shipping label.

Note: The available paper sizes in the Air Print dialog will depend on your selected printer.

Screenshots

Simulator.Screen.Recording.-.iPhone.16.Pro.-.2024-11-27.at.16.58.01.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.

Sorry, something went wrong.

@rachelmcr rachelmcr added the feature: shipping labels Related to creating, ordering, or printing shipping labels. label Nov 27, 2024
@rachelmcr rachelmcr added this to the 21.3 milestone Nov 27, 2024
@wpmobilebot
Copy link
Collaborator

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 Numberpr14545-c0cc5b3
Version21.2
Bundle IDcom.automattic.alpha.woocommerce
Commitc0cc5b3
App Center BuildWooCommerce - Prototype Builds #11801
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.

@rachelmcr rachelmcr merged commit a07724c into trunk Nov 27, 2024
19 of 20 checks passed
@rachelmcr rachelmcr deleted the issue/14538-print-label-ui branch November 27, 2024 21:39
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.

[Shipping labels] Integrate print label action into UI layer in Woo Shipping flow Printing Shipping Label
2 participants