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

DIGITAL-47 guide nav templates #82

Merged
merged 23 commits into from
Jan 1, 2025

Conversation

omerida
Copy link
Contributor

@omerida omerida commented Dec 18, 2024

Jira ticket

DIGITAL-42

and

DIGITAL-47

Purpose

Adds content type for guide navigation collection. Adds optional title field for guide nodes to use in navigation collection. Adds paragraph fields for guide nav links and subnav.

New content type: guide nav. It can hold one or more links. Links can optionally have a subnav. Has Checkbox bool fields to match config fields in hugo frontmatter. Adds a reference field so a guide can point to a parent guide to link to above the guide title.

Adds a group of guide nav related fields to the guide content type.

  • A reference to the guidenav the page should use
  • An optional title to use in the guide nav instead of the node's title.

Adds a "guide nav admin" role that can add/edit/delete guidenav nodes.

Adds template and preprocess function to help build:

  • menubar of links to use on guide page
  • next/prev links to display, if enabled
  • display reading time, if enabled
  • sidenav link to display, if enabled

Includes the following PRs that must be merged first

Deployment and testing

Local Setup

lando si will re-create the site with a "Test guide nav" node that links to existing guide pages. There's some bug/race condition that doesn't set all the references however. You'll need to manually:

  1. Set "web analytics" guide page as the start page for the "test guide nav" node
  2. Update each guide paeg and set the "Guide Navigation" ref field to point to "test guide nav"

QA/Testing instructions

  1. menu bar displays, with current link highlighted. "Start page" displays as the "Overview" link
  2. Toggling the "Show prev/next" checkbox controls display of those links. Prev/next links shown are correct.
  3. Toggling the read time toggle controls the display of the "Estimated Reading Time" div.
  4. Toggling the "Show in-page nav" shows the sidenav with expected links
  5. Setting a "Parent Guide" ref links the kicker in the header to the selected node.
  6. The start page ref is used for the guide header above the guide nav. Same start page displays on all the pages that point back to "Test Guide Nav"

Checklist for the Developer

  • A link to the JIRA ticket has been included above.
  • No merge conflicts exist with the target branch.
  • Automated tests have passed on this PR.
  • A reviewer has been designated.
  • Deployment and testing steps have been documented above, if applicable.

Checklist for the Peer Reviewers

  • The file changes are relevant to the task objective.
  • Code is readable and includes appropriate commenting.
  • Code standards and best practices are followed.
  • QA/Test steps were successfully completed, if applicable.
  • Applicable logs are free of errors.

@omerida omerida requested a review from mattsqd December 18, 2024 21:49
@omerida omerida force-pushed the feature/DIGITAL-47-guide-nav-templates branch 2 times, most recently from 551a8b4 to 7bdf0a8 Compare December 18, 2024 22:00
@omerida omerida changed the title Feature/digital 47 guide nav templates DIGITAL-47 guide nav templates Dec 20, 2024
@omerida omerida mentioned this pull request Dec 20, 2024
10 tasks
Adds content type for guide navigation collection.
Adds optional title field for guide nodes to use in navigation collection.
Adds paragraph fields for guide nav links and sub-navigation.
* Render the desktop navigation for guides.
* Render the mobile navigation for guides.
* Show summary and title below nav
* Show prev/next links if enabled.
* Show summary box if enabled
* Show reading time if enabled
* Display overview page elements in header.
* Link to parent guide in header if set.
* Show sidebar navigation if enabled.
@omerida omerida force-pushed the feature/DIGITAL-47-guide-nav-templates branch from 7bdf0a8 to e74572e Compare December 20, 2024 20:46
mattsqd
mattsqd previously approved these changes Dec 30, 2024
mattsqd and others added 3 commits December 30, 2024 16:25
…-guide-nav-templates

# Conflicts:
#	config/sync/core.entity_form_display.node.guides.default.yml
#	config/sync/core.entity_view_display.node.guides.default.yml
#	config/sync/core.entity_view_display.node.guides.teaser.yml
#	web/themes/custom/digital_gov/templates/node/node--guides.html.twig
# Conflicts:
#	config/sync/core.entity_form_display.node.guides.default.yml
#	config/sync/core.entity_view_display.node.guides.default.yml
#	config/sync/core.entity_view_display.node.guides.teaser.yml
#	web/themes/custom/digital_gov/templates/node/node--guides.html.twig
* Fix WSOD when no parent guide is set.
@omerida
Copy link
Contributor Author

omerida commented Dec 31, 2024

@mattsqd I fixed merge conflicts.

@omerida omerida requested a review from mattsqd December 31, 2024 15:52
omerida and others added 5 commits December 31, 2024 11:54
# Conflicts:
#	web/modules/custom/default_content_config/content/node/91b1798f-4dec-49d6-bfee-38ed0a4f5e49.yml
#	web/modules/custom/default_content_config/content/node/c4520a54-cd38-4be0-9158-24a61a79599e.yml
…SA/digital-gov-drupal into feature/DIGITAL-47-guide-nav-templates

# Conflicts:
#	config/sync/core.entity_form_display.node.guides.default.yml
#	config/sync/core.entity_view_display.node.guides.default.yml
#	config/sync/core.entity_view_display.node.guides.teaser.yml
@mattsqd mattsqd merged commit 8c52fa9 into develop Jan 1, 2025
2 checks passed
@mattsqd mattsqd deleted the feature/DIGITAL-47-guide-nav-templates branch January 1, 2025 17:27
@omerida omerida mentioned this pull request Jan 2, 2025
10 tasks
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