guardian / frontend

The Guardian DotCom.
https://theguardian.com
Other
5.85k stars 555 forks source link

fetch newsletter layouts #27587

Open dblatcher opened 2 weeks ago

dblatcher commented 2 weeks ago

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 https://github.com/guardian/newsletters-nx/pull/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?

Test

Run DCR (this branch - https://github.com/guardian/dotcom-rendering/pull/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

github-actions[bot] commented 2 weeks ago

Deploy build 3229 of dotcom:frontend-all to CODE

All deployment options - [Deploy build 3229 of `dotcom:frontend-all` to CODE](https://riffraff.gutools.co.uk/deployment/deployAgain?project=dotcom%3Afrontend-all&build=3229&stage=CODE&updateStrategy=MostlyHarmless&action=deploy) - [Deploy parts of build 3229 to CODE by previewing it first](https://riffraff.gutools.co.uk/preview/yaml?project=dotcom%3Afrontend-all&build=3229&stage=CODE&updateStrategy=MostlyHarmless) - [What's on CODE right now?](https://riffraff.gutools.co.uk/deployment/history?projectName=dotcom%3Afrontend-all&stage=CODE)

From guardian/actions-riff-raff.