Refactor screen to fix integrations newsletter setup blocker#258
Open
claudiulodro wants to merge 1 commit into
Open
Refactor screen to fix integrations newsletter setup blocker#258claudiulodro wants to merge 1 commit into
claudiulodro wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a UI dead-end in the Audience → Integrations screen for the Newsletter ESP integration by separating “provider connected” from “integration fully configured”, so users can reach the master list/audience configuration step after entering provider credentials.
Changes:
- Introduces an
is_connected()integration state (separate fromis_set_up()) and exposes it in the integrations settings payload. - Updates the Audience Integrations card action logic to route:
- Not connected → external setup URL (“Connect”)
- Connected but not set up → integration configure view (“Finish setup”)
- Set up → enable action (“Enable”)
- Adds/extends unit tests (PHP + JS) to cover the new state and routing behavior.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| plugins/newspack-plugin/includes/reader-activation/integrations/class-integration.php | Adds is_connected() default implementation + documentation. |
| plugins/newspack-plugin/includes/reader-activation/integrations/class-esp.php | Implements is_connected() for ESP and refactors is_set_up() accordingly. |
| plugins/newspack-plugin/includes/reader-activation/class-integrations.php | Surfaces is_connected in the integrations settings payload. |
| plugins/newspack-plugin/includes/reader-activation/integrations/README.md | Documents the new is_connected() override contract and UI behavior. |
| plugins/newspack-plugin/src/wizards/audience/views/integrations/settings-section.js | Updates card label/routing logic based on is_connected vs is_set_up. |
| plugins/newspack-plugin/src/wizards/audience/views/integrations/settings-section.test.js | Adds JS coverage for the updated card action routing. |
| plugins/newspack-plugin/tests/unit-tests/integrations/class-test-integrations.php | Adds PHP coverage for default is_connected() and payload surfacing. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
All Submissions:
Changes proposed in this Pull Request:
On a fresh Newspack install, it seems impossible to successfully 'Connect' the Newsletter integration in Integrations. Here's a full explanation, but tl;dr the integration says 'Connect' until you select a master list, but the screen to select a master list is not reachable while in the 'Connect' state:
How to test the changes in this Pull Request:
One architecture thing I want to flag is that this change introduces a new
is_connectedstate, so the class hasis_set_upandis_connected. We can probably avoid this if you hate it, or we can keep it if you think it's an important distinction.Other information: