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

fix: ensure localized segments object is an object, not array #1364

Merged
merged 1 commit into from
Nov 13, 2024

Conversation

dkoo
Copy link
Contributor

@dkoo dkoo commented Nov 12, 2024

All Submissions:

Changes proposed in this Pull Request:

Casts localized segments data as an object to ensure that it's of the expected type when read by the segmentation API. Avoids potential type errors in JS.

How to test the changes in this Pull Request:

  1. On release, disable or delete all segments in Newspack > Campaigns > Segments.
  2. On the front-end, in the JS console type newspack_popups_view.segments and observe that it's an empty array:
Screenshot 2024-11-12 at 4 05 15 PM
  1. Check out this branch, refresh, and confirm that it's now an object:
Screenshot 2024-11-12 at 4 07 23 PM

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 self-assigned this Nov 12, 2024
@dkoo dkoo requested a review from a team as a code owner November 12, 2024 23:07
@dkoo dkoo changed the base branch from trunk to release November 12, 2024 23:07
@dkoo dkoo merged commit 3b2403f into release Nov 13, 2024
9 checks passed
@dkoo dkoo deleted the hotfix/empty-segments-typecast branch November 13, 2024 16:13
matticbot pushed a commit that referenced this pull request Nov 13, 2024
## [3.1.2](v3.1.1...v3.1.2) (2024-11-13)

### Bug Fixes

* ensure localized segments object is an object, not array ([#1364](#1364)) ([3b2403f](3b2403f))
@matticbot
Copy link
Contributor

🎉 This PR is included in version 3.1.2 🎉

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants