Skip to content

fix(integrations): normalize inbound option shape in configure view#4717

Merged
miguelpeixe merged 4 commits into
trunkfrom
fix/audience-inbound-options-rendering
May 13, 2026
Merged

fix(integrations): normalize inbound option shape in configure view#4717
miguelpeixe merged 4 commits into
trunkfrom
fix/audience-inbound-options-rendering

Conversation

@miguelpeixe
Copy link
Copy Markdown
Member

@miguelpeixe miguelpeixe commented May 12, 2026

All Submissions:

Changes proposed in this Pull Request:

class-integration.php injects incoming_metadata_fields.options as [{value, label}] objects, but the Inbound section in configure-view mapped them as if they were plain strings — so React got an object as the key for every checkbox and rendered [object Object] duplicates.

This PR normalizes each option to {value, label} (with bare-string back-compat) before binding the key, label, and selection logic.

How to test the changes in this Pull Request:

  1. While in trunk navigate to /admin.php?page=newspack-audience-integrations#/settings/esp
  2. Confirm you get a js fatal error and blank screen
  3. Checkout this branch, refresh the page and confirm the page renders with the Inbound fields listed

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?

…re view

class-integration.php injects incoming_metadata_fields.options as
[{value, label}] objects, but the Inbound section in configure-view
mapped them as if they were plain strings — so React got an object
as the key for every checkbox and rendered '[object Object]'
duplicates. Normalize each option to {value, label} (with bare-string
back-compat) before binding the key, label, and selection logic.
@miguelpeixe miguelpeixe changed the title fix(audience): normalize inbound option shape in integrations configure view fix(integrations): normalize inbound option shape in integrations configure view May 12, 2026
@miguelpeixe miguelpeixe changed the title fix(integrations): normalize inbound option shape in integrations configure view fix(integrations): normalize inbound option shape in configure view May 12, 2026
Copy link
Copy Markdown
Contributor

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 fixes the Audience → Integrations “Configure” view rendering for inbound metadata field options by normalizing the inbound option shape before using it for React checkbox keys/labels and selection logic.

Changes:

  • Normalize incoming_metadata_fields.options entries to { value, label } (while retaining bare-string backward compatibility).
  • Update checkbox key, label, checked, and onChange bindings to use the normalized option value/label.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/wizards/audience/views/integrations/configure-view.js Outdated
Comment thread src/wizards/audience/views/integrations/configure-view.js
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@miguelpeixe miguelpeixe requested a review from chickenn00dle May 13, 2026 17:08
@miguelpeixe miguelpeixe added the [Status] Needs Review The issue or pull request needs to be reviewed label May 13, 2026
@miguelpeixe miguelpeixe marked this pull request as ready for review May 13, 2026 17:08
@miguelpeixe miguelpeixe requested a review from a team as a code owner May 13, 2026 17:08
Copy link
Copy Markdown
Contributor

@chickenn00dle chickenn00dle left a comment

Choose a reason for hiding this comment

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

Thank you!

@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 May 13, 2026
@miguelpeixe miguelpeixe self-assigned this May 13, 2026
@miguelpeixe miguelpeixe merged commit 262c968 into trunk May 13, 2026
9 checks passed
@miguelpeixe miguelpeixe deleted the fix/audience-inbound-options-rendering branch May 13, 2026 17:13
@github-actions
Copy link
Copy Markdown

Hey @miguelpeixe, good job getting this PR merged! 🎉

Now, the needs-changelog label has been added to it.

Please check if this PR needs to be included in the "Upcoming Changes" and "Release Notes" doc. If it doesn't, simply remove the label.

If it does, please add an entry to our shared document, with screenshots and testing instructions if applicable, then remove the label.

Thank you! ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[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