Skip to content

task/CDD 1379 page previews#3077

Open
jeanpierrefouche-ukhsa wants to merge 10 commits into
mainfrom
task/CDD-1379-page-previews
Open

task/CDD 1379 page previews#3077
jeanpierrefouche-ukhsa wants to merge 10 commits into
mainfrom
task/CDD-1379-page-previews

Conversation

@jeanpierrefouche-ukhsa

@jeanpierrefouche-ukhsa jeanpierrefouche-ukhsa commented Mar 17, 2026

Copy link
Copy Markdown

Description

CDD-1379 - Page Previews

Depends Upon: Front End branch: task/CDD-1379-page-previews (please pull the latest)

Date: 2026-02-27

Ticket: https://ukhsa.atlassian.net/browse/CDD-1379?search_id=055fe61d-bee9-48d9-80bc-ffb0f1c26b76&referrer=quick-find

Authors: Jean-Pierre Fouche

Impact: Affects all pages - broad testing required

Testing: Comprehensive unit tests supplied. UAT needed.

Summary

Allow editors of headless composite pages to click a Preview button that immediately redirects them to the external frontend application, rather than opening the built-in Wagtail iframe preview. Preview URLs include a short-lived signed token so the frontend can safely fetch draft content from the CMS.

Additionally, allow users to select an embargo date in order to preview otherwise embargoed data.

Continued in ./changelog/2026-02-27/CDD-1379.page-previews.md

Fixes #CDD-1379


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)

Comment thread cms/common/models.py
Comment thread cms/dashboard/models.py
Comment thread cms/dashboard/models.py
Comment thread cms/dashboard/serializers.py
Comment thread cms/dashboard/views.py
Comment thread cms/dashboard/views.py Outdated
Comment thread cms/dashboard/viewsets.py
Comment thread cms/dashboard/viewsets.py Outdated
Comment thread cms/dashboard/viewsets.py
Comment thread cms/dashboard/viewsets.py
Comment thread cms/dashboard/wagtail_hooks.py
Comment thread cms/dashboard/wagtail_hooks.py Outdated
Comment thread cms/dashboard/wagtail_hooks.py
Comment thread cms/dashboard/wagtail_hooks.py Outdated
Comment thread metrics/api/settings/default.py Outdated
Comment thread metrics/api/settings/local.py Outdated
Comment thread scripts/_quality.sh
Comment thread tests/unit/cms/dashboard/test_serializers.py Outdated
@jeanpierrefouche-ukhsa jeanpierrefouche-ukhsa force-pushed the task/CDD-1379-page-previews branch 6 times, most recently from 46d2401 to 23231b1 Compare March 17, 2026 21:34
@jeanpierrefouche-ukhsa jeanpierrefouche-ukhsa marked this pull request as ready for review March 18, 2026 09:42
@jeanpierrefouche-ukhsa jeanpierrefouche-ukhsa requested a review from a team as a code owner March 18, 2026 09:42
@jrdh jrdh force-pushed the task/CDD-1379-page-previews branch from 0ee49d3 to 258dd9a Compare March 26, 2026 16:25

@jrdh jrdh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I've made lots of comments but this is looking really good! Worked nicely on my local machine 🙂

Comment thread cms/dashboard/views.py Outdated
Comment thread changelog/2026-02-27/CDD-1379.page-previews.md Outdated
Comment thread cms/dashboard/views.py Outdated
Comment thread cms/dashboard/views.py Outdated
Comment thread cms/dashboard/views.py Outdated
Comment thread scripts/_quality.sh Outdated
Comment thread scripts/_tests.sh
Comment thread tests/unit/cms/dashboard/test_preview_views_and_hooks.py Outdated
Comment thread tests/unit/cms/dashboard/test_preview_views_and_hooks.py
Comment thread tests/unit/cms/dashboard/test_preview_views_and_hooks.py Outdated
@jeanpierrefouche-ukhsa jeanpierrefouche-ukhsa force-pushed the task/CDD-1379-page-previews branch from 258dd9a to 3a013f1 Compare March 30, 2026 13:33
@aidan aidan force-pushed the task/CDD-1379-page-previews branch 2 times, most recently from 2fcd97f to 48bcdeb Compare June 10, 2026 14:24
@sonarqubecloud

Copy link
Copy Markdown

@aidan aidan force-pushed the task/CDD-1379-page-previews branch 3 times, most recently from 4acb611 to 7e4a71c Compare June 22, 2026 14:36
@aidan aidan force-pushed the task/CDD-1379-page-previews branch 5 times, most recently from 75b72db to 71349ae Compare June 23, 2026 12:08
jeanpierrefouche-ukhsa and others added 9 commits June 23, 2026 13:11
  Enable page previews to the configured frontend URL
    - with set embargo date
    - support for per-request disabling of caching
      via Cache-Control headers from the client
PR Review #3 - Apply auth to View Live

- move shared.py to appropriate locations
- django UTC timezone consistency in virtual_clock.py
- remove redundant embargo context helper
- tidy up typing import as it is used only once (from typing as t)
- default to None if page previews not enabled
- fix keyword args issue in virtual_clock.py - remove positional arg

task/CDD-1379-page-previews
update idna to 3.15
After discussion with @jrdh we decided 5 we needed this until performance
improves
@aidan aidan force-pushed the task/CDD-1379-page-previews branch 5 times, most recently from da4dc08 to 8d39a9d Compare June 23, 2026 14:09
@aidan aidan force-pushed the task/CDD-1379-page-previews branch from 8d39a9d to 284bab8 Compare June 23, 2026 14:12
@sonarqubecloud

Copy link
Copy Markdown

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.

3 participants