-
Notifications
You must be signed in to change notification settings - Fork 31
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
use email-newsletter layout data from frontend #12795
base: main
Are you sure you want to change the base?
Conversation
"This PR is stale because it has been open 30 days with no activity. Unless a comment is added or the “stale” label removed, this will be closed in 3 days" |
This PR was closed because it has been stalled for 3 days with no activity. |
Size Change: 0 B Total Size: 894 kB ℹ️ View Unchanged
|
…om/guardian/dotcom-rendering into dblatcher-use-layout-from-frontend
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fantastic, thank you @dblatcher ! ⭐ 🚀
What does this change?
Instead of using the hard coded newsletter layouts, the /email-newsletters pages will get the data from the frontend page model (which was derives it from the newsletters API) - see:
One significant behaviour change is that DCR used to fallback to the UK layout if it did not have a layout hard coded for the editionId of the request (as was the case for EUR and INTL) - it would now fallback to the
reduceToDefaultGrouping
function to arrange the newsletters (which would previously be used if the UK layout was not defined either).On discussing with editorial, they would prefer to define layouts for EUR and INTL, so the data in the newsletters API (see https://newsletters-tool.gutools.co.uk/layouts) has been updated to match the hard coded data (as of the last update: #13248), with the layouts for EUR and INTL being set as copies of the UK data.
Why?
Will allow editorial to self-serve for changes to the page via the newsletters tool. This currently requires WebEx to do a PR for every change requested by editorial. 😢
Testing
CODE frontend uses the PROD newsletter API data, so when running this branch on CODE, the layouts defined at https://newsletters-tool.gutools.co.uk/layouts will be show on /email-newsletter
LOCAL frontend used CODE newsletter API data, so testing this branch with LOCAL frontend would show the layouts from https://newsletters-tool.code.dev-gutools.co.uk/layouts
Screenshots
{"ok":true,"total":1,"data":{"UK":[{"title":"my collection","subtitle":"a set of newsletters","newsletters":["today-uk","front-page","morning-briefing"]},{"title":"In depth","newsletters":["today-uk","afternoon-update","any-time"]}]}}