woocommerce / woocommerce-ios

WooCommerce iOS app
https://www.woocommerce.com/mobile
GNU General Public License v2.0
314 stars 113 forks source link

Screenshot: Add Coupon Card to the My Store section of Screenshot tool #14477

Closed hafizrahman closed 1 day ago

hafizrahman commented 1 day ago

Description

When generating screenshots on iPad device, previously My Store area might look a bit too empty because there's not enough cards on it.

This quick PR adds the Most Active Coupon card to the My Store are to fill in the space.

At the moment, the Coupon card is shown in empty state. I tried making it show mocked data, but it's non-trivial, because:

  1. The card fetches data from storage based on siteID value,
  2. The mocked Coupon can't have its siteID value set manually, it has to be set by its Mapper after retrieving network data:

https://github.com/woocommerce/woocommerce-ios/blob/89297f90de3c9248cbc403bedac8d599e4ce371b/Networking/Networking/Model/Coupon.swift#L11-L12

If you have suggestion on how to workaround that limitation, do let me know! At the moment I suppose it's OK because the Coupon card is not even shown fully. It's just there to help fill in the space.

Steps to reproduce

  1. Set target to WooCommerceScreenshot and pick a tablet device (I'm using iPad Pro 12.0 2nd gen with iOS 16)
  2. Build the app,
  3. Compare with screenshot below in "After"

To check the "Before" screenshot, repeat the steps above on the trunk branch.

Testing information

I tested this in Simulator with iPad Pro 12.0 2nd gen with iOS 16

Screenshots

Before After
Simulator Screenshot - ScreenShot iPad Pro 12 0 2nd Gen iOS 16 - 2024-11-21 at 12 24 19 Simulator Screenshot - ScreenShot iPad Pro 12 0 2nd Gen iOS 16 - 2024-11-21 at 12 21 38

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:

dangermattic commented 1 day ago
1 Warning
:warning: This PR is assigned to the milestone 21.2. This milestone is due in less than 2 days.
Please make sure to get it merged by then or assign it to a milestone with a later deadline.

Generated by :no_entry_sign: Danger

wpmobilebot commented 1 day ago

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 Numberpr14477-d0de94c
Version21.1
Bundle IDcom.automattic.alpha.woocommerce
Commitd0de94c4292e2338c394c8ba15d3763d526aab4f
App Center BuildWooCommerce - Prototype Builds #11696

Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.

hafizrahman commented 1 day ago

I added an extra commit to update the release note about fixing WooCommerceScreenshot, as the original PR didn't include it.