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

Add "Autocomplete from ..." button to Device, Sector, Node and Building #396

Merged
merged 9 commits into from
Aug 6, 2024

Conversation

Andrew-Dickinson
Copy link
Member

@Andrew-Dickinson Andrew-Dickinson commented Jul 6, 2024

Adds a button to the following admin pages:

  • Building
  • Node
  • Device
  • Sector

When clicked, it automatically populates the geospatial coordinates (and DOB BIN where applicable) from the appropriate source. For Buildings, it uses the entered address (via a lookup to the city APIs). For Nodes, it uses the associated building (selecting the first one arbitrarily if there is more than one). For devices and sectors, it uses the associated node.

Example:

Screen.Recording.2024-07-06.at.14.58.48.mov

Closes #307

@Andrew-Dickinson Andrew-Dickinson linked an issue Jul 6, 2024 that may be closed by this pull request
@Andrew-Dickinson Andrew-Dickinson changed the base branch from andrew/add-button-fixes to main July 27, 2024 17:02
Copy link

codecov bot commented Jul 27, 2024

Codecov Report

Attention: Patch coverage is 97.60479% with 4 lines in your changes missing coverage. Please review.

Project coverage is 94.93%. Comparing base (af5d6f8) to head (2c7f252).

Files Patch % Lines
src/meshapi/admin/sector.py 70.00% 3 Missing ⚠️
src/meshapi/validation.py 96.15% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #396      +/-   ##
==========================================
+ Coverage   94.76%   94.93%   +0.17%     
==========================================
  Files         101      103       +2     
  Lines        5025     5155     +130     
==========================================
+ Hits         4762     4894     +132     
+ Misses        263      261       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Andrew-Dickinson
Copy link
Member Author

Screenshot 2024-08-04 at 18 27 24

# Conflicts:
#	src/meshapi/admin/building.py
#	src/meshapi/views/geography.py
src/meshapi/views/forms.py Fixed Show fixed Hide fixed
src/meshapi/views/geography.py Fixed Show fixed Hide fixed
Copy link
Collaborator

@WillNilges WillNilges left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A little odd that we're integration testing their API, but pop off.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're not integration testing their API. This is a mocked response where our testing framework pretends to be their API. It actually allows the opposite, for our tests to be fully independent of the city's API

except ValueError:
return Response(
{
"detail": "Non-NYC registrations are not supported at this time. Check back later, "
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small Nit: Maybe we shouldn't say "check back later." I know we've been doing that for like a year, but it's probably more productive to just say "contact support."

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can change this, but really this should be handled in the frontend and nobody should see this message

@Andrew-Dickinson Andrew-Dickinson enabled auto-merge (squash) August 6, 2024 01:05
@Andrew-Dickinson Andrew-Dickinson merged commit d903912 into main Aug 6, 2024
10 checks passed
@Andrew-Dickinson Andrew-Dickinson deleted the andrew/wip-admin-auto-geo-coord branch August 6, 2024 01:09
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.

Auto populate lat/lon/alt for addresses entered by admins
2 participants