Merged
Conversation
Both are multivalued, and we needed a new one for resource class
35a2eb7 to
73ef317
Compare
|
Demo app download link: https://github.com/geoblacklight/geoblacklight/actions/runs/10886871149/artifacts/1938284304
|
jcoyne
reviewed
Sep 16, 2024
|
|
||
| # If the item has a resource type of "X data" where "X" is an existing icon, use that icon | ||
| # Otherwise just use the resource class icon | ||
| def get_resource_icon |
Collaborator
There was a problem hiding this comment.
get_ as a prefix on an accessor method is not typical in Ruby. https://github.com/rubocop/ruby-style-guide#accessormutator-method-names Would resource_icon work?
Member
Author
There was a problem hiding this comment.
sure – I just did that because the other method was named get_icon. I'll change them both
Collaborator
There was a problem hiding this comment.
To be clear, the other method was not an accessor (it takes a parameter), so doesn't really fall under the same convention, but I still like to avoid it.
73ef317 to
e0e91ad
Compare
jcoyne
approved these changes
Sep 16, 2024
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.
This slightly refactors the logic in the header icons component that picks a more specific icon to display based on an item's resource type.
For cases where an item had multiple resource types, but one of them was one that mapped to an icon (e.g. "Raster data" and "Nautical charts"), we were sometimes falling back to the resource class ("Datasets"). This change has us use "Raster data" since we know we have a more specific icon for it in that situation.
For more info, see sul-dlss/earthworks#1398.