Terrastories / terrastories

Terrastories is a geostorytelling application for mapping, managing and sharing place-based stories.
https://terrastories.app
MIT License
319 stars 157 forks source link

[Bug][Rails] Null image tag displaying on popup when story card is activated #671

Closed rudokemper closed 3 years ago

rudokemper commented 3 years ago

Describe the bug The popups on the map are set up to show an image, if there is one set for that place (via the photo_url field); if the value is null then it will not (see this code in Popup.jsx here).

This works when you press on a marker point on the map:

image

However, when you press on a story card in the sidebar -- which causes the map to navigate to the related Place and open up the popup -- if there is no photo, it still inserts an empty <img> tag.

image

To Reproduce Steps to reproduce the behavior:

  1. Open the Terrastories map view
  2. Press on a marker for a Place that does not have a photo
  3. You will not see an <img> tag
  4. Now, press on a Story that is linked to that Place
  5. You will see the empty <img> tag in the Popup

Expected behavior If there is no image in the Place photo_url field, it should not insert an <img> tag in the popup when you press a story card, much like it doesn't when you press a marker and open a popup that way.

carlosfrodrigues commented 3 years ago

Hi, I can take this issue! Can you assign this for me?

rudokemper commented 3 years ago

Welcome @carlosfrodrigues ! I assigned you :)