Fix: Item introduction categories don't link #7360
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Item introduction categories originally linked back to a filtered version of their parent filter, when the item introduction configuration option "Show category" is checked.
This was broken by this commit back in 2018 (by yours truly).
We use "Show category" sparingly on item introductions. An example production page with this option checked is this one.
Note that currently the category renders as a plain text "Record" that doesn't link anywhere. With this commit, the category renders as a bold link that links back to the parent filterable list.
Notes and todos
It doesn't strike me as obvious that users would know they could click on the category, even if this updated version. I note that the CFPB Design System page on item introductions shows that the category should render with some kind of icon:
I believe the icons come from this hardcoded list; in this case the page category of "Record" isn't in the list so no icon appears. Would it make sense to show some kind of fallback icon in that case? Ping @jenn-franklin. The heading with a fallback
information-round
matches what is in the DS, and looks like this:Checklist