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

Editionable landing pages #9525

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

Editionable landing pages #9525

wants to merge 7 commits into from

Conversation

KludgeKML
Copy link
Contributor

@KludgeKML KludgeKML commented Oct 15, 2024

https://trello.com/c/xZrRMK6P

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

Follow these steps if you are doing a Rails upgrade.

@KludgeKML KludgeKML mentioned this pull request Oct 15, 2024
@KludgeKML KludgeKML force-pushed the editionable-landing-pages branch 7 times, most recently from 61d0910 to b8f47e6 Compare October 17, 2024 14:47
@KludgeKML KludgeKML marked this pull request as ready for review October 17, 2024 14:50
KludgeKML and others added 7 commits October 17, 2024 16:28
- LandingPage is a new document type rendered by Frontend
  which constructs its page using blocks specified in
  the details of the content item (not to be confused with
  the reusable content blocks project).
- Here we add it as an editionable object, add a
  PublishingAPI presenter to allow it to be published,
  and update Whitehall's list of allowed rendering apps
  to include Frontend (this is the first, but the consolidation
  work means it won't be the last document type that will
  need this).
- base_path must exist and not already be taken
- body must be valid YAML (and more, root element must be blocks: - we can expand this to stricter testing, but maybe that should be by schema?)
- basic tests for validation and presentation
- _form partial is required for editions
- add resource route
- basic controller tests
- Add additional_significant_fields partial
- This handles editing the base_path the first time the
  document is created
- allow the slug parameter in EditionsController
- skip updating document slugs for landing pages. We
  want to be able to specify the base_path explicitly
  for these editions, so having them set automatically
  from the title is not desired.
- update model test

Co-authored-by: Richard Towers <richard.towers@digital.cabinet-office.gov.uk>
- Add redirect to new_document_controller to
  allow it to bounce landing pages to their controller.
@richardTowers
Copy link
Contributor

All looks good to me. I wonder if we should also set:

  def self.access_limited_by_default?
    true
  end

Like we do with statistical data sets

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