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

TWE-21 - BE - Secondary Navigation #357

Merged

Conversation

SharmaineLim
Copy link
Collaborator

@SharmaineLim SharmaineLim commented Jan 31, 2025

Link to Ticket

Description of Changes Made

It might be easier to review this on a per-commit view.

This PR does 2 things:

  1. Create a BasePage that other pages can inherit from, instead of having to add the same 5 mixins to each page type.
  2. Add a secondary navigation (which is different from the primary navigation at the top of each page).
Design screenshots of the secondary nav

Potentially outdated design:

image

Alternative nav menu content:

image

image

BasePage

Main commit: 88d3089

  • Create BasePage that is a subclass all the usual mixins all page types share.
  • Update all the page types to be a subclass of BasePage.
  • Move ContactMixin to prevent circular dependencies.

Secondary nav

  • Create the Navigation Set snippet (c5aba2c). This is where admins can configure the navigation menus available. (e.g. one navigation set for Charity, one navigation set for Public Sector, etc.)
  • Create the NavigationSetMixin (49cbc88). Similar to ThemeColourMixin and DivisionMixin, this:
    1. creates a new field "override navigation set" on each page so you can choose which navigation set to show on the page
    2. adds a new property navigation_set to determine which navigation set to show: this will use the override if it's set, but otherwise will use the inherited navigation set
  • Add NavigationSetMixin to the BasePage (9a08aa6), and add DivisionMixin to the BasePage while we're at it– except for the homepage (TWE-20).
  • Temporarily display the nav on the division page so the FE devs can see it. (ccae3b9)
    • I'm inclined to put it in the header.html & <header> tags, but it would need tweaks on the FE side because it's currently styled to be used only by the primary navigation.

How to Test

  1. Create a navigation set.
  2. Add a navigation set to a division page. (Promote tab > Override navigation set)
  3. Check the preview.

Screenshots

Snippet editor

image

Page editor

image

MR Checklist

  • Add a description of your pull request and instructions for the reviewer to verify your work.
  • If your pull request is for a specific ticket, link to it in the description.
  • Stay on point and keep it small so the merge request can be easily reviewed. (ahem)
  • Tests and linting passes.

Unit tests

  • Added
  • Not required

Documentation

Browser testing

  • I have tested in the following browsers and environments (edit the list as required)
    • Latest version of Chrome on mac
    • Latest version of Firefox on mac
    • Latest version of Safari on mac
    • Safari on last two versions of iOS
    • Chrome on last two versions of Android
  • Not required

Data protection

  • Not relevant
  • This adds new sources of PII and documents it and modifies Birdbath processors accordingly

Light and dark mode

  • I have tested the changes in both light and dark mode
  • The change is not relevant to dark and light mode

Accessibility

  • Automated WCAG 2.1 tests pass
  • HTML validation passes
  • Manual WCAG 2.1 tests completed
  • I have tested in a screen reader
  • I have tested in high-contrast mode
  • Any animations removed for prefers-reduced-motion
  • Not required

Sustainability

  • Images are optimised and lazy-loading used where appropriate
  • SVGs have been optimised
  • Perfomance and transfer of data considered
  • If JavaScript is needed alternatives have been considered
  • Not required

Pattern library

  • The pattern library component for this template displays correctly, and does not break parent templates
  • The styleguide is updated if relevant
  • Changes are not relevant the pattern library

@SharmaineLim SharmaineLim changed the base branch from main to integration/2024-evolution January 31, 2025 10:12
@SharmaineLim SharmaineLim marked this pull request as ready for review February 3, 2025 08:25
@SharmaineLim SharmaineLim changed the title Draft: TWE-21 - BE - Secondary Navigation TWE-21 - BE - Secondary Navigation Feb 3, 2025
@engineervix engineervix self-requested a review February 5, 2025 10:29
Copy link
Member

@engineervix engineervix left a comment

Choose a reason for hiding this comment

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

Thanks @SharmaineLim this is looking great 👍

Left a few suggestions

Copy link
Member

@engineervix engineervix left a comment

Choose a reason for hiding this comment

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

Thanks @SharmaineLim
Happy for this to move forward once the RevisionMixin recommendation is addressed.

@SharmaineLim SharmaineLim merged commit ee5b592 into integration/2024-evolution Feb 10, 2025
4 checks passed
@SharmaineLim SharmaineLim deleted the feature/twe-21-secondary-nav-be branch February 10, 2025 06:36
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