Skip to content
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

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

andrewmile
Copy link
Collaborator

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 the location column, if present.

image

@@ -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) {
Copy link
Member

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.

Copy link
Member

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';
Copy link
Member

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
Copy link
Member

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:

  1. You have a bunch of methods that can fail, if you haven't run geocode yet. That means geocode needs to become the constructor, so you can't have an instance of this object that doesn't have a response property.
  2. 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.

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

Successfully merging this pull request may close these issues.

Would LOVE to see "Location" on the conference index page.
2 participants