Repository navigation
Show every media facet the API sends, not a hard-coded five - #48
Merged
Merged
Conversation
Staff added Word and Excel as media facets on prod, and neither appeared.
The tool page's key facts and the hub table's media chips each filtered the
tool's facet slugs through their own list of pdf, image, video, audio and
text, so any value added in the admin was dropped.
- Key facts (Media, Deployment, Method) now read the tool's facets from the
detail response, by dimension and in the taxonomy's order, and print their
labels ("PDF, Word") rather than slugs.
- The hub's media chips take their labels and order from the facets
endpoint, which the hub already prefetches for the filter bar.
method-icons.tsx still maps method slugs to icons on purpose; a new method
shows everywhere except as an icon until one is drawn.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Why
Word and Excel were added as media facets on prod and appeared nowhere. The tool page's key facts and the hub table's media chips each filtered a tool's facet slugs through their own hard-coded list (
pdf,image,video,audio,text), so any value added in the admin was silently dropped.What
tool.facetsfrom the detail response by dimension, in the taxonomy's order, and print labels (PDF, Word) instead of slugs (pdf, word).useListFacets(), which the hub page already prefetches for the filter bar, so no extra request.method-icons.tsxstill maps method slugs to icons on purpose: a new method shows everywhere except as an icon until one is drawn.Tests
tool-profile.test.tsx: a media facet outside the old list (word) shows in key facts by its label.tool-table.test.tsx: a medium added to the taxonomy shows as a chip, in taxonomy order.