-
Notifications
You must be signed in to change notification settings - Fork 66
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
Display locations on conference list #532
base: develop
Are you sure you want to change the base?
Conversation
@@ -73,8 +73,8 @@ public function import(Event $event) | |||
->firstOrNew(['calling_all_papers_id' => $event->id]); | |||
$this->updateConferenceFromCallingAllPapersEvent($conference, $event); | |||
|
|||
if (! $conference->latitude && ! $conference->longitude && $conference->location) { | |||
$this->geocodeLatLongFromLocation($conference); | |||
if ($conference->location) { |
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.
This isn't checking if latitude and longitude are set, which means we'll run the geocoder every single time, drastically increasing our costs.
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.
It's probably worth adding a test to ensure geocodeLocation
isn't called if latitude and longitude or set, so this isn't every accidentally broken in the future.
{ | ||
protected $signature = 'app:backfill-conference-location-names'; | ||
|
||
protected $description = 'Command description'; |
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.
Please fill out
public function geocode(string $address): Coordinates | ||
private $response; | ||
|
||
public function geocode(string $address): self |
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.
You've modified this class to now represent the results of a geocoding operation. Two issues:
- You have a bunch of methods that can fail, if you haven't run
geocode
yet. That meansgeocode
needs to become the constructor, so you can't have an instance of this object that doesn't have aresponse
property. - This is no longer a
Geocoder
service. it's now a representation of a single geocode request. So you'll want to rename it to something that better reflects that.
This PR closes #519 by adding the conference location to the conferences list page. This PR also adds a
app:backfill-conference-location-names
to backfill a display-friendly conference location. Each conference listing will then display either the conference's location name, or the value in thelocation
column, if present.