Problem/Motivation
We are currently using a convention to dictate meaning as we treat as "logo" the first image available in the images field.
This convention could be hidden from the code and encapsulated in the mock, thus not needing to shift arrays or do different checks in the front-end.
Related conversations about it can be found here #3277464: [PLAN] Where to fetch image from?
Steps to reproduce
See how the front-end makes use of the first image in "field_project_images" for logo, and the others for the carousel, needing comments to actually understand what's going on.
Proposed resolution
Make sure that the project class returns "logo" as a separate property to "field_project_images" and leave the plugins decide where the logo comes from (ie: the mock can still decide to make the logo the first image).
Remaining tasks
- ✅ File an issue about this project
- ☐ Manual Testing
- ☐ Code Review
- ☐ Accessibility Review
- ☐ Automated tests needed/written?
Issue fork project_browser-3301577
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
fjgarlin commentedComment #4
fjgarlin commentedComment #5
fjgarlin commentedNeed to rebase/refactor based on the latest commit to 1.0.x
Comment #6
fjgarlin commentedRebased and adapted to the new expected format. I'm fixing a small regression too as part of this MR too.
Comment #7
fjgarlin commentedComment #8
fjgarlin commentedComment #9
fjgarlin commentedFor better testing, enable both the mock and the random data plugin ("Project Browser Devel" module) as they both have different strategies for the logo.
Everything should still work in the same way, but the svelte code is hopefully clearer and we don't need to make assumptions about where the logo is as that will be dealt with by the plugin.
Comment #10
bnjmnmLeft some feedback on the MR.
This is a great improvement, this will address a confusing part of the Svelte logic.
Comment #11
fjgarlin commentedThanks so much for the review and suggestions @bnjmnm, I really like the simplifications on the svelte files.
I've addressed them all and pushed the changes.
Comment #12
bnjmnmLooks good to go!
Comment #15
tim.plunkettSome minor cleanup before merged, but this was great! Thanks