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

feat: segmentation criteria for subscriptions and memberships #2696

Merged
merged 8 commits into from
Oct 27, 2023

Conversation

dkoo
Copy link
Contributor

@dkoo dkoo commented Oct 13, 2023

All Submissions:

Changes proposed in this Pull Request:

Along with Automattic/newspack-popups#1230, adds support and UI for two new sets of criteria, based on subscriptions and memberships.

Also splits the UI for the single segment screen into smaller subsections, as the current set of sections was looking crowded as we add more criteria. (cc @thomasguillot)

Note that I moved some files around and renamed some others for consistency.

  • The ListsControl component is only used in the context of the Campaigns wizard, so I moved it out of the Newspack Components directory and into the components for the wizard. Also made this more abstract so it could be reused for all of the list__in and list__not_in criteria.
  • Renamed some of the components files in the Campaigns wizard folder from CamelCase to kebab-case, which matches most of our file naming across repos. Didn't try to be exhaustive about this.
  • Made some minor style and markup updates to the AutocompleteTokenfield component, to make the placement of the spinner component during loading more consistent and predictable.

Closes 1205451924709229/1205603536115944.

How to test the changes in this Pull Request:

  1. On master, register two new user accounts in separate sessions. On Account A, purchase a non-donation subscription product. On Account B, join any membership plan by satisfying the plan's requirements for granting access.
  2. Check out this branch and feat: segmentation criteria for subscriptions and memberships newspack-popups#1230. Create two new segments at the highest priority, one for Subscriptions with "Has active subscription(s)" targeting the subscription product purchased by Account A, and one for Memberships with "Has active membership(s)" targeting the membership plan joined by Account B. Also note the new organization of the single segment screen here, which splits the "Reader Activity" section into three separate sections:
Screenshot 2023-10-13 at 4 51 46 PM
  1. Test support for segmenting user accounts who already have active subscriptions/memberships upon login. In separate sessions, log in as Account A and Account B and confirm that after logging in, each session gets segmented to the corresponding subscription/membership segment.
  2. Test support for new subscriptions/memberships: In two new sessions, purchase the required subscription product and join the required membership plan. In each case confirm that you're segmented after completing the purchase/membership action.
  3. Test support for changes subscription/membership statuses. As an admin, cancel the subscription/membership for the test users. Log in as those test users and confirm that you no longer match the segments.
  4. Also test the new "Does not have active subscription/membership" criteria: the test users who have active subscriptions and memberships matching these criteria should not match these segments, while everyone else should.

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes, as applicable?
  • Have you successfully ran tests with your changes locally?

@dkoo dkoo added the [Status] Needs Review The issue or pull request needs to be reviewed label Oct 13, 2023
@dkoo dkoo requested a review from a team as a code owner October 13, 2023 23:02
@dkoo dkoo self-assigned this Oct 13, 2023
Copy link
Member

@adekbadek adekbadek left a comment

Choose a reason for hiding this comment

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

Left some non-blocking comments.

assets/wizards/popups/components/lists-control/index.js Outdated Show resolved Hide resolved
includes/data-events/listeners.php Show resolved Hide resolved
includes/data-events/listeners.php Show resolved Hide resolved
@github-actions github-actions bot added [Status] Approved The pull request has been reviewed and is ready to merge and removed [Status] Needs Review The issue or pull request needs to be reviewed labels Oct 20, 2023
@dkoo dkoo requested a review from adekbadek October 25, 2023 10:20
@dkoo
Copy link
Contributor Author

dkoo commented Oct 26, 2023

Also in 6b26f57, I fixed (hopefully for the last time) a style error in the positioning of the loading spinner for the AutocompleteTokenfield component. It should now always be overlaid on the autocomplete input field, whether or not there's a label or help description, and whether or not suggestions are being displayed.

@dkoo dkoo merged commit 4631b51 into master Oct 27, 2023
5 checks passed
@dkoo dkoo deleted the feat/product-ownership-criteria branch October 27, 2023 21:23
matticbot pushed a commit that referenced this pull request Oct 31, 2023
# [2.11.0-alpha.1](v2.10.0...v2.11.0-alpha.1) (2023-10-31)

### Features

* **donations:** process after-checkout-button params ([167a20e](167a20e))
* **recaptcha:** make recaptcha threshold configurable ([#2705](#2705)) ([f3ec1a6](f3ec1a6))
* segmentation criteria for subscriptions and memberships ([#2696](#2696)) ([4631b51](4631b51))
@matticbot
Copy link
Contributor

🎉 This PR is included in version 2.11.0-alpha.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

matticbot pushed a commit that referenced this pull request Nov 13, 2023
# [2.11.0](v2.10.3...v2.11.0) (2023-11-13)

### Bug Fixes

* get subscriptions from any order type ([#2744](#2744)) ([5f0bef3](5f0bef3))

### Features

* add donation processing filters ([#2720](#2720)) ([d041fa8](d041fa8))
* **donations:** process after-checkout-button params ([167a20e](167a20e))
* **emails:** support billing name on receipt email ([#2729](#2729)) ([c9ad368](c9ad368))
* **modal-checkout:** allow covering Stripe's fees  ([#2695](#2695)) ([420ca32](420ca32))
* new options for Stripe fees ([#2745](#2745)) ([c974352](c974352))
* **recaptcha:** make recaptcha threshold configurable ([#2705](#2705)) ([f3ec1a6](f3ec1a6))
* remove MC4WP from managed plugins ([#2723](#2723)) ([8026688](8026688))
* segmentation criteria for subscriptions and memberships ([#2696](#2696)) ([4631b51](4631b51))
* **stripe-migration:** support mapping of products by SKU ([#2725](#2725)) ([08f9569](08f9569))
@matticbot
Copy link
Contributor

🎉 This PR is included in version 2.11.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released on @alpha released [Status] Approved The pull request has been reviewed and is ready to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants