-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[GEOLOC AUTOCOMPLETION] React component and API routes #273
Conversation
Ça m'a l'air bien dans l'ensemble. Juste une remarque : faudrait bouger le code d'appel aux API externes dans des actions puis des reducers (flux de données Redux déjà en vigueur sur Grottocenter). Peut-être que ça peut être fait plus tard cependant. |
Il manque react-select dans le package.json. EDIT : il n'est pas utilisé en fait non si je ne dis pas de bêtises ? |
Pour le coup on n'utilise pas react-select finalement, mais j'ai effectivement oublié d'enlever le import ! Il faut que je corrige ça. |
/* global google */ | ||
const API_KEY = ''; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Le global google
c'est pas très propre... On doit en faire quoi concrètement ? D'où il sort ? 🙂
Il faudrait mettre en place un système de variable d'environnement pour la clé d'API : je ne crois pas qu'il y en ait sur l'application React pour le moment...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Clm-Roig J'avais pas vu ton message mais je viens de dire la même chose sur Slack
Oui il faudrait
On à aucune autre global dans le front ? (Pour leaflet ou un autre service)
Je n'ai pas l'impression
assets/js/react/components/common/GeolocAutocompletion/PlacesDetail.js
Outdated
Show resolved
Hide resolved
assets/js/react/components/common/GeolocAutocompletion/PlacesDetail.js
Outdated
Show resolved
Hide resolved
assets/js/react/components/common/GeolocAutocompletion/index.jsx
Outdated
Show resolved
Hide resolved
assets/js/react/components/common/GeolocAutocompletion/PlacesDetail.js
Outdated
Show resolved
Hide resolved
const predictionsCity = useLocationPredictions(inputCity, 'city', undefined, countyBounds, 3); | ||
|
||
// Triggered when an option is selected, changes the state and retrieves detail of the selected option to get bounds information. | ||
const onSelect = (selected, type) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
selected
c'est une prediction non ?
Autant mettre le même terme qu'en bas. Ou alors renommer en selection
selected
ça fait penser à un boolean
assets/js/react/components/common/GeolocAutocompletion/index.jsx
Outdated
Show resolved
Hide resolved
Je n'arrive pas à tester le composant dans storybook Merci @ArthurLeblanc
Et rajouter une api google dev pour grotto non ? @Clm-Roig si tu as une idée :) |
Vous utilisez quoi comme IDE ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Modulo #273 (comment)
Pour moi on peut merge et refaire un test fonctionnel après
Le code est bien
cors: { | ||
allowOrigins: [ | ||
'http://beta.grottocenter.org/', | ||
'http://beta2.grottocenter.org/', | ||
'https://www.grottocenter.org/', | ||
], | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A tester mais je pense que ce n'est plus nécessaire maintenant qu'on a séparé le front du back.
cors: { | ||
allowOrigins: [ | ||
'http://beta.grottocenter.org/', | ||
'http://beta2.grottocenter.org/', | ||
'https://www.grottocenter.org/', | ||
], | ||
}, | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A tester mais je pense que ce n'est plus nécessaire maintenant qu'on a séparé le front du back.
Closed by #1160 |
Add :
React hook that delivers geolocation autocomplete in all languages
Places details & translation service
Story book component for demo purpose
Example of the story book component with translation set to russian :