-
Notifications
You must be signed in to change notification settings - Fork 112
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
Simplify usage of ItemIntroduction #8480
Conversation
Commit 7cebc54 fixed a bug related to how the ItemIntroduction organism is rendered. This went undiscovered because we didn't have tests for the II. This commit adds a unit test for the II module and also simplifies its invocation across the various page types. Some local URLs to test to verify that this doesn't impact rendering: - http://localhost:8000/about-us/blog/recuperese-y-preparese-financieramente-para-las-tormentas/ - http://localhost:8000/enforcement/actions/pennsylvania-higher-education-assistance-agency-pheaa-dba-american-education-services-or-aes/ - http://localhost:8000/rules-policy/notice-opportunities-comment/commenting-on-notices/ - http://localhost:8000/data-research/research-reports/2012-college-credit-card-agreements/
@@ -38,8 +37,7 @@ | |||
|
|||
<article> | |||
<header> | |||
{% set data = { | |||
'category': page.categories.all(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note explicit removal of this 'category'
parameter here. This wasn't doing anything because the item-introduction.html template wasn't using a value.category
parameter, but was getting categories from the page object.
This bug prevents categories from showing up on blog or newsroom posts, and has been broken since #2450 in 2016. See internal https://github.local/CFGOV/platform/issues/3790 that was opened in 2020 about this and closed in 2022.
Having just revisited that code for this PR, I want to flag this for @sonnakim @csebianlander in case there is interest in re-adding categories to those page types.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm ambivalent about this. We use categories all the time for both page types, but no one seems to have missed their exclusion from the page template, so I think it's fine to remove it at least for now until such time as we revisit the pages more holistically.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What @csebianlander said - makes sense to me, too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Neat!
Commit 7cebc54 fixed a bug related to how the ItemIntroduction organism is rendered. This went undiscovered because we didn't have tests for the II.
This commit adds a unit test for the II module and also simplifies its invocation across the various page types.
How to test this PR
Some local URLs to test to verify that this doesn't impact rendering:
Checklist