-
Notifications
You must be signed in to change notification settings - Fork 20
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
Landing pages backend scaffold #4247
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Co-authored-by: Leena Gupte <leena.gupte@digital.cabinet-office.gov.uk>
KludgeKML
force-pushed
the
landing-pages-backend-scaffold
branch
from
October 2, 2024 15:53
908f2d3
to
b77c4f0
Compare
leenagupte
force-pushed
the
landing-pages-backend-scaffold
branch
from
October 4, 2024 12:18
580a09e
to
fc48e1d
Compare
leenagupte
force-pushed
the
landing-pages-backend-scaffold
branch
from
October 4, 2024 15:37
9644434
to
c6e1ce0
Compare
leenagupte
force-pushed
the
landing-pages-backend-scaffold
branch
from
October 4, 2024 16:05
c6e1ce0
to
60f543b
Compare
leenagupte
force-pushed
the
landing-pages-backend-scaffold
branch
from
October 4, 2024 17:28
ac0ccb5
to
9c86881
Compare
leenagupte
force-pushed
the
landing-pages-backend-scaffold
branch
from
October 7, 2024 09:52
9c86881
to
44f11d5
Compare
leenagupte
force-pushed
the
landing-pages-backend-scaffold
branch
from
October 7, 2024 09:56
44f11d5
to
d80ca01
Compare
leenagupte
force-pushed
the
landing-pages-backend-scaffold
branch
from
October 7, 2024 11:10
d80ca01
to
a548355
Compare
A new flexible content type called a landing page is being created. The content type will allow publishers to pick the "blocks" that should be included on the page, e.g. govspeak, tabs, image, video, and decide on the order of these "blocks". As a content schema doesn't exist for the landing_page type yet, a fake content item has been added to the controller. This will be removed in a later PR once a content schema exists. The additional content data path has been created as a constant to allow it to be overwritten with fixtures in the tests, otherwise we'd be testing with live content.
This adds fake data for two content items. These will be replaced with real data in a later PR. Each of the types of "blocks" will be created in the following commits. Co-authored-by: Keith Lawrence <Keith.Lawrence@digital.cabinet-office.gov.uk>
It is likely that the different types of blocks will need their own models for their specific data requirements that builds on the base block. A "factory" is being used to determine which model to use in a similar way to that used to build the content item. However general ancestors are used to check that the block model is of the correct type rather than a direct ancestor as it will be necessary to have blocks within blocks to be able to handled different types of column blocks in later commits. Co-authored-by: Keith Lawrence <Keith.Lawrence@digital.cabinet-office.gov.uk>
This block doesn't not require any extra data so a new model does not need to be created for it. Co-authored-by: Keith Lawrence <Keith.Lawrence@digital.cabinet-office.gov.uk>
A block helper is being used rather than creating a tab model as all that is changing is how the block data is presented in the tab. Nothing new is being modelled. Co-authored-by: Keith Lawrence <Keith.Lawrence@digital.cabinet-office.gov.uk>
This block doesn't not require any extra data so a new model does not need to be created for it. Co-authored-by: Keith Lawrence <Keith.Lawrence@digital.cabinet-office.gov.uk>
This will form the foundation for adding blocks containing columns Co-authored-by: Keith Lawrence <Keith.Lawrence@digital.cabinet-office.gov.uk>
Co-authored-by: Keith Lawrence <Keith.Lawrence@digital.cabinet-office.gov.uk>
This block renders block content in the usual 2/3 and 1/3 proportions. It uses a theme to control classes on left and right side of blocks. Co-authored-by: Keith Lawrence <Keith.Lawrence@digital.cabinet-office.gov.uk>
Don't always override with fake data - try getting the content from the content store first, _then_ fallback to fake if not found.
Allows a blank page with a warning if there isn't a YAML file or blocks specified in the content item
The routing constraint has been added below account routes otherwise it causes the account session tests to fail. I think this is due to how the account content items are stubbed. It seems as though it hits the first matching route irrespective of document_type.
Ignores the cache-control test for now as this setting comes from the content item. Had to convert the response from content store into a hash so that extra items from YAML files could be merged into it. Also copies the dummy landing page yaml into a fixture for testing
leenagupte
force-pushed
the
landing-pages-backend-scaffold
branch
from
October 7, 2024 11:45
a548355
to
8699d4d
Compare
These tests don't do much as the actual rendering code hasn't been added yet, so it's difficult to know what should be on the page to check for.
leenagupte
force-pushed
the
landing-pages-backend-scaffold
branch
from
October 7, 2024 17:01
8699d4d
to
9b58e10
Compare
richardTowers
approved these changes
Oct 8, 2024
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.
Nice work both! Looks good to me!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Add the scaffolding required to render flexible "blocks", where the type of block, and the order of the blocks can be controlled by the user.
Why
A new flexible content type called a landing page is being created.
The content type will allow publishers to pick the "blocks" that should be included on the page, e.g. govspeak, tabs, image, video, and decide on the order of these "blocks".
How
The publishing app doesn't exist for these blocks yet, nor does a content schema.
Therefore, for the time being dummy content is being hard-coded. This will be replaced by actual hard-coded content when the first landing page is ready to go live. The hard-coded content will be removed when it is possible to publish the content from a CMS.
As a content schema doesn't exist for the landing_page type yet, a fake content item has been added to the controller. This will be removed in a later PR once a content schema exists.
Screenshots?
Rendered page