Skip to content

Conversation

@ronnyReliefapp
Copy link

Description

This PR updates the error messages and validation behavior for the Shapefile upload and map component to align with the requirements specified in the ticket. The changes ensure that geometry errors (gaps and overlaps) are clearly communicated to the user and that upload-related errors remain visible long enough to be read.

Changes:

  • Merged Intersection & Overlap Messages: Updated ERROR_MESSAGES in ShapeFileMapComponent to use the same user-friendly message for both intersections and overlaps, as requested.
  • Increased Snackbar Duration: Extended the display time for shapefile validation errors from 15 to 25 seconds in FormBuilderService to ensure users have enough time to read detailed error messages (like CRS requirements).
  • Standardized Error Text: Ensured the "Gaps" error message matches the exact wording required by the ticket.

Useful links

Ticket: https://www.notion.so/cb32a703a24e4e03a3ec47bd6b38c4a4?v=467317821cf24db6b43c59325335e46b&p=24cd463fd8c480218d7bcc037ba055f0&pm=s

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • Improvement (refactor or addition to existing functionality)

How Has This Been Tested?

Test A: Geometry Errors (Map Level)

  • Open a form with a ShapeFile question.
  • Upload a .zip containing polygons with gaps.
    • Expected: Red alert on map shows: “Geometry error: There are one or more gaps (empty spaces) between zonation polygons. Please correct these errors and upload the files again.”
  • Upload a .zip containing overlapping or intersecting polygons.
    • Expected: Red alert on map shows: “Geometry error: There are one or more overlapping zonation polygons. Please correct these errors and upload the files again.”

Test B: Upload Errors (Snackbar Level)

  • Upload a .zip that triggers a backend validation error (e.g., wrong CRS or missing zonation).
  • Expected: The snackbar popup appears with the error message and remains visible for 25 seconds (previously 15s).

Screenshots

N/A

Checklist:

( * == Mandatory )

  • * I have set myself as assignee of the pull request
  • * My code follows the style guidelines of this project
  • * Linting does not generate new warnings
  • * I have performed a self-review of my own code
  • * I have put the ticket for review, adding the oort-frontend team to the list of reviewers
  • * I have commented my code, particularly in hard-to-understand areas
  • * I have put JSDoc comment in all required places
  • * My changes generate no new warnings
  • * I have included screenshots describing my changes if relevant
  • * I have selected labels in the Pull Request, according to the changes with code brings
  • I have made corresponding changes to the documentation ( if required )
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

More explanation

https://www.loom.com/share/05a716d61b9744faaf51fb304c21d1e5?sid=f87cf896-582a-4f76-93ae-8ceed801b145

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.

3 participants