Skip to content
This repository has been archived by the owner on Jul 11, 2023. It is now read-only.

Fix Map for -develop #50

Closed
kmcurry opened this issue Jan 11, 2018 · 11 comments
Closed

Fix Map for -develop #50

kmcurry opened this issue Jan 11, 2018 · 11 comments
Assignees
Labels

Comments

@kmcurry
Copy link
Member

kmcurry commented Jan 11, 2018

norfolkdrains-develop.herokuapp.com does not work because the map does not show.

@kmcurry kmcurry added the bug label Jan 11, 2018
@kmcurry
Copy link
Member Author

kmcurry commented Jan 11, 2018

Probably Google Maps API key

@ryayak1460
Copy link
Collaborator

ryayak1460 commented Apr 4, 2018

@kmcurry Yep, it has to do with the subdomain not matching the key used. We could solve this with a second key or including the development domain with the original key.

How do you want to go about this?

P.S.: This blocks #30 in the interim.
P.P.S.: I assigned you @kmcurry since I think you have admin rights to the API keys. Otherwise, someone else can take this.

@qwo
Copy link
Member

qwo commented Apr 4, 2018 via email

@ryayak1460 ryayak1460 assigned qwo and unassigned kmcurry Apr 5, 2018
@qwo
Copy link
Member

qwo commented Apr 7, 2018

hey @ryayak1460 i looked for the key specifically with a restriction and I'm not sure I created this key.

I made an alternative key for you to use for development. I apologize for the delay
AIzaSyDncXZW6QPsMzLybNWbUJtwxSjgjoRHdVk

@ryayak1460
Copy link
Collaborator

Awesome, thanks, @stanzheng! Now comes the question: where do we use this? I don't actually see the key referenced in code anywhere. The app/assets/javascripts/main.js.erb template doesn't actually use a map key, so is this something explicitly in Heroku?

@qwo
Copy link
Member

qwo commented Apr 12, 2018

@ryayak1460 check where the js for the google maps key is being loaded.

https://github.com/Code4HR/adopt-a-drain/blob/master/app/views/layouts/application.html.haml#L23

You just have to override the environment variable. Its a railism

Rails.application.secrets.google_maps_javascript_api_key

@ryayak1460
Copy link
Collaborator

ryayak1460 commented Apr 12, 2018

Aw man, I totally missed that! Cool, thanks, @stanzheng!

So I see that in config/secrets.yml for staging we use the environment variable $GOOGLE_MAPS_JAVASCRIPT_API_KEY, so I would assume we update that API key in Heroku and it should work? We may need to update the $SECRET_KEY_BASE environment variable as well, depending.

For reference, here's that config.

@qwo
Copy link
Member

qwo commented Apr 12, 2018

yup! probably just needs to be configured in the new environment or in the yaml file. Since these keys are semi-public because they're sent to the client it should be fine to include!

@ryayak1460
Copy link
Collaborator

Who can update the value in Heroku? You, @stanzheng? @BretFisher? Or will we just update the value in the config file here in the repo?

@BretFisher
Copy link
Member

ENVVAR's are set for each app in Heroku. Looks like GOOGLE_MAPS_JAVASCRIPT_API_KEY is set in both, but it's the same value. I updated the norfolkdrains-develop with the key above and the site seems to work for me. I'll close but reopen if it's not the true fix.

@ryayak1460
Copy link
Collaborator

Works for me too, Bret! Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants