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

layouts as objects #331

Merged

Conversation

dblatcher
Copy link
Contributor

What does this change?

updates #328
Changes the API format for layouts to be an object with an array of groups, rather than an array of groups.

This is to make the model easier to expand with extra data/config for the layout other than the groups of newsletters it contains.

It will also make the json data easier to handle in scala applications (EG frontend) which can more easily model the layout as (for example) a NewsletterLayout rather than a List[NewsletterGroup].

How to test

Should work as before locally.
If deployed to CODE, the existing layout data will be invalidated and may need to be manually deleted from S3

How can we measure success?

new model from the api responses

Have we considered potential risks?

#328 has not been put live yet, so there is no layout data in the PROD bucket to get invalidated by this change

@dblatcher dblatcher requested a review from a team as a code owner January 3, 2025 13:51
Copy link

@KaliedaRik KaliedaRik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes make sense. Happy to approve

@dblatcher dblatcher merged commit 814dc34 into dblatcher/store-layouts-in-s3 Jan 3, 2025
1 check passed
@dblatcher dblatcher deleted the dblatcher/layouts-as-objects branch January 3, 2025 15:55
dblatcher added a commit that referenced this pull request Jan 8, 2025
* define abstract and inMem class

* add get routes to api

* basic views on the UI

* load newsletters with the layouts

* display component

* add USE_IN_MEMORY_LAYOUT_STORAGE setting

* add a local option to disable the new UI route

* make the layout index page useful

* correct zod typing and support array data

* add post route for layouts

* can create new layouts from the map page

* layout page has json editor for layouts

* use a fixture json file for the initial local test data

* move components to subfolder, make the cards nicer

* move display logic out of the View component

* address possible falsy  editionId

* don't show the edit options to people without permisson

* add new permissions for edit layouts

* add layout routes to UI server

* sketch out the class defn

* use the s3 storage based on settings

* read and create work

* updating works

* add delete method

* fix format for put object commands

* add new routes to cache control

* lint - import style

* do not need a separate setting for layout storage

* correct setting name, remove route conditional

* correct variabel name, add TO DO for future PR

* add parsing

* layouts as objects (#331)

* nest the groups in an object

* lint

* correct create api call
dblatcher added a commit that referenced this pull request Feb 4, 2025
* define abstract and inMem class

* add get routes to api

* basic views on the UI

* load newsletters with the layouts

* display component

* add USE_IN_MEMORY_LAYOUT_STORAGE setting

* add a local option to disable the new UI route

* make the layout index page useful

* correct zod typing and support array data

* add post route for layouts

* can create new layouts from the map page

* layout page has json editor for layouts

* use a fixture json file for the initial local test data

* move components to subfolder, make the cards nicer

* move display logic out of the View component

* address possible falsy  editionId

* don't show the edit options to people without permisson

* add new permissions for edit layouts

* add layout routes to UI server

* sketch out the class defn

* use the s3 storage based on settings

* read and create work

* updating works

* add delete method

* fix format for put object commands

* add new routes to cache control

* lint - import style

* do not need a separate setting for layout storage

* correct setting name, remove route conditional

* correct variabel name, add TO DO for future PR

* add parsing

* layouts as objects (#331)

* nest the groups in an object

* lint

* correct create api call

* move edit json to another page

* add third route for the new editor, consolidate the MissingLayoutContent

* add basic editor that cannot add or remove groups yet

* tighten layout

* can add and remove groups

* make lib file for modify functions

* make look nicer

* nice searchable picker list

* Group Control component

* trivial linting

* handle loading/error states better

* undo config change

* picker use 1/4 of the container width

* picker use 1/4 of the container width - 2

* Apply suggestions from code review

Co-authored-by: Emily Bourke <[email protected]>

* disable use of @emotion/styled

* use the mui css import instead of emtion/styled

---------

Co-authored-by: Emily Bourke <[email protected]>
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.

2 participants