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

Commits on Oct 2, 2024

  1. Update ContentItem factory to handle different subclasses of ContentItem

    Co-authored-by: Leena Gupte <leena.gupte@digital.cabinet-office.gov.uk>
    KludgeKML and leenagupte committed Oct 2, 2024
    Configuration menu
    Copy the full SHA
    c85c2ab View commit details
    Browse the repository at this point in the history

Commits on Oct 7, 2024

  1. Add landing_page controller, routes, and basic view

    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.
    KludgeKML authored and leenagupte committed Oct 7, 2024
    Configuration menu
    Copy the full SHA
    440298e View commit details
    Browse the repository at this point in the history
  2. Add Dummy landing page 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>
    leenagupte and KludgeKML committed Oct 7, 2024
    Configuration menu
    Copy the full SHA
    cec72de View commit details
    Browse the repository at this point in the history
  3. Add a block model

    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>
    leenagupte and KludgeKML committed Oct 7, 2024
    Configuration menu
    Copy the full SHA
    a6aa3f2 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    c52a6f6 View commit details
    Browse the repository at this point in the history
  5. Add a govspeak content block.

    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>
    leenagupte and KludgeKML committed Oct 7, 2024
    Configuration menu
    Copy the full SHA
    0612ecb View commit details
    Browse the repository at this point in the history
  6. Add a tabs block and block helper

    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>
    leenagupte and KludgeKML committed Oct 7, 2024
    Configuration menu
    Copy the full SHA
    c6e5c16 View commit details
    Browse the repository at this point in the history
  7. Add a big number block

    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>
    leenagupte and KludgeKML committed Oct 7, 2024
    Configuration menu
    Copy the full SHA
    b2beefd View commit details
    Browse the repository at this point in the history
  8. Add a LayoutBase block

    This will form the foundation for adding blocks containing columns
    
    Co-authored-by: Keith Lawrence <Keith.Lawrence@digital.cabinet-office.gov.uk>
    leenagupte and KludgeKML committed Oct 7, 2024
    Configuration menu
    Copy the full SHA
    b3ae923 View commit details
    Browse the repository at this point in the history
  9. Add a block for equal size columns

    Co-authored-by: Keith Lawrence <Keith.Lawrence@digital.cabinet-office.gov.uk>
    leenagupte and KludgeKML committed Oct 7, 2024
    Configuration menu
    Copy the full SHA
    698a8ca View commit details
    Browse the repository at this point in the history
  10. Add a block for uneven size columns

    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>
    leenagupte and KludgeKML committed Oct 7, 2024
    Configuration menu
    Copy the full SHA
    4eba8b5 View commit details
    Browse the repository at this point in the history
  11. Fall back to fake data if no data in content item

    Don't always override with fake data - try getting the content from the
    content store first, _then_ fallback to fake if not found.
    KludgeKML authored and leenagupte committed Oct 7, 2024
    Configuration menu
    Copy the full SHA
    bfa1089 View commit details
    Browse the repository at this point in the history
  12. Show a blank page if there aren't any blocks

    Allows a blank page with a warning if there isn't a YAML file or blocks
    specified in the content item
    KludgeKML authored and leenagupte committed Oct 7, 2024
    Configuration menu
    Copy the full SHA
    28057b8 View commit details
    Browse the repository at this point in the history
  13. Add routing constraint as backup

    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.
    KludgeKML authored and leenagupte committed Oct 7, 2024
    Configuration menu
    Copy the full SHA
    575dd7f View commit details
    Browse the repository at this point in the history
  14. Add request tests

    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 committed Oct 7, 2024
    Configuration menu
    Copy the full SHA
    735359a View commit details
    Browse the repository at this point in the history
  15. Add placeholder system tests

    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 committed Oct 7, 2024
    Configuration menu
    Copy the full SHA
    9b58e10 View commit details
    Browse the repository at this point in the history

Commits on Oct 8, 2024

  1. Configuration menu
    Copy the full SHA
    f194508 View commit details
    Browse the repository at this point in the history