[Shipping labels] Print shipping label when print button is tapped #14545
+139
−11
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
WooShippingPostPurchaseViewModel.printLabel()
, which calls the action to fetch the label data and then presents it in the Air Print dialog.HighlightLoadingButtonStyle
, which shows theHighlightButtonStyle
with a loading indicator when the button is loading.WooShippingPostPurchaseView
to use the new button style andprintLabel()
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.
revampedShippingLabelCreation
feature flag.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
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: