Placed the related posts list as a block scoped by path visibility. - #306
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (8)
📝 WalkthroughWalkthroughThe PR replaces per-post related-list injection with a UUID-addressed Related posts block. It updates automated-list configuration, empty-list spacing, deployment migration, documentation, and Behat coverage for blog and service paths. ChangesRelated posts
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant Visitor
participant RelatedPostsBlock
participant AutomatedList
participant Content
Visitor->>RelatedPostsBlock: request blog or service page
RelatedPostsBlock->>AutomatedList: render page-topic list
AutomatedList->>Content: find posts with matching topics
Content-->>AutomatedList: matching rows or empty result
AutomatedList-->>Visitor: render Related posts or clear empty output
Possibly related PRs
Suggested labels: ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 phpcs (3.13.6)web/modules/custom/do_base/do_base.deploy.phpERROR: Referenced sniff "Drupal" does not exist. Run "phpcs --help" for usage information Comment |
This comment has been minimized.
This comment has been minimized.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #306 +/- ##
========================================
Coverage 84.51% 84.51%
========================================
Files 26 26
Lines 562 562
========================================
Hits 475 475
Misses 87 87 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Code coverage (threshold: 80%) Per-class coverage |
Checklist before requesting a review
[#123] Verb in past tense.#123added to descriptionChangedsectionChanged
civictheme_component_blocknamed "Related posts" (fixed UUIDc1c2b47c-4c96-4f9e-9b6e-2b1f5f3d7e10) holding a single Automated list paragraph withfield_c_p_list_topics_from_pageon;config/default/block.block.drevops_related_posts.ymlplaces it in thecontent_bottomregion of thedrevopstheme at weight-1(above the Signup block), gated by onerequest_pathvisibility condition listing/blog/*and/services/*, since visibility conditions are ANDed and aContent typecondition alongside a path condition would match nothing.do_base_deploy_add_related_posts_block(), which creates the block content against the fixed UUID and skips when it already exists, anddo_base_deploy_remove_related_lists(), which detaches and deletes the page-topics Automated lists that used to sit directly on blog posts (24 real posts locally), using its own entity query as the idempotency guard.drevops_preprocess_paragraph__civictheme_automated_list()now also clearsvertical_spacingon an empty result, so a page whose topics nothing else shares collapses to zero height instead of leaving a 48px gap.field_c_p_list_topics_from_pageintogroup_filters(Content tab → Filters) at weight 45, so "Use topics of the current page" renders directly under "Exposed filters" instead of floating outside the tabs.tests/behat/features/paragraph_civictheme_automated_list_related.featuretotests/behat/features/block_related_posts.featureand rewrote it: it no longer attaches a paragraph per node, and adds scenarios for the block reaching/services/*pages and staying off pages outside the visibility list.docs/related-content.mdunder a "One block, placed by path" section.Screenshots
Before / After
Summary by CodeRabbit
New Features
Bug Fixes
Documentation