Skip to content

Replace custom hero markup with DS hero component for Article & Methodology pages (CMS-307)#129

Merged
MaciekBaron merged 15 commits intomainfrom
CMS-307-stat-article-hero-ds-integration
Apr 1, 2025
Merged

Replace custom hero markup with DS hero component for Article & Methodology pages (CMS-307)#129
MaciekBaron merged 15 commits intomainfrom
CMS-307-stat-article-hero-ds-integration

Conversation

@janehughes
Copy link
Copy Markdown
Contributor

@janehughes janehughes commented Mar 24, 2025

What is the context of this PR?

This change updates the statistical article page & methodology pages to use the latest hero component grey variant from the design system.

How to review

  • Pull branch locally
  • Preview a statistical article page type
  • See that the hero looks and behaves as expected
  • Check the template and see that we are now using the design system hero component and the custom code has been removed
Local preview

statistical-article-hero

Follow-up Actions

  • Since removing the custom hero markup, some spacing issues appeared above the headline figures which will need addressing as part of headline figures updates (currently with DS team)
  • Further design updates for the hero are in progress with DS team so this may need updating again later on

@zerolab zerolab added front-end All things that improve the front-end output integration: Design System Integrates with https://service-manual.ons.gov.uk/design-system/ labels Mar 24, 2025
@janehughes janehughes marked this pull request as ready for review March 25, 2025 07:25
@janehughes janehughes requested a review from a team as a code owner March 25, 2025 07:25
Copy link
Copy Markdown
Contributor

@helenb helenb left a comment

Choose a reason for hiding this comment

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

Thanks @janehughes - I have reviewed and tested the front-end side of this, and added some suggestions regarding the rich text.

Can we also apply this header to other content types? If so, we may be able to remove the custom CSS for the headers as well.

Comment thread cms/jinja2/templates/pages/statistical_article_page.html Outdated
Comment thread cms/jinja2/templates/pages/statistical_article_page.html Outdated
@janehughes janehughes changed the title Replace custom hero markup with hero component from design system (CMS-307) Replace custom hero markup with DS hero component for Article & Methodology pages (CMS-307) Mar 26, 2025
@janehughes
Copy link
Copy Markdown
Contributor Author

janehughes commented Mar 26, 2025

Thanks @janehughes - I have reviewed and tested the front-end side of this, and added some suggestions regarding the rich text.

Can we also apply this header to other content types? If so, we may be able to remove the custom CSS for the headers as well.

Thank you @helenb I've updated the methodology page as well and updated the PR title/desc to include both stat article & methodology page. I've just done these for now as they're both using the grey variant so it keeps things consistent. I'm not sure if any other pages are ready to be updated yet.

Copy link
Copy Markdown
Contributor

@zerolab zerolab left a comment

Choose a reason for hiding this comment

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

Just a couple of formatting suggestions from me

Comment thread cms/jinja2/templates/pages/methodology_page.html Outdated
Comment thread cms/jinja2/templates/pages/statistical_article_page.html Outdated
Copy link
Copy Markdown
Contributor

@sanjeevz3009 sanjeevz3009 left a comment

Choose a reason for hiding this comment

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

Minor comment, other than that this looks good =)

Comment thread cms/navigation/templatetags/navigation_tags.py Outdated
Comment thread cms/jinja2/templates/pages/statistical_article_page.html
Copy link
Copy Markdown
Contributor

@MebinAbraham MebinAbraham left a comment

Choose a reason for hiding this comment

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

Would like to look at some deduplication in future, as there are shared elements that we can split to partials.

Copy link
Copy Markdown
Contributor

@MebinAbraham MebinAbraham left a comment

Choose a reason for hiding this comment

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

Could we add some simple functional tests to ensure the hero is as expected? i.e When census is ticked, the census logo is visible etc. We want to have confidence that we have configured the hero correctly and any breaking changes to DS are caught by our tests.

Guide: https://github.com/ONSdigital/dis-wagtail/blob/main/functional_tests/README.md

Copy link
Copy Markdown
Contributor

@helenb helenb left a comment

Choose a reason for hiding this comment

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

Looking good.

@MaciekBaron
Copy link
Copy Markdown
Contributor

@MebinAbraham additional integration tests added in af02a46

@MaciekBaron MaciekBaron merged commit 70f84c5 into main Apr 1, 2025
9 checks passed
@MaciekBaron MaciekBaron deleted the CMS-307-stat-article-hero-ds-integration branch April 1, 2025 10:47
nimasmi added a commit that referenced this pull request May 16, 2025
* Generic Index Page (#78)

* Ensure the highlighting works correctly for the table of contents (#94)

* Main Menu Template Tags (#85)

* Navigation templates tags added

* base template updated to use navigation template tags functionality, navigation_template_tags added and navigation_tags refactored.

* Main Menu (#41)

* _extract_highlight_item and _extract_url_item combined into one reusable function

* Type hinting fixed

* Using get_dummy_quest from wagtail for mocking requests

* Accidental files added, now removed

* Class CommonItem renamed to NavigationItem

* save method being called in test_navigation_tags

* Remove Title from PanelBlock (#90)

* Title removed from warn and announcement panels. PaneBlock split up.

* Code formatted

* Warn, info and announcement separated into individual blocks

* Code formatted

* Type hints added

* get_context removed for InformationPanelBlock

* Panel models refactored to inherit from a BasePanelBlock class. Individual templates created for the different panels.

* icons added to panel and template code formatted

* Bump peter-evans/create-pull-request in the gh-version-updates group (#60)

Bumps the gh-version-updates group with 1 update: [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request).


Updates `peter-evans/create-pull-request` from 6 to 7
- [Release notes](https://github.com/peter-evans/create-pull-request/releases)
- [Commits](peter-evans/create-pull-request@v6...v7)

---
updated-dependencies:
- dependency-name: peter-evans/create-pull-request
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: gh-version-updates
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Mebin Abraham <35296336+MebinAbraham@users.noreply.github.com>

* Upgrade to Wagtail 6.4 (#97)

* Bump Wagtail to 6.4
* Remove search backend workaround
* Bump ruff version and lint
* Enqueue tasks on commit in tests
* Use shorthands for panels
   Ref: https://docs.wagtail.org/en/latest/releases/6.4.html#shorthand-for-fieldpanel-and-inlinepanel
* Bump the default DATA_UPLOAD_MAX_NUMBER_FIELDS to 10k
  Ref: https://docs.wagtail.org/en/latest/releases/6.4.html#data-upload-max-number-fields-update

* Allow rendering a bundle without a "created by" user (#98)

* Fix broken dev Redis default config (#101)

* Topic page enhancements (#96)

* Add featured series, explore more, related articles/methodologies
* Exclude local settings from mypy
* Add toc, featured article and processed articles/methodologies
* Translate missed string in template
* Add component for featured article
* Add a label/release date properties to relevant page models
* Update the topic template
* Wire in the Explore More block
* Handle highlighted articles/methodologies
* Add tests
* Tweak the featured and highlight choosers to relevant pages only
* Tweak so related articles display the full title (with series prefix)
* Add basic functional tests

* Methodology page UI tests (#102)

* Add fix from PR #101

* Added the test

* Ignore pylint errors

* Make them pass

* Fix an issue with tests failing in headless and passing in headed mode

* Rewording to match steps pulled from main

* Formatting + rewording

* Revert a change to make tests pass

* A bunch of improvements

* Remove no longer needed file for theme page set up

* Remove duplicated step definition

* Add missing assertion

* Topic page test fix

* Added missing checks + where I got with testing preview (failing so commented out)

* Formatting - all green locally

* Test

* Attempt to fix headless failures

* Bump the wait time a bit

* Refactor the fix above into it's own step

* Uncommented the preview test

* Added a test for the draft functionality of the page

* Refactoring

* Renamed a test function

* Experiment - removed the delay in preview test

* ^ the same for the mandatory fields scenario 🤔

* Add back the delay for mandatory fields scenario + make step wording more precise

* Experiment - move the delay to the 'then' step of the mandatory fields scenario

* ^ revert the above

* Experiment - replace delay with wait_for_load_state

* ^ the same but after clicking the button

* Revert to using delay

* Test improvements

---------

Co-authored-by: Dan Braghiș <dan.braghis@torchbox.com>

* [UR tweaks] Show the rich text toolbar and the minimap by default (#106)

Loom recording: https://www.loom.com/share/52fb408fa2d24b3290a2977b3ff919f2

* Tidy up the Bundle viewset and chooser search (#107)

* Add Taxonomy Topic Tagging (#104)

* Add taxonomy app and topic tree node model

* Update sync command

* edit_handler added in and taxonomy tab tested in information page

* Topic model and links

* Fix the exclusive topic relationships

* Fix topic choosers

* Add generic taxonomy to all required pages, fix some bits

* Add topic deduplication

* Code tidy up and doc strings added

* Add sync command tests

* Testing taxonomy models

* Add TopicFactory and update other factories which now depend on it

* Remove taxonomy from release calendar page, improve factory

* Move sync topics command to taxonomy app

* Add start functional tests

* Refactor locations, use dummy root level topic

* Fix migration, use multi chooser

* Update functional tests

* get_queryset added to TopicChooserViewSet, taxonomy models and viewsets tests added.

* Add make target for loading topics fixture, small refactors and moves

* Combine migrations

* Pushing latest tests for taxonomy

* Debugging tests

* Move root topic creation to a migration, fix some bugs

* Address review comments

* Fix title with depth mistake and add more type hinting

* Fix title with depth mistake

* Make mypy happy, fix some issues

* Fix linting/mypy conflict

* Fix mistake, remove unecessary taxonomy panels fields

* Address review comments

* Address review comments, remove unecessary function

* Tests for forms, mixins, models and viewsets: Cleaned up, code formatted and complete.

* Fix move function issue

* Remove complete FIXME

* Update migrations

* Remove accidental unrelated migration

* Re-add article model migration

* Ignoring migration: 0002_articleseriespage_listing_image_and_more

* Add parents topics column to chooser

* Revert experimental chooser enhancements

* Bring typing hinting in line with our standards

* save_new_topic usage updated to make work as an instance method of Topic instead of getting it to work as a classmethod (save_new_topic is not a classmethod)

* sync_topics, _update_topic function refactored

* calling management commands using call_command and self.assertEqual being used replacing assert.

* All sync_topics.Command().handle() replaced with call_command("sync_topics")

---------

Co-authored-by: sanjeevz3009 <sanjeevz1717@gmail.com>

* Taxonomy chooser enhancements (#109)

* Footer menu (#111)

* Add footer menu snippet

* Working frontend

* Navigation templates tags added

* base template updated to use navigation template tags functionality, navigation_template_tags added and navigation_tags refactored.

* Code formatted

* navigation tags tests improved

* Type hints issues fixed

* Main Menu (#41)

* Front-end hacked together to complete the back-end

* Navigation app added, models created for navigation settings

* Navigation bar on the front-end test

* Front-end code reverted due to the front-end main menu being done separately

* New line

* Code formatted

* Type hinted and code formatted

* Code refactored, abstract link class created, validation messages added, section restricted to 3, URL label added, icon for navigation settings added and restricting it to so only 1 main menu can be created

* Migration file

* Main menu modelling complete, restricting user to be able to only create one main menu instance in the wagtail admin. Migration file added.

* LinkBlock extracted out of core.blocks.related and moved to core.blocks.base to be reusable across the project. LinkBlock from core.blocks.base is being used instead of the abstract class originally defined in models.py.

* Code formatted, zombie code removed, unused imports removed and MainMenuViewSet added to restrict creating more than one main menu instance

* Front-end integrated

* Type hints added

* Nav template issues fixed

* gettext_lazy added

* Preview added

* Use the title provided by the user over the default title from the page

* help text update

* Type hints added

* Migration file regenerated

* Tests added

* TODO removed and translatable added

* Description help text updated

* Tests setup

* Example StreamField value setting in test_highlights_streamfield_limit

* Debug

* Errors being raised when adding more than 3 highlights

* Committing working factories to save

* Clean method for ColumnBlock added and tests updated

* Updated tests

* test_section_streamfield_limit test working

* Added more tests, factories updated

* Removed tests

* Max num code removed

* Code formatted

* Utilising pageurl to point to get internal wagtail pages

* Code refactored

* Reverting format for md files

* Reverting md files formatting

* Lint errors corrected

* Unused import removed and base template updated

* Base template update

* Type checking added back in

* Template code updated to make sure to only display live wagtail pages

* Main menu live preview fixed

* MegaLinter errors fixed

* Using a preview template for live previews

* Mark NavigationSettings as allowed for write in ExternalEnvRouter

* Use our own BaseSiteSetting which works with the ExternalEnvRouter

* RevisionMixin implementation and mypy fix

* Blocks refactor

* Code linted

* Tests for main menu viewset added

* Type ignore added

* Duplicate page and external URL validation for sections and topic links within columns complete.

* Duplicate page and URL for columns complete.

* test_forms in place

* Update test_clean_highlights_no_duplicate test

* Tests complete for forms.py

* test_forms.py code clean up

* Example usage zombie code removed

* Code formatted and refactored

* Code refactored, type hinted, tests refactored.

* gettext translation added

* LinkBlock Factory moved

* De-nest the blocks tests folder

* Tests folder removed containing redundant factories, NavigationExtension doc strings updated and unused code in navigation_tags file removed.

* Unused code removed.

* _extract_highlight_item and _extract_url_item combined into one reusable function

* Type hinting fixed

* Using get_dummy_quest from wagtail for mocking requests

* Accidental files added, now removed

* Format fixes.

* Update helptext and removed unused code from base.html

* Working template tags

* Update to allow only one footer

* Update template tags

* Preview fix

* Working forms.py and format edits

* forms.py fixes

* Refactor forms.py

* Migrations update

* Updated typehints and styling for forms.py, updated poetry and removed unused code.

* Working tests

* Typo fix

* Test fixes, add navigation tags tests

* Tidied up: blocks.py and models.py. Type hints updated for navigation_tags.py for footer_menu_columns and forms.py. wagtail_hooks.py updated to rename ModelPermissionPolicy class and code tidied up.

* factories updated, test_viewsets cleaned up and base.py typo fixed

* LinksColumnFactory updated and  footer_menu_template_tags tests fixed.

* Add working test_forms

* Add external urls test across columns

* Add test cases

* Add tests for pages

* Fixes suggested by reviews

* Fixes - removed unecessary import.

* Refactored forms tests for navigation app, split the files into two, footer and main menu forms tests. Footer menu forms tests refactored with helper functions.

---------

Co-authored-by: sanjeevz3009 <sanjeevz1717@gmail.com>
Co-authored-by: Sanjeev Srithevan <41544303+sanjeevz3009@users.noreply.github.com>

* Add an ONS table block (#108)

* Add a User chooser (#113)

* Improve the user chooser queries, reducing N+1 (#114)

* Glossary terms snippet (#110)

* update design system version from 72.2.0 to 72.4.0 (#117)

* Put exclusive taxonomy enforcement behind a flag (#119)

* Add basic preview teams model (#120)

Co-authored-by: Mebin Abraham <mebin95+work@gmail.com>

* Update wagtail-tinytableblock to show the copy/paste buttons (#121)

* Update wagtail-tinytableblock to show the copy/paste buttons
* Bump tinytableblock to 0.2.3 to gain native context menus

* Add correction and notice block (#122)

* Add updates functionality from alpha

* Refactor additional tabs, add existance check

* Refactor tabs list to use tuples

* Fix handling of no instance in PageWithUpdatesAdminForm

* Update comment

* Add tests for correction and notice blocks

* Update templates

* Add validation functionality to correction block

* Split updates into corrections and notices

* Update functional tests

* Fix typo in JS file

* Format code

* Address linting issues

* Normalise tabs

* Remove use_json_field=True

* Rename and move files, handle title

* Remove unnecessary whitespace

* Fix functoinal tests following heading change

* Add various waits to functional tests to fix flakiness

* Add additional waits

* Address PR comments

* Add extra context in comment

* Fix assignment of revisions to corrections (#131)

Co-authored-by: Maciej Baron <MaciekBaron@users.noreply.github.com>

* Add Article Series Page tests (#133)

Co-authored-by: Maciej Baron <MaciekBaron@users.noreply.github.com>

* Bump wagtail-tinytableblock to 0.2.4 for cell and row property toolbar buttons (#137)

* Sort corrections and check date (#134)

* Sort corrections and check date
* Add functional test to test behaviour

---------

Co-authored-by: Maciej Baron <MaciekBaron@users.noreply.github.com>

* Remove gettext_lazy calls from admin panel text (#136)

* Remove gettext_lazy calls from admin panel text

* Add attr-defined ignore

Co-authored-by: Dan Braghiș <31622+zerolab@users.noreply.github.com>

* Remove unnecessary i18n tag

Co-authored-by: Dan Braghiș <31622+zerolab@users.noreply.github.com>

* Ensure topic label is translatable

Co-authored-by: Dan Braghiș <31622+zerolab@users.noreply.github.com>

* Ensure article label is translatable

Co-authored-by: Dan Braghiș <31622+zerolab@users.noreply.github.com>

* Ensure methodology label is translatable

Co-authored-by: Dan Braghiș <31622+zerolab@users.noreply.github.com>

* Add additional changes to translations

* Address mypy's concerns and worries

* Address issues exposed by tests

---------

Co-authored-by: Maciej Baron <MaciekBaron@users.noreply.github.com>
Co-authored-by: Dan Braghiș <31622+zerolab@users.noreply.github.com>

* Replace custom hero markup with DS hero component for Article & Methodology pages (CMS-307) (#129)

* add design system hero component to replace custom hero markup

* Add breadcrumbs template tag

* Fix indentation issue

* update hero with html for contact & revision links and update methodology page with grey hero variant as well

* template formatting

* linting

* more lint

* De-nest if statements in navigation_tags

* add in colons to revision metadata

* Update date check in methodology functional test

* Add integration tests for hero section

---------

Co-authored-by: Maciej Baron <maciej.baron@torchbox.com>
Co-authored-by: Maciej Baron <MaciekBaron@users.noreply.github.com>
Co-authored-by: Maciek Baron <1668712+MaciekBaron@users.noreply.github.com>

* Add datasets on release pages (#123)

* RBAC  - Set up Wagtail user groups (#128)

* Bundle and page workflows MVP (#132)

* Wire in teams to bundles
* De-localize bundle code
* Add workflows app and base task models
* Add the review workflow and tasks via migration
* Only allow bundle approval if all related pages are ready to be published
* Drop bundle self-approval restriction
  Now that we require all pages to be ready to be published, this is no longer a requirement
* Add the workflow state to the page chooser on bundles
* Move workflow test utils to the workflows app
* Relabel bundle statuses
* Move add_to_bundle view to own module under bundles.views
* Add a base preview view
* Tidy up Bundle.get_bundled_pages usage with specific querysets
* Add permission checks for the bundle preview
* Log preview and preview attempts
* Tidy up bundles index view and dashboard panel for previewers
* Prevent approval after the scheduled publication date
* Ensure 'save and approve' only shows when bundle in review and all its pages are ready
* Ensure distinct bundles are shown in index and panels
* Tidy up the dashboard bundle panels styling
  The extra classes are needed for wagtail/wagtail#13006 as well as non-table content in the panel
* Move the bundles menu item before the preview teams one
* Make the bundle page preview contain /page/ for clarity
  and in preparation for the dataset previews
* Improve validation
  - always validates that the release date is in the future
  - prevents approving if there no pages. to expand to account for datasets
* Tidy up bundle permissions module
  - avoid hardcoded permission names
  - renamed the permission functions to be more explicit
* Only show the active bundle in the bundle note panel, and link to edit if user can edit
* Remove the logic that sets the page scheduled publication date via bundle
  The management command handles that on release
* Move bundle viewsets to own modules
* Restrict bundle pages chooser to those with unpublished drafts
* Add a bundle page chooser limiting to pages with drafts not in active bundles
* Exclude release calendar pages in active bundles from the bundle release calendar chooser
* Add a bundle help panel on the release calendar page
* Prevent release calendar page cancellation if linked to bundle that is ready to be published
* Add an 'unschedule' button
* Update workflow migration to assign the task groups
* Update functional tests

* Search Integration - Kafka (#115)

* Search app created

* KafkaProducer API version specified

* Fixed kafka improperly validating non-advertised listeners for routable controller addresses

* Logging added for kafka producer

* ReleaseCalendarIndex excluded

* Logging configured at INFO level

* Docstrings updated and _construct_message_for_create_update updated

* publishers.py refactored

* publishers.py refactored, tests for wagtail_hooks added and unused files removed

* base and dev settings config updated

* apps.py, migrations dir, base settings config updated and publishers script updated

* wagtail_hooks updated to use factories

* Code formatted and linting issues fixed

* Redundant NullPublisher removed,  added contract and spec links under BasePublisher, tests for publishers.py added, wagtail_hooks tests updated,

* BasePublisherTests complete

* publishers.py tests complete and code formatted.

* Integration tests added to test for kafka compatibility

* Integration tests refactored.

* Unnecessary comment removed.

* Type hints added

* kafka integration test ignored for now

* Broker service added to the CI and integration tests added back

* dev.py cleaned up

* Env vars naming updated, tests updated to reflect the publishers.py changes, using the naming channel instead of topic in publishers .py, type hints improved, code refactored, linted and formatted

* search_index_content_type property added to relevant page models, get_publisher utilising caching now, _publish_to_service updated to use _publish.

* Code formatted

* models updated to have a static class-level value rather than a dynamic, instance-level property.

Zulu conversion for time format removed and tests updated

* Excluded pages naming improved, and comment added before external search config.

* get_dummy_request import updated and system checks for env vars added for the search app

* Code formatted

* Type hints added

* Type hint issues fixed

* checks.py updated to only fire if the provider is "kafka"

* Django system check added that checks if someone adds a new page type to the list to send to the search index, it has a search_index_content_type attribute.

* KAFKA_API_VERSION updated

* Kafka Broker added to the main docker-compose.yml file and KAFKA_API_VERSION env var updated to fix linting issues

* Page factories being stored as instances now

* Refactor topic handling in publishers and add topic_ids property in mixins

* logs cleaned up

* Add signal handlers for page publish/unpublish/delete events and removed the use of Wagtail hooks

* Checks for Kafka settings updated and implemented unit tests for validation

* RuntimeWarning fixed

* Refactor signal receiver for page deletion to specify sender as Page

* DB Route failing tests fixed

* Refactor test_publishers setUpTestData method and signals.py renamed to signal_handlers.py

* connect_page_delete_signal removed, receivers updated, test_signal_handlers updated.

* Publish and unpublish receivers and tests updated.

* Refactor publisher tests to use a decorator to mock the publisher method instead of using a context manager

* Update Kafka configuration to use Bitnami Kafka image and KRaft mode; refactor settings checks and tests for improved error handling.

* Automatic topic creation added to the container config

* docker-compose-dev.yml file formatted

* Enhance BasePublisherTests to include topic handling for InformationPage and update date change assertions

* Refactor test setup to use get_dummy_request for improved readability

* Remove unused root_topic references from search and taxonomy tests for cleaner code

* Add Windows binary wheel for psycopg2_binary to poetry.lock

* Refactor publisher channels to use properties and enhance signal handling for unpublished pages

* Remove unused import of Optional from publishers.py for cleaner code

* Enhance release metadata handling by simplifying release_date logic and adding provisional_date support

* Refactor release date handling in BasePublisher and add tests for provisional date logic

* Optimise topic_ids property to use specific_deferred for improved performance

* Allow assigning users to teams if team management is enabled (#141)

* Footer Menu UI Tests (#130)

* Add Footer menu UI tests features, scenarios and steps

* Fix steps

* Update UI tests

* Update UI tests

* Update UI test

* Add comments and  max links scenario

* Update UI tests

* Working UI test

* Update scenarios

* Refactor footer menu feature scenarios for clarity and consistency

* Update UI test to match up to refactoring

* Refactored feature file and footer_menu step definitions

* Enhance footer menu feature tests with deletion confirmation and final verification scenarios, feature file and step definitions made more reusable, maintainable and refactored.

* Code cleanup

* Address review comments

* Address review comments

* retrigger checks

* Refactored per review comments

* Updated wording to be clearer

---------

Co-authored-by: sanjeevz3009 <sanjeevz1717@gmail.com>
Co-authored-by: Sanjeev Srithevan <41544303+sanjeevz3009@users.noreply.github.com>

* Set KafkaPublisher retries to 5 and update tests accordingly (#145)

* Previous Releases Pagination  (#100)

* build previous_releases page in playwrght tests

* add pagination_block.html

* add pagination

* add ons pagination

* complete amendmentss

* correctly add ds ons_pagination

* correct parameter and add test

* correct breadcrumbs and pagination negative tests

* correct unit tests

* correct lint issues

* lint corrections part 2

* pr resolutions

* fix lint

* add breadcrumb test for previous releases

* add breadcrumb test for previous releases

* fix lint format

* modify spelling mistake

* remove unused parameters

* more lint changes

* resolve comments

* html lint

* comment resolutions

* comment resolutions

* comment resolutions

* comment resolutions

* comment resolutions

* comment resolutions

* Resolve comment space

* Test refactor resolution

* amend spelling mistake

* Audit logging improvements (#135)

* Format logs as JSON

* Use `django-xff` to identify client IP

* Add logs for auth events

* Add more context to log messages

* Convert existing logs to JSON-style

* Convert gunicorn logs to JSON

* Account for user being missing when logged out

Django's API allows this, but we don't care

* Move comment so it's closer to relevant code

* Remove IP logging

* Actually remove django-xff

* Improve log assertions

* Remove duplicate setting in tests

* Table improvements, part 3 (#139)

* Bump wagtail-tinytableblock to 0.3.2 to handle linebreaks
* Handle alignment and width in tables
* Mark th value as safe, similar to td.value
   We preprocess them with nh3. This is needed to handle line breaks (<br>)

* Allow previewing a bundle when it is marked as 'ready to publish' (#146)

* Corrections & Notices FE (#388 & #389) (#144)

* add markup & styling for corrections & notices, in line with designs

* refine JS for details panel and fix formatting

* linting

* add formatting comments to fix linting errors on DS component includes

* replace svg with styled markup for consistency with DS component

* add new line to streamfield files

* Fix functional tests

* Add additional functional tests corrections

---------

Co-authored-by: Maciej Baron <MaciekBaron@users.noreply.github.com>
Co-authored-by: Maciek Baron <1668712+MaciekBaron@users.noreply.github.com>

* Corrections and notices functional test enhancements (#149)

* update design system to latest version (72.4.0 - 72.6.0) (#151)

* Bump tinytableblock and Django versions (#150)

* Bump tinytableblock and Django versions
* Relabel table caption to sub-heading

* upgrade design system from 72.6.0 to 72.7.0 (#155)

* RBAC negative tests (#143)

* Remove the sitemap (#156)

* Add Welsh locale support (#140)

* Add Welsh locale support

* Address mypy concerns

* Add migrations to ignore

* Add initial messages and page tests

* Add Makefile entries, Linux dependency

* Add Linux dependency to functional tests

* Fix typo in ci.yml

* Rework unique constraint for glossary items, fix some func tests

* Reformat README

* Resolve migration conflicts

* Add unstyled language switcher

* Format migration

* Remove draft functionality from glossary terms

* Fix problem when no additional locale exists

* Add first bunch of functional tests

* Add remaining functional tests

* Add comment about variables

* Account for English label in tests

* Improve functional tests

* Anticipate more languages in selector

* Rename translations_urls to get_translation_urls

* Address various comments

* Update cms/jinja2/templates/base.html

Co-authored-by: Dan Braghiș <31622+zerolab@users.noreply.github.com>

* Update cms/jinja2/templates/base_page.html

Co-authored-by: Dan Braghiș <31622+zerolab@users.noreply.github.com>

* Make contact details translatable

* Bootstrap translatable model

* Squash migrations

* Address comments and fix tests

* Remove tests which are not applicable anymore

* Remove unused import

* Ignore not null constraint

* Shortening name of migration

* Add link to translation in warning message

* Add locale creation to migrations, improve them

* Update error message in test

* Rename migration file

* Consider locales in information page tests

* Squash migrations again

* Update cms/core/models/snippets.py

Co-authored-by: Dan Braghiș <31622+zerolab@users.noreply.github.com>

* Add abstractions to tags, tests

* Add missing tests

* Change a filter() to get()

* Update translations and translatable strings

* Ignore node_modules in makemessages

* Update Makefile

Co-authored-by: Dan Braghiș <31622+zerolab@users.noreply.github.com>

* Add defer_streamfields() in util_tags.py

Co-authored-by: Dan Braghiș <31622+zerolab@users.noreply.github.com>

* Move localised_version_not_available

* Remove unnecessary settings

* Return meta config

---------

Co-authored-by: Maciej Baron <MaciekBaron@users.noreply.github.com>
Co-authored-by: Dan Braghiș <31622+zerolab@users.noreply.github.com>

* Improve Broker Service Container Config To Enable Search Integration Tests To Run Locally and Within The Web Container. (#160)

* Refactor Kafka integration settings and improve Docker configuration to run the search integration tests locally and within a dockerised environment. Tests. local.py.example contains search integration en var config now.

* Refactor Kafka settings test to streamline error checking for missing configurations

* Update Kafka listener ports in CI configuration

* Refactor Kafka integration tests to use settings for bootstrap servers and update Docker configurations

* Update Kafka server configuration in CI workflow for consistency

* Update Kafka listener configuration to use port 9092 for PLAINTEXT

* Fix KafkaConsumer bootstrap_servers to be a list

* Update KAFKA_SERVER configuration to use port 9092

* Update Kafka configuration in local and test settings; adjust Docker Compose for new listener ports

* Add missing import statement for os in test settings

* Update KAFKA_SERVER configuration to use port 9094 in local settings

* Update Bundle status enum values for consistency (#157)

* Add Custom Date Formatting Filter For Jinja Templates (#138)

Co-authored-by: nehakerung <nehakerung@gmail.com>

* Update remaining page hero banners to use DS component (#154)

* update stat article and topic hero banner with DS components

* replace release calendar page heros with DS component

* update theme page with pale blue hero variant to match topic page for now

* tidy up hero variables

* update translatable strings and move them outside of dict structures

* Update usage of the date filter to ons_date

* Use correct date format and space stripping options on new vars

* fixup! Use correct date format and space stripping options on new vars

* remove old meta data from stat article page hero which snuck in after merge with main

---------

Co-authored-by: Dan Braghiș <dan.braghis@torchbox.com>

* Add locale column to additional choosers (#167)

* Add locale column to additional choosers

* Add tests

* Add additional tests

* Check for Welsh title

* Fix tests

---------

Co-authored-by: Maciej Baron <MaciekBaron@users.noreply.github.com>
Co-authored-by: Dan Braghiș <31622+zerolab@users.noreply.github.com>

* Add locale label to admin page tree view (#170)

* Add locale label to admin page tree view

* Use parent_page.is_root

---------

Co-authored-by: Maciej Baron <MaciekBaron@users.noreply.github.com>

* Search Integration Resources API Endpoint (#159)

* Add search functionality with pagination and serializers for Wagtail resources

* Refactor ReleaseCalendarPage model and clean up ResourceListView code

* Add release_date and provisional_date fields to ResourceSerializer; update URL patterns

* Refactor pagination implementation to use CustomPageNumberPagination; update ResourceListView to exclude non-indexable pages based on SEARCH_INDEX_EXCLUDED_PAGE_TYPES

* Refactor ReleaseResourceSerializer to use SerializerMethodField for release_date; update ResourceListView comments for clarity. API Endpoint Views tests complete.

* Implement create and update methods in ResourceSerializer to enforce read-only behaviour and satisfy pylint

* Update content hash in poetry.lock after dependency changes

* Implement create and update methods in ReleaseResourceSerializer to enforce read-only behaviour

* Refactor topic and release date retrieval methods in serializers for improved readability

* Refactor search resource tests

* Enhance type hinting in serializers and views for improved code clarity

* Refactor search tests and views for improved structure and clarity; add URL configuration for external environment

* Refactor search resource handling and serializers

- Removed the _construct_message_for_create_update method from BasePublisher and replaced it with a call to build_resource_dict.
- Introduced build_resource_dict utility function to centralise resource dictionary construction for both standard and release pages.
- Updated ResourceSerializer to utilise build_resource_dict for representation.
- Created a new helper module (helpers.py) for shared constants and assertion mixins used in tests.
- Consolidated and simplified tests for publishers and resource builders, leveraging the new helper methods for assertions.
- Cleaned up the SearchResourcesViewTests by removing unnecessary assertions and utilising the new assertion methods.
- Updated views to use the simplified ResourceSerializer directly, removing the conditional logic for release types.

* resource_builders.py file moved out of the utils folder to follow the convention in the codebase. resource_builders.py file renamed to utils.py file. get_model_by_name moved into the utils.py file.

* Refactor search resource tests for improved clarity and consistency; update boolean assertions and enhance utility function documentation

* Implement custom limit offset pagination and update related tests to align with new API standards

* Refactor search tests to utilise ExternalAPITestMixin for external environment simulation and JSON parsing

* Refactor pagination settings and update related tests for consistency with API standards

* Refactor pagination settings to align with new API standards and update related tests for consistency

* Add InformationPageFactory to included pages in search resources tests

* Lint error

* Update pagination test

* Fix comments for clarity in pagination response and update resource endpoint references in tests

* Fix pagination test query parameters for clarity

* Refactor debug toolbar settings to conditionally enable based on DEBUG flag

* Remove Django Debug Toolbar setting from local configuration/ copy pasta fail

* Fix URI generation in build_standard_resource_dict to remove home prefix

* Add language field assertions to resource dict tests and include Welsh locale support

* Refactor URI handling in resource dict and tests to use build_page_uri function

* Add SHOW_TOOLBAR setting for Django Debug Toolbar in local settings and type hints added.

* Log IP addresses, sometimes (#161)

* Headline Figures on a topic page (#152)

* Add basci chooser block limited to series with headline figures

* Move viewsets to own modules

* Propagate the figure id through the chooser

* Improve chooser to include all headline figures per latest article in
series

* Wire the topic headline figure in the template

* Fix headline figure adapter

* Update migrations to reflect new order

* Address linter and mypy issues

* Add ability to show figure title

* Add additional validation to topics page

* Automatically generate figure id

* Add deletion validation

* Check if headline_figures exist

* Prepopulate statistical article pages

* Only show message if the latest article exists

* --amend

* Add frontend based deletion prevention to headline figures

* Add initial integration test

* Fix test

* Expand test to check headline_figures

* Add additional integration tests

* Add functional tests

* Use ONS component for card

* Prevent manipulation of figure ID

* Update max length in migration

* Fix tests and relocate form

* Add help text

* Check for validation error messages

* Add additional tests

* Refactor code

* Fix functional tests, move combined class

* Make Figure ID visible if available

* Prevent deletion of pages

* Refactor code

* Rename figure field

* Fix tests

* Update column order and button label

* Add template test for edit page

* Refactor data injection using a Panel

* Redo Panel as FieldPanel for cleaner output

* Fix comment typo

Co-authored-by: Dan Braghiș <31622+zerolab@users.noreply.github.com>

* Improve tests

* Improve comment to add context

Co-authored-by: Kacper Prywata <113175775+kacperpONS@users.noreply.github.com>

---------

Co-authored-by: Dan Braghiș <dan.braghis@torchbox.com>
Co-authored-by: Maciej Baron <MaciekBaron@users.noreply.github.com>
Co-authored-by: Dan Braghiș <31622+zerolab@users.noreply.github.com>
Co-authored-by: Kacper Prywata <113175775+kacperpONS@users.noreply.github.com>

* Page workflow improvements (#166)

* Add tests for bundle utils
* Prevent approval if the user was the last editor
* Add JS to prevent approval if editing
* Add utils tests
* Add tests for the actions/before edit page hooks
* Handle no revision use case
* Update front-end tooling configuration
* Tidy up workflow JS
* Lint remaining apps JS
* Add functional tests

* Improve the language filter in custom choosers (#179)

* Add temporary locale column in preparation for Wagtail 7.0
* Use the updated LocaleColumn in our custom viewsets
* Drop the locale filter in choosers where we look at relevant children
* Patch the core LocaleFilterMixin to include the 'All' option in preparation for Wagtail 7.0

* Headline figures UX improvements (#178)

* Lift limits from headline figures (and make `max_length` explicit to the `HeadlineFiguresItemBlock` `CharBlocks`)
* Validate that one needs to add at least 2 headline figures on a statistical article
* Add validation that statistical article takes a max of 6 items

* Make release date mandatory on release pages (#158)

* Improve headline figures on topic pages (#181)

* Improve headline figures on topic pages

* Fix orphan tag

* Fix figure key

* Fix tests

* Remove delete buttons instead of hiding

* Add migration

* Update revisions in migration

* Flatten headline_figures in StatisticalArticlePage

* Fix functional tests, rename variables in migration

* Refactor tests

* Remove copy button from headline figures

* Remove UUID from tests

* Remove UUID from more tests

* Change updated value to the one from the article

* Add tests for SeriesWithHeadlineFiguresChooserViewSet

* Refactor as kwargs

---------

Co-authored-by: Maciej Baron <MaciekBaron@users.noreply.github.com>

* upgrade design system to latest version (#185)

* Kubernetes Deployment (#118)

* Extract elasticache credentials provider into its own module

This ensures it can be imported in settings

* ci: This change adds make targets for building, tagging and pushing to ECR

- The defaults are for using AWS dp-ci ECR
- This is just doing production ready builds using the --target=web
- Tagging is done manually (until pipeline) using SemVer
- This script will be replaced by a concourse pipeline

* Improve deployment makefile task names

* Force AWS region for database

* Make SSL redirect configurable

This should be handled by external infrastructure in future.

* Persist connections for longer and check they're healthy before reuse

* Add liveness endpoint which checks DB connection health

* Add redis ping to liveness check

* Allow controlling CONN_MAX_AGE per connection

* Test broken redis connection

* Move container build Makefile out of main Makefile

This removes the dependency on an AWS configuration.

* Simplify liveness probe tests

* Test unexpected database errors

* Update status codes

---------

Co-authored-by: Andy 'Channie' Chan <andy@channie.dev>

* Add retry for restoring snapshot in behave_fixtures (#187)

Co-authored-by: Maciej Baron <MaciekBaron@users.noreply.github.com>

* Add statistical article related data page (#165)

* Add page route and template (WIP)
* Update fields, remove manual date
* Add and serve a related data preview mode
* Use signals to copy previous releases datasets
* Remove unused code
* Fix migration conflict
* Address pre-review comments, add tests
* Respond 404 if there are is no related data
* Add tests for links on article page
* Add functional test
* Remove unecessary newlines
* Fix type hints
* Formatting
* Fix related data link in preview
* Add test for dataset prepopulation, fix unecessary page.specific
* Fix type hinting failures
* Fix dataset path and test
* Attempt to fix tests which use the article page
* Fix missing dataset sorting in test API calls
* Ignore migration add a doc string
* Add migration lost in merge
* Delete old conflicting version of migration
* Update migration ignore

* Add tests for contact details/ glossary choosers and fix search with locale filtering (#182)

* Update card component for headline figures in articles (#186)

* Update card component for headline figures in articles

* Update cms/jinja2/templates/pages/statistical_article_page.html

Co-authored-by: janehughes <8680557+janehughes@users.noreply.github.com>

* Add additional classes to figures column

---------

Co-authored-by: Maciej Baron <MaciekBaron@users.noreply.github.com>
Co-authored-by: janehughes <8680557+janehughes@users.noreply.github.com>

* Enforce taxonomies in topic and theme pages (#171)

* Enforce taxonomies

* Add tests and neutralise names

* Change to assertRaisesRegex to check message

* Fix typo in cms/taxonomy/panels.py

Co-authored-by: Dan Braghiș <31622+zerolab@users.noreply.github.com>

* Check locale id rather than whole locale

Co-authored-by: Dan Braghiș <31622+zerolab@users.noreply.github.com>

---------

Co-authored-by: Maciej Baron <MaciekBaron@users.noreply.github.com>
Co-authored-by: Dan Braghiș <31622+zerolab@users.noreply.github.com>

* Add date format placeholder on date datetime fields (#180)

* Add date and datetime placeholder widgets, add widgets to all date fields.

* Add UI tests

* Add unit tests

* Fix lint errors

* Prevent copying of topic and theme pages (#188)

* Prevent copying of topic and theme pages

* Check settings

* Combine conditions to refactor

* Fix copy paste issue

Co-authored-by: Dan Braghiș <31622+zerolab@users.noreply.github.com>

---------

Co-authored-by: Maciej Baron <MaciekBaron@users.noreply.github.com>
Co-authored-by: Dan Braghiș <31622+zerolab@users.noreply.github.com>

* Update methodology & topic pages - integrate with design system (#162)

* integrate the latest TOC & related links component into methodology & topic pages
* add print button to methodology & stat article pages
* add note to add in related publications & data to topic sidebar
* update comment syntax
* remove lists array from methodology TOC as its not needed with only one list of links
* incorporate datasets links into related links of TOC component
* Fix HTML linting issues
* Add additional tests

---------

Co-authored-by: Maciej Baron <MaciekBaron@users.noreply.github.com>

* Make most page types bundleable (#183)

* Move BundledPageMixin to a new file, add to models

* Fix unit tests

* Fix additional tests

* Update publishing command

* Add ReleaseCalendar validation and tests

* Remove gettext - required discussion

* Limit page types for previewers

* Rename function for clarity

* Address feedback

* Remove live=false as it has no impact on test

* Remove ReleaseCalendar page from test

* Add tests for chooser filter

* Add negative test and refactor code

* Attempt to fix functional tests which only fails remotely

* Attempt again to fix functional tests which only fails remotely

* Add test workaround for functional test

---------

Co-authored-by: Maciej Baron <MaciekBaron@users.noreply.github.com>

* Update poetry dependencies and address mypy errors (#196)

Co-authored-by: Maciej Baron <MaciekBaron@users.noreply.github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Kacper Prywata <113175775+kacperpONS@users.noreply.github.com>
Co-authored-by: Helen Chapman <helen.chapman@torchbox.com>
Co-authored-by: Sanjeev Srithevan <41544303+sanjeevz3009@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Mebin Abraham <35296336+MebinAbraham@users.noreply.github.com>
Co-authored-by: Dan Braghiș <31622+zerolab@users.noreply.github.com>
Co-authored-by: Jake Howard <RealOrangeOne@users.noreply.github.com>
Co-authored-by: Adam <35268982+AdamHawtin@users.noreply.github.com>
Co-authored-by: Dan Braghiș <dan.braghis@torchbox.com>
Co-authored-by: sanjeevz3009 <sanjeevz1717@gmail.com>
Co-authored-by: Neha <148205641+nehakerung@users.noreply.github.com>
Co-authored-by: janehughes <8680557+janehughes@users.noreply.github.com>
Co-authored-by: Mebin Abraham <mebin95+work@gmail.com>
Co-authored-by: Maciek Baron <1668712+MaciekBaron@users.noreply.github.com>
Co-authored-by: Maciej Baron <MaciekBaron@users.noreply.github.com>
Co-authored-by: Maciej Baron <maciej.baron@torchbox.com>
Co-authored-by: Ann Witcher <81749650+AWitcherONS@users.noreply.github.com>
Co-authored-by: Jake Howard <6527489+RealOrangeOne@users.noreply.github.com>
Co-authored-by: nehakerung <nehakerung@gmail.com>
Co-authored-by: Andy 'Channie' Chan <andy@channie.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

front-end All things that improve the front-end output integration: Design System Integrates with https://service-manual.ons.gov.uk/design-system/

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants