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

Task/cdd 2169 new landing page cms #1781

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

phill-stanley
Copy link
Contributor

@phill-stanley phill-stanley commented Sep 24, 2024

Description

This PR includes CMS updates for the new LandingPage

  • New landing page model for the CMS
  • Updates to build_cms_site command to create initial landing page

Fixes #CDD-2169


Type of change

Please select the options that are relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Tech debt item (this is focused solely on addressing any relevant technical debt)

Checklist:

  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests at the right levels to prove my change is effective
  • I have added screenshots or screen grabs where appropriate
  • I have added docstrings in the correct style (google)

@phill-stanley phill-stanley force-pushed the task/cdd-2169-new-landing-page-cms branch 3 times, most recently from 5f14c34 to cd63baa Compare September 25, 2024 15:09
@phill-stanley phill-stanley changed the title DRAFT: Task/cdd 2169 new landing page cms Task/cdd 2169 new landing page cms Sep 26, 2024
@phill-stanley phill-stanley force-pushed the task/cdd-2169-new-landing-page-cms branch from cd63baa to 49bab1f Compare September 26, 2024 08:03
Copy link

sonarcloud bot commented Sep 26, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
1 Security Hotspot
47.5% Duplication on New Code (required ≤ 3%)

See analysis details on SonarCloud

@@ -0,0 +1,6 @@
from django.apps import AppConfig
Copy link
Contributor

@A-Ashiq A-Ashiq Sep 26, 2024

Choose a reason for hiding this comment

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

What was your reasoning behind making an entirely new wagtail app for this?
What stopped you from just making a new LandingPage model within the home app? That way it would be referred to as home.LandingPage instead of landing_page.LandingPage.
In my mind, the app name describes the logical grouping


content_panels = Page.content_panels + [FieldPanel("sub_title"), FieldPanel("body")]

api_fields = [
Copy link
Contributor

Choose a reason for hiding this comment

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

If you add the list from the base page, you don't need to repeat the seo fields here:

    api_fields = UKHSAPage.api_fields + [
        APIField("title"),
        APIField("sub_title"),
        APIField("body")
    ]

3) The path of the current page.
This always returns an empty string
e.g. `""`
This is because the homepage is assumed
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
This is because the homepage is assumed
This is because the landing page is assumed

@@ -4,6 +4,7 @@
create_composite_page,
create_bulk_downloads_page,
create_landing_dashboard_page,
Copy link
Contributor

@A-Ashiq A-Ashiq Sep 26, 2024

Choose a reason for hiding this comment

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

Might be worth renaming this old handler ot be create_home_page, so its a bit clearer.
That's my bad, I saw my name against the git blame for that. Which in my defence was way before we embarked on the actual landing page re-work 😄
Then also rename your new one to just be create_landing_page or something like that

"type": "section",
"value": {
"heading": "Respiratory viruses",
"page_link": None,
Copy link
Contributor

@A-Ashiq A-Ashiq Sep 26, 2024

Choose a reason for hiding this comment

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

Presumably we're gonna have to come back and slide the links in for the topic index pages here?
And can the frontend handle when we don't send a link

@A-Ashiq
Copy link
Contributor

A-Ashiq commented Sep 26, 2024

Screenshot 2024-09-26 at 10 59 52

You'll need to make differnent help text for this? We restricted to 2 cards in the old home page, but we'll have a column limit this time around?

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