Skip to content
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

store layouts in s3 #328

Open
wants to merge 29 commits into
base: main
Choose a base branch
from
Open

store layouts in s3 #328

wants to merge 29 commits into from

Conversation

dblatcher
Copy link
Contributor

@dblatcher dblatcher commented Oct 28, 2024

What does this change?

  • makes a new data type for Editions Layouts - representing the arrangement of newsletters on https://www.theguardian.com/email-newsletters for the different editions (UK, US, AU, INT, EUR) of the page.
  • defines
    • an abstract class for a service to manage the storage of the editions layouts
    • an 'in memory' implementation using a static set of initial test data (for local development)
    • an s3 implementation (for CODE / PROD)
  • adds an API route to manage request from the UI to get and update the Editions Layouts from the UI
  • adds a new permission to control a user's ability to do updates (only available to "developer" profiles for now).
  • builds UI pages to display the layouts and allow user with the permission to edit them (using the existing JsonEditor component - with a view to developing more user-friendly UI later)

How to test

Run locally, with the "developer" permissions set in .env.local (see main readme for setup):
USER_PERMISSIONS={"[email protected]": 0}

go to http://localhost:4200/layouts to see the main UI - you should be able to create and edit layouts

shut down the app, change the user permission level to :
USER_PERMISSIONS={"[email protected]": 3}

run the app again and you go to go to http://localhost:4200/layouts - you should have read-only access

How can we measure success?

This moves towards having the arrangement on the /email-newsletters page controlled from the newsletters tool, rather than requiring PR's in the DCR repo.

subsequent PRs:

Have we considered potential risks?

The new pages are not in the nav bar yet, so users are unlikely to find them. We can modify this branch so it won't result in the new /layouts UI pages being made live with the current config - this can be done by editing apps/newsletters-api/src/register-ui-server.ts

It should be safe to have the newsletters API publish the /layouts routes - the data will be 'empty' unless we populate them in the UI

Images

Screenshot 2024-09-27 at 16 49 48 Screenshot 2024-09-27 at 16 49 26

Accessibility

@dblatcher dblatcher requested a review from a team as a code owner October 28, 2024 14:35
apps/newsletters-api/src/register-ui-server.ts Dismissed Show dismissed Hide dismissed
apps/newsletters-api/src/register-ui-server.ts Dismissed Show dismissed Hide dismissed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant