greenpeace / planet4

Built on top of Wordpress tech, Greenpeace Planet 4 powers digital platforms to engage with millions and win campaigns around the world.
https://planet4.greenpeace.org
Creative Commons Attribution Share Alike 4.0 International
64 stars 26 forks source link

PLANET-6405 PDF link/button icons not showing in later shown search results #166

Closed planet-4 closed 1 year ago

planet-4 commented 2 years ago

In the search results you can get some PDF documents which they should have the PDF link and button icons. The first search results do have them as expected, but the ones that are hidden at first and shown only when scrolling or clicking on the "Show more results" button don't (see screenshot).

Page example

Screenshots Screenshot

Reporter: mleray
Sections: Search

Potentially affected repositories: planet4-master-theme

JIRA Ticket: https://jira.greenpeace.org/browse/PLANET-6405

yehee commented 2 years ago

@planet-4 I'd like to take on this issue, but I couldn't seem to find any posts with documents attached. Screen Shot 2021-10-01 at 9 42 09 AM

This is the link I am looking at currently: https://www.greenpeace.org/international/?s=&orderby=_score

I might be looking at the wrong place, could you please have a look? Thank you!

GP-Dan-Tovbein commented 2 years ago

Hi @yehee I'll take a look and keep you posted

comzeradd commented 2 years ago

The search query linked in the description seems to work. The first results have the icon, but when you load more the icon is missing.

https://www-dev.greenpeace.org/international/?s=ocean&orderby=_score&f%5Bctype%5D%5BDocument%5D=1

yehee commented 2 years ago

@comzeradd Thanks a lot for providing me with the link! It seems like the posts have not been properly processed when more results are fetched. Specifically, this is where the pdf-link is added to the class names. This is done prior to calling setupSearch here in the main app. I'm thinking if we could process the response prior to appending it in here, we should be able to see the PDF icon.

Let me know what you think and how I could test it locally to make sure that the proposed solution works as expected. Thank you!

comzeradd commented 2 years ago

Thanks @yehee, that sounds feasible and it would probably fix the issue.

If you want to test it locally you can just use our docker-compose setup. See the documentation for more details on that.

comzeradd commented 2 years ago

We are planning to remove pdf icons from the title links, so this ticket only refers to buttons.

artze commented 2 years ago

@comzeradd @yehee

if this issue isn't currently being worked on, I can take this up. Let me know!

yehee commented 2 years ago

@artze Please go ahead as I do not have enough bandwidth right now to work on the issue. Thanks for the help :)

mleray commented 1 year ago

Fixed by https://github.com/greenpeace/planet4-master-theme/pull/1791