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

Separate out primary mapping geometry from new feature geometry (user select during proj create) #2225

Merged
merged 8 commits into from
Feb 25, 2025

Conversation

spwoodcock
Copy link
Member

@spwoodcock spwoodcock commented Feb 24, 2025

What type of PR is this? (check all applicable)

  • πŸ• Feature
  • πŸ› Bug Fix
  • πŸ“ Documentation
  • πŸ§‘β€πŸ’» Refactor
  • βœ… Test
  • πŸ€– Build or CI
  • ❓ Other (please specify)

Related Issue

Describe this PR

New Geoms vs Existing (Primary) Geoms

  • Went down a rabbit hole due to needing to display point geoms.
  • It was clear we needed to update project creation config: primary geoms to map are separate from new geoms to map, e.g.
    • Map polygons, where new geoms drawn are points
    • A entirely point based mapping workflow
    • Any other combination of point, polygon, linestring!
  • I updated the db / migrations and models, then added extra options to the frontend during project creation.

Custom XLSForm Is Redundant

I also added a modification to the custom XLSForm upload.

Instead of having:

  1. Category selection
  2. Optional custom XLSForm upload

I refactored to have:

  1. The XLSForm must always be uploaded.
  2. Category selection was removed, including from osm-fieldwork code that used it in the form.
  3. The form can either be custom, or downloaded from a list of options (and optionally modified before upload).

Normalise geometry type during project creation

  • If the user uploads a polygon project, but specifies they want to map with points, we calculate the centroids for them to map with automatically.
  • TODO in a future PR: If the user uploads mixed geometry type data upload, but specifies they are mapping lines, we strip out the polygons and points automatically (perhaps we revisit this behaviour, but it will do for now)

Remaining Tidy Up

@NSUWAL123 if you wouldn't mind helping finalise this tomorrow, it would help a lot πŸ™
Once merged I think we can test thoroughly, then push through to prod as new release for Tokha.

  • Fix text highlighting on left for Upload Survey and Map Data tabs (sorry I messed this up a bit in a rush)
  • Spacing issues - large gaps between elements on both Upload Survey and Map Data tabs.
  • Upload Survey tab: if validation logic is triggered that form is not attached, then a form is uploaded afterwards, the validation message does not disappear.
  • Map Data tab: conflict between two radio geometry selections - clicking label of new geometry type changes the selection for the primary geometry type? Is this linked to how the CustomCheckbox works, or did I miss something?

Screenshots

Moved form upload to top, with optional form download and modification below:

image

User can download an existing form and modify, before upload (or modify in-browser):

image

More options on the 'Map Data' tab:

image

Selecting different geom types for 'main' geoms and 'new' geoms (draw toolbar):

image

Mapper frontend with correct geom types

image

Review Guide

  • Hopefully no changes are needed in the db for Tokha, as the default was originally polygon geoms + point new geoms.
  • New projects created should be manually selected as polygon type, with point new geoms if needed.
  • If both polygon existing and new geoms are needed, then the default is to match new geoms to the primary geom type.

Checklist before requesting a review

[optional] What gif best describes this PR or how it makes you feel?

@spwoodcock spwoodcock requested a review from NSUWAL123 February 24, 2025 22:11
@spwoodcock spwoodcock self-assigned this Feb 24, 2025
@github-actions github-actions bot added docs Improvements or additions to documentation enhancement New feature or request frontend Related to frontend code backend Related to backend code migration Contains a DB migration tests Related to automated code tests labels Feb 24, 2025
@NSUWAL123
Copy link
Contributor

Sure, I'll have a look on these stuffs

@NSUWAL123 NSUWAL123 mentioned this pull request Feb 25, 2025
7 tasks
@NSUWAL123
Copy link
Contributor

@spwoodcock, The confirmation popup is in the middle of the screen. Is that expected or should it be placed at the top?
image

@spwoodcock
Copy link
Member Author

@spwoodcock, The confirmation popup is in the middle of the screen. Is that expected or should it be placed at the top?
image

Yeah I put it there purposefully, as it seemed a bit hidden at the top (I didn't notice it immediately).

It could block the screen until the user clicks an option (grey our the background temporarily)

* [pre-commit.ci] pre-commit autoupdate (#2224)

updates:
- [github.com/commitizen-tools/commitizen: v4.2.1 β†’ v4.2.2](commitizen-tools/commitizen@v4.2.1...v4.2.2)
- [github.com/astral-sh/ruff-pre-commit: v0.9.6 β†’ v0.9.7](astral-sh/ruff-pre-commit@v0.9.6...v0.9.7)
- [github.com/astral-sh/uv-pre-commit: 0.6.0 β†’ 0.6.2](astral-sh/uv-pre-commit@0.6.0...0.6.2)
- [github.com/pycontribs/mirrors-prettier: v3.5.1 β†’ v3.5.2](pycontribs/mirrors-prettier@v3.5.1...v3.5.2)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* chore(deps): update dependency @types/geojson to v7946.0.16 (#2227)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(dataExtract): if no dataExtract uploaded or fetched, disable next btn

* fix(radiobutton): use radio option label as id for radiobutton

* fix(description): update uploadSurvey desc section hover

* fix(checkbox): update styles

* refactor(style): refactor style to maintain consistent gaps in UI

* fix(selectForm): disappear validation message after form upload

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
@spwoodcock spwoodcock merged commit caacc33 into development Feb 25, 2025
8 of 9 checks passed
@spwoodcock spwoodcock deleted the feat/rework-proj-create branch February 25, 2025 10:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Related to backend code docs Improvements or additions to documentation enhancement New feature or request frontend Related to frontend code migration Contains a DB migration tests Related to automated code tests
Projects
2 participants