Skip to content

Subscriber plans #21984

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

Merged
merged 39 commits into from
Jul 2, 2025
Merged

Subscriber plans #21984

merged 39 commits into from
Jul 2, 2025

Conversation

nbradbury
Copy link
Contributor

@nbradbury nbradbury commented Jul 1, 2025

This PR enables viewing a subscriber's plan details. To test:

  • In a debug build, enable the experimental subscriber feature
  • My Site > Subscribers
  • Tap a subscriber
  • Tap a subscriber plan
plan.mp4

@nbradbury nbradbury added the Subscribers View and manage newsletter subscribers label Jul 1, 2025
@dangermattic
Copy link
Collaborator

dangermattic commented Jul 1, 2025

3 Warnings
⚠️ strings.xml files should only be updated on release branches, when the translations are downloaded by our automation.
⚠️ This PR is larger than 300 lines of changes. Please consider splitting it into smaller PRs for easier and faster reviews.
⚠️ PR is not assigned to a milestone.

Generated by 🚫 Danger

nbradbury added 3 commits July 1, 2025 13:17
…-Android into feature/subscriber-plans

Conflicts:
	WordPress/src/main/java/org/wordpress/android/ui/subscribers/SubscriberDetailScreen.kt
	WordPress/src/main/java/org/wordpress/android/ui/subscribers/SubscribersActivity.kt
@wpmobilebot
Copy link
Contributor

wpmobilebot commented Jul 1, 2025

WordPress📲 You can test the changes from this Pull Request in WordPress by scanning the QR code below to install the corresponding build.
App NameWordPress WordPress
FlavorJalapeno
Build TypeDebug
Versionpr21984-beb4213
Commitbeb4213
Direct Downloadwordpress-prototype-build-pr21984-beb4213.apk
Note: Google Login is not supported on these builds.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Jul 1, 2025

Jetpack📲 You can test the changes from this Pull Request in Jetpack by scanning the QR code below to install the corresponding build.
App NameJetpack Jetpack
FlavorJalapeno
Build TypeDebug
Versionpr21984-beb4213
Commitbeb4213
Direct Downloadjetpack-prototype-build-pr21984-beb4213.apk
Note: Google Login is not supported on these builds.

@nbradbury nbradbury requested a review from Copilot July 1, 2025 17:44
Copy link

codecov bot commented Jul 1, 2025

Codecov Report

Attention: Patch coverage is 0% with 24 lines in your changes missing coverage. Please review.

Project coverage is 39.02%. Comparing base (7e154ad) to head (beb4213).
Report is 1 commits behind head on trunk.

Files with missing lines Patch % Lines
...s/android/ui/subscribers/SubscriberDetailScreen.kt 0.00% 24 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##            trunk   #21984   +/-   ##
=======================================
  Coverage   39.02%   39.02%           
=======================================
  Files        2153     2153           
  Lines      101494   101494           
  Branches    15585    15585           
=======================================
  Hits        39613    39613           
  Misses      58384    58384           
  Partials     3497     3497           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot

This comment was marked as outdated.

@nbradbury nbradbury requested a review from Copilot July 1, 2025 19:31
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enables viewing detailed subscriber plan information by extending the navigation flow and introducing a dedicated plan screen.

  • Added navigation state and route for a new Plan screen in SubscribersActivity
  • Introduced SubscriberPlanScreen composable with associated UI cards and icons
  • Updated SubscriberDetailScreen to display plan items as clickable entries and added new string resources and icons
Comments suppressed due to low confidence (2)

WordPress/src/main/java/org/wordpress/android/ui/subscribers/SubscriberPlanScreen.kt:46

  • This new SubscriberPlanScreen Composable introduces significant UI logic but lacks associated unit or UI tests; consider adding tests to cover rendering states (active, inactive, gift).
@Composable

WordPress/src/main/java/org/wordpress/android/ui/subscribers/SubscriberDetailScreen.kt:255

  • Missing import for clickable: please add import androidx.compose.foundation.clickable to avoid unresolved reference errors.
                        modifier = Modifier.clickable {

}
}

private fun SubscriptionPlan.isActive() = status.lowercase() == "active"

This comment was marked as resolved.

Comment on lines 170 to 174
titleState.value = subscriber.plans!![planIndex].title
SubscriberPlanScreen(
plan = subscriber.plans!![planIndex],
modifier = Modifier.padding(contentPadding)
)

This comment was marked as resolved.

val currency = Currency.getInstance(currencyCode)
val formatter = NumberFormat.getCurrencyInstance(Locale.getDefault())
formatter.currency = currency
formatter.format(amount)

This comment was marked as resolved.

Copy link

sonarqubecloud bot commented Jul 1, 2025

@nbradbury nbradbury marked this pull request as ready for review July 1, 2025 20:59
@nbradbury nbradbury requested a review from adalpari July 1, 2025 21:00
Copy link
Contributor

@adalpari adalpari left a comment

Choose a reason for hiding this comment

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

LGTM and works as expected!

@nbradbury nbradbury merged commit 3d539fb into trunk Jul 2, 2025
28 checks passed
@nbradbury nbradbury deleted the feature/subscriber-plans branch July 2, 2025 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Subscribers View and manage newsletter subscribers unit-tests-exemption
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants