I stumbled across some spec code which was hiding an unexpected error. So I
fixed it properly. This code is to be replaced soon anyway and this is a tiny
step in that direction.
This version isn't available via npm and we can't load it from the gem any more as we move to Webpack assets.
As a side note: I think we'll need to replace Select2 soon anyway, so we can delete this once we've done that.
The master branch uses 2.0.0 but this PR went up to 2.4.0, however that caused the /map page to break and it was difficult to figure out why. We need to update to 2.0.1 because when you drag and drop the location icon during sign up there was an error which is fixed in 2.0.1. Maybe it would be good to upgrade to 2.4.0 at some point but this PR is already quite big.
The map is displayed using https://leafletjs.com/
To enable Open Street Map go to the Admin -> Configuration -> Content section and click 'Open Street Map Enabled'.
The 'Open Street Map Provider Name' setting can be used to configure different tile providers thanks to the Leaflet-providers extension (https://github.com/leaflet-extras/leaflet-providers)
Some tile providers require an API key, this can provided in JSON format e.g. '{ apiKey: 123 }' in the 'Open Street Map Provider Options' setting.
Each tile provider has their own usage policy so this should be checked before enabling Open Street Map.
The search field for the Open Street Map works differently than searching on Google Maps. It matches producers by their name or address because it was easier to implement instead of matching place names all over the world.
For https://github.com/openfoodfoundation/openfoodnetwork/issues/3491
The spinjs-rails gem provides a CSS3 a spinning activity indicator. This commit removes the gem so we don't have to keep the gem up-to-date and uses the spinning-circles.svg which is used already in other places.
The spinjs spinner can be seen when viewing or editing taxonomies in /admin/taxonomies. It is loaded from the .ajaxStart call in app/assets/javascripts/admin/spree/progress.coffee
To test or restyle this spinner you can change the display property of the #progress element in app/assets/stylesheets/admin/components/progress.scss to 'block'.
Fixes an issue where if the js library from maps.googleapis.com failed to load in the <head>, all of our subsequent Angular would completely break.
See: https://github.com/angular-ui/angular-google-maps
Note: `bluebird.js` is a new dependency of `angular-google-maps.js`.
The AdaptiveMenu was design for a menu filling the screen width. Our
menu is in a skeleton structure. The new file overwrites the spree
version and takes the container width as reference.