woocommerce / woocommerce-android

WooCommerce Android app
https://www.woocommerce.com/mobile
GNU General Public License v2.0
277 stars 135 forks source link

Check black flagged websites on app launch #12792

Closed hichamboushaba closed 1 month ago

hichamboushaba commented 1 month ago

Closes: #12789 Closes: #12790

Depends on #12788

Description

This PR adds logic to fetch the site status from the WCPom endpoint on app launch to determine if the site is suspended or not, and then update the corresponding flags, this will ensure two cases:

  1. If a suspended site gets approved later, we'll show them the Jeptack upsells from inside.
  2. If a site gets suspended, then we'll hide the Jetpack installation upsells.

Steps to reproduce

  1. DM me to share with a suspended website (or the steps to create one)
  2. Open the app and sign in to the site.
  3. DM me to share steps to mark the site as not suspended.
  4. Open the app.

Testing information

Important: the Jetpack upsells might not show exactly on first launch if the fetch took a little bit long, but they will appear when changing the screen and going back, I think that this is fine for this use case and that listening to the preference to update the UI would be an overkill, a site being suspended or unsuspended wouldn't be a frequent change anyway, let me know what you think.

The tests that have been performed

^

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 month ago
1 Warning
:warning: This PR is assigned to the milestone 20.8. The due date for this milestone has already passed.
Please assign it to a milestone with a later deadline or check whether the release for this milestone has already been finished.
1 Message
:book:

This PR contains changes to Tracks-related logic. Please ensure (author and reviewer) the following are completed:

  • The tracks events must be validated in the Tracks system.
  • Verify the internal Tracks spreadsheet has also been updated.
  • Please consider registering any new events.
  • The PR must be assigned the category: tracks label.

Generated by :no_entry_sign: Danger

wpmobilebot commented 1 month ago
📲 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
Commit05655fc9871be01ec1b1084fd1f059510ba28587
Direct Downloadwoocommerce-wear-prototype-build-pr12792-05655fc.apk
wpmobilebot commented 1 month ago

📲 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
Commit05655fc9871be01ec1b1084fd1f059510ba28587
Direct Downloadwoocommerce-prototype-build-pr12792-05655fc.apk
codecov-commenter commented 1 month ago

Codecov Report

Attention: Patch coverage is 77.77778% with 6 lines in your changes missing coverage. Please review.

Project coverage is 40.86%. Comparing base (c0d7adb) to head (05655fc). Report is 10 commits behind head on trunk.

Files with missing lines Patch % Lines
...erce/android/ui/sitepicker/SitePickerRepository.kt 0.00% 5 Missing :warning:
...ain/kotlin/com/woocommerce/android/SiteObserver.kt 95.00% 0 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## trunk #12792 +/- ## ============================================ + Coverage 40.80% 40.86% +0.05% - Complexity 5753 5765 +12 ============================================ Files 1237 1237 Lines 69833 69852 +19 Branches 9699 9706 +7 ============================================ + Hits 28498 28545 +47 + Misses 38706 38672 -34 - Partials 2629 2635 +6 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.