Twin-Cities-Mutual-Aid / twin-cities-aid-distribution-locations

A webapp to coordinate aid and care in the Twin Cities.
43 stars 32 forks source link

fix link behavior to allow lack of web protocol and ignore end punctuation #210

Closed codarose closed 4 years ago

codarose commented 4 years ago

What

Fix the regex for extractUrl so that it doesn't capture punctuation at the end of urls, and inject http:// into the url string when it is missing so that the tag works.

Why

Prior to this change, something like 'www.google.com,' wouldn't work for two reasons; the trailing comma would have been included in the url, and the lack of an explicit protocol at the beginning rendered the link unusable.

Ensure the following interactions work as expected. Please test using a mobile form factor.

  • [x] Tapping on a marker on the map displays information about the marker in a popup.
  • [x] Tapping the "Show list of locations" button replaces the map view with a list view.
  • [x] Tapping an item in the list replaces the list view with a map view, and navigates the map to the tapped item on the map.
  • [x] Tapping one of the ✅'s in the legend filters items on the map and in the list.
  • [x] Changing the language to spanish changes things on the page.
  • [x] Clicking the Help/Info button opens and closes a menu with information.
  • [x] Clicking the X Close button on the Help/Info screen closes the modal.

Check the app in the following web browsers:

  • [x] Chrome
  • [ ] Firefox
  • [ ] Edge
  • [ ] Safari