Skip to content

feat(registrant_gis): show latitude/longitude inputs on registrant form (#1143)#324

Open
emjay0921 wants to merge 1 commit into
19.0from
fix/1143-gis-latlong-fields
Open

feat(registrant_gis): show latitude/longitude inputs on registrant form (#1143)#324
emjay0921 wants to merge 1 commit into
19.0from
fix/1143-gis-latlong-fields

Conversation

@emjay0921

Copy link
Copy Markdown
Contributor

Why is this change needed?

On the registry group/individual form, GPS Coordinates only render as the MapTiler map widget. Without MapTiler configured you cannot set coordinates by clicking the map, so the values are effectively un-enterable when creating a group via the registry (OP#1143). Only Excel import (via headers) could set them.

How was the change implemented?

  • Added visible Latitude and Longitude float inputs (gis_latitude / gis_longitude) on res.partner, kept in sync with the existing coordinates point:
    • computed from coordinates (x = longitude, y = latitude),
    • inverse rebuilds the point when either is typed; (0, 0) clears it,
    • stored, so editing the map updates the inputs and vice-versa.
  • Showed both inputs above the GPS Coordinates map in the Location section of the individual and group registrant forms.
  • Because they are real fields, they are also importable by name (in addition to the existing coordinates header).

New unit tests

  • test_lat_long_computed_from_coordinates — setting coordinates populates the lat/long inputs.
  • test_coordinates_built_from_lat_long — typing lat/long rebuilds the coordinates point (x=lon, y=lat).
  • test_lat_long_empty_when_no_coordinates — no point ⇒ inputs read 0.

Unit tests executed by the author

spp_registrant_gis suite: 0 failed, 0 error(s) of 7 tests (fresh DB, --stop-after-init).

How to test manually

  1. Registry → Groups → New → scroll to Location: Latitude and Longitude inputs are visible above the map.
  2. Type e.g. Latitude 8.5, Longitude 124.75, save → the map marker moves to that point.
  3. Conversely, click a point on the map (if MapTiler is configured) → the Latitude/Longitude inputs fill in.
  4. Same on the individual form.

Related links

https://projects.acn.fr/work_packages/1143

@gemini-code-assist

Copy link
Copy Markdown

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@codecov

codecov Bot commented Jul 22, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.44444% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 68.26%. Comparing base (1caf794) to head (4bd71fa).
⚠️ Report is 3 commits behind head on 19.0.

Files with missing lines Patch % Lines
spp_registrant_gis/models/res_partner.py 94.44% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             19.0     #324      +/-   ##
==========================================
- Coverage   74.28%   68.26%   -6.02%     
==========================================
  Files         372      123     -249     
  Lines       25385    12415   -12970     
==========================================
- Hits        18857     8475   -10382     
+ Misses       6528     3940    -2588     
Flag Coverage Δ
spp_analytics ?
spp_api_v2_cycles ?
spp_api_v2_entitlements ?
spp_api_v2_gis ?
spp_api_v2_programs ?
spp_api_v2_simulation ?
spp_audit_programs ?
spp_base_common 91.07% <ø> (+0.80%) ⬆️
spp_case_demo ?
spp_case_entitlements ?
spp_case_programs ?
spp_cr_type_assign_program ?
spp_dci_compliance ?
spp_dci_demo 94.28% <ø> (+0.88%) ⬆️
spp_dci_server_social ?
spp_demo ?
spp_demo_phl_luzon ?
spp_drims ?
spp_drims_sl ?
spp_drims_sl_demo ?
spp_farmer_registry_demo 61.06% <ø> (+0.04%) ⬆️
spp_gis_report ?
spp_grm_demo ?
spp_indicator ?
spp_indicator_studio ?
spp_metric_service ?
spp_mis_demo_v2 70.99% <ø> (+0.03%) ⬆️
spp_program_geofence 97.04% <ø> (?)
spp_programs 65.27% <ø> (+<0.01%) ⬆️
spp_registrant_gis 95.65% <94.44%> (?)
spp_registry 86.94% <ø> (+0.10%) ⬆️
spp_security 69.56% <ø> (+2.89%) ⬆️
spp_simulation ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
spp_registrant_gis/models/res_partner.py 95.23% <94.44%> (ø)

... and 266 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

1 participant