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

Landing pages backend scaffold #4247

Merged
merged 17 commits into from
Oct 8, 2024
Merged

Conversation

KludgeKML
Copy link
Contributor

@KludgeKML KludgeKML commented Oct 2, 2024

⚠️ This repo is Continuously Deployed: make sure you follow the guidance ⚠️

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

Co-authored-by: Leena Gupte <leena.gupte@digital.cabinet-office.gov.uk>
@govuk-ci govuk-ci temporarily deployed to govuk-frontend-app-pr-4247 October 2, 2024 15:19 Inactive
@KludgeKML KludgeKML force-pushed the landing-pages-backend-scaffold branch from 908f2d3 to b77c4f0 Compare October 2, 2024 15:53
@govuk-ci govuk-ci temporarily deployed to govuk-frontend-app-pr-4247 October 2, 2024 15:53 Inactive
@govuk-ci govuk-ci temporarily deployed to govuk-frontend-app-pr-4247 October 2, 2024 16:03 Inactive
@govuk-ci govuk-ci temporarily deployed to govuk-frontend-app-pr-4247 October 2, 2024 20:21 Inactive
@govuk-ci govuk-ci temporarily deployed to govuk-frontend-app-pr-4247 October 3, 2024 08:24 Inactive
@govuk-ci govuk-ci temporarily deployed to govuk-frontend-app-pr-4247 October 3, 2024 10:27 Inactive
@govuk-ci govuk-ci temporarily deployed to govuk-frontend-app-pr-4247 October 3, 2024 10:39 Inactive
@govuk-ci govuk-ci temporarily deployed to govuk-frontend-app-pr-4247 October 3, 2024 14:44 Inactive
@govuk-ci govuk-ci temporarily deployed to govuk-frontend-app-pr-4247 October 3, 2024 15:23 Inactive
@govuk-ci govuk-ci temporarily deployed to govuk-frontend-app-pr-4247 October 3, 2024 15:36 Inactive
@govuk-ci govuk-ci temporarily deployed to govuk-frontend-app-pr-4247 October 3, 2024 15:49 Inactive
@govuk-ci govuk-ci temporarily deployed to govuk-frontend-app-pr-4247 October 3, 2024 15:54 Inactive
@govuk-ci govuk-ci temporarily deployed to govuk-frontend-app-pr-4247 October 4, 2024 12:17 Inactive
@leenagupte leenagupte force-pushed the landing-pages-backend-scaffold branch from 580a09e to fc48e1d Compare October 4, 2024 12:18
@govuk-ci govuk-ci temporarily deployed to govuk-frontend-app-pr-4247 October 4, 2024 12:18 Inactive
@govuk-ci govuk-ci temporarily deployed to govuk-frontend-app-pr-4247 October 4, 2024 13:55 Inactive
@leenagupte leenagupte force-pushed the landing-pages-backend-scaffold branch from 9644434 to c6e1ce0 Compare October 4, 2024 15:37
@govuk-ci govuk-ci temporarily deployed to govuk-frontend-app-pr-4247 October 4, 2024 15:37 Inactive
@leenagupte leenagupte force-pushed the landing-pages-backend-scaffold branch from c6e1ce0 to 60f543b Compare October 4, 2024 16:05
@govuk-ci govuk-ci temporarily deployed to govuk-frontend-app-pr-4247 October 4, 2024 16:05 Inactive
@govuk-ci govuk-ci temporarily deployed to govuk-frontend-app-pr-4247 October 4, 2024 16:30 Inactive
@govuk-ci govuk-ci temporarily deployed to govuk-frontend-app-pr-4247 October 4, 2024 17:10 Inactive
@leenagupte leenagupte force-pushed the landing-pages-backend-scaffold branch from ac0ccb5 to 9c86881 Compare October 4, 2024 17:28
@govuk-ci govuk-ci temporarily deployed to govuk-frontend-app-pr-4247 October 4, 2024 17:29 Inactive
@leenagupte leenagupte force-pushed the landing-pages-backend-scaffold branch from 9c86881 to 44f11d5 Compare October 7, 2024 09:52
@govuk-ci govuk-ci temporarily deployed to govuk-frontend-app-pr-4247 October 7, 2024 09:52 Inactive
@leenagupte leenagupte force-pushed the landing-pages-backend-scaffold branch from 44f11d5 to d80ca01 Compare October 7, 2024 09:56
@govuk-ci govuk-ci temporarily deployed to govuk-frontend-app-pr-4247 October 7, 2024 09:57 Inactive
@leenagupte leenagupte force-pushed the landing-pages-backend-scaffold branch from d80ca01 to a548355 Compare October 7, 2024 11:10
@govuk-ci govuk-ci temporarily deployed to govuk-frontend-app-pr-4247 October 7, 2024 11:11 Inactive
@leenagupte leenagupte marked this pull request as ready for review October 7, 2024 11:17
KludgeKML and others added 14 commits October 7, 2024 12:44
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 leenagupte force-pushed the landing-pages-backend-scaffold branch from a548355 to 8699d4d Compare October 7, 2024 11:45
@govuk-ci govuk-ci temporarily deployed to govuk-frontend-app-pr-4247 October 7, 2024 11:45 Inactive
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 leenagupte force-pushed the landing-pages-backend-scaffold branch from 8699d4d to 9b58e10 Compare October 7, 2024 17:01
@govuk-ci govuk-ci temporarily deployed to govuk-frontend-app-pr-4247 October 7, 2024 17:01 Inactive
@govuk-ci govuk-ci temporarily deployed to govuk-frontend-app-pr-4247 October 8, 2024 07:40 Inactive
Copy link
Contributor

@richardTowers richardTowers left a 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!

@richardTowers richardTowers merged commit b906d6d into main Oct 8, 2024
12 checks passed
@richardTowers richardTowers deleted the landing-pages-backend-scaffold branch October 8, 2024 07:54
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.

4 participants