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.
What is the value of this and can you measure success?
The /emai-newsletters page currently uses hard-coded data in the DCR repo describing how the newsletters should be arranged for each Edition (UK, US, Aus, International).
Any change to the layouts require a PR into DCR, but the data could instead be managed from the existing newsletters tool and published on the newsletters api, allowing editorial to self-serve for changes - see guardian/newsletters-nx#328
This PR has fronted provide the data on the page model to DCR so that DCR can use it instead of the hard coded version.
What does this change?
NewsletterSignupAgent
DotcomNewslettersPageRenderingDataModel
DotcomNewslettersPageRenderingDataModel
for a request for the /email-newsletters page, the layout for the Edition of the request is included in the model.Test
Run DCR (this branch - guardian/dotcom-rendering#12795 ) and frontend locally and open http://localhost:3000/email-newsletters
The layout data used will be from https://newsletters.code.dev-guardianapis.com/api/layouts - (if there is no layout defined for the Edition you are viewing, DCR will fallback to its default layout including all live newsletters)
Checklist