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

upload geojson feature for use in search #200

Merged
merged 16 commits into from
Jul 14, 2023

Conversation

bradleyandrick
Copy link
Contributor

Related Issue(s):

  • NA

Proposed Changes:

  1. add feature to upload geojson files to use on map for searching scenes/mosaics
  2. add component and helper file for showing system alerts

To test:

  • confirm unit tests pass 🍏

NOTE: test files exist for manually testing mentioned below. See PR owner or project ticket for accessing files

test cancel

  • set VITE_ADVANCED_SEARCH_ENABLED to true in config
  • load app
  • click advanced toggle below search button
  • click Upload geojson button
  • confirm advanced options close
  • confirm Upload Geojson File modal renders
  • click cancel button in modal
  • confirm modal closes and no geojson is added to map

test adding files

happy paths:

test point

  • load app
  • click advanced toggle below search button
  • click Upload geojson button
  • click inside green dashed upload box
  • navigate to test file for point test_geojson/valid_point.geojson
  • confirm file name shows in upload modal
  • confirm no errors show
  • click add button
  • confirm Upload Geojson File modal closes
  • confirm single green point marker is added to map
  • click search
  • confirm search results are only returned for scenes that intersect the point marker
  • click advanced toggle below search button again
  • click clear button
  • confirm point marker is removed from map
  • click search
  • confirm search results no longer limited to scenes the intersect the point

test other files in the test_geojson directory that start with valid_

  • repeat test point steps for:
    • valid_multiPoint.gejosn
    • valid_line.geojson
    • valid_multiLineString.geojson
    • valid_polygon.json
    • valid_multiPoly.json
    • valid_featureCollectionMultipleFeatures.geojson
      • NOTE: for a feature collection with multiple features, only the first feature is used for the intersect. the rest are ignored

test drag

  • repeat steps for test point, but drag file into box instead of clicking box to select
  • confirm file name shows in upload modal
  • confirm remaining steps match expected test point tests sequence

tests for invalid uploads:

test no file

  • load app
  • click advanced toggle below search button
  • click Upload geojson button
  • do not add any files
  • click add button
  • confirm error message shows and states No file selected
  • confirm error message closes on it's own after 5 seconds
  • click add button again
  • before 5 seconds is up, click the X button on the right side of the error message
  • confirm error message closes

test invalid file type

  • load app
  • click advanced toggle below search button
  • click Upload geojson button
  • click inside green dashed upload box
  • navigate and select test file test_geojson/invalid_exampleImageFile.png
  • confirm error message shows and states ERROR: Only .json or .geojson supported
  • confirm upload modal still showing
  • confirm no file name shows in upload modal

test exceeded file size

  • load app
  • click advanced toggle below search button
  • click Upload geojson button
  • click inside green dashed upload box
  • navigate and select test file test_geojson/invalid_fileTooLarge.geojson
  • confirm error message shows and states ERROR: File size exceeded (100KB max)
  • confirm upload modal still showing
  • confirm no file name shows in upload modal

test json structure not valid

  • load app
  • click advanced toggle below search button
  • click Upload geojson button
  • click inside green dashed upload box
  • navigate and select test file test_geojson/invalid_jsonStructureNotValid.geojson
  • confirm file name shows in upload modal
  • click add button
  • confirm error message shows and states ERROR: Invalid geojson uploaded
  • confirm upload modal still showing

test geojson structure not valid

  • load app
  • click advanced toggle below search button
  • click Upload geojson button
  • click inside green dashed upload box
  • navigate and select test file test_geojson/invalid_MissingType.geojson
  • confirm file name shows in upload modal
  • click add button
  • confirm error message shows and states ERROR: Invalid geojson uploaded
  • confirm upload modal still showing

test geometry collection uploaded (not allowed)

  • load app
  • click advanced toggle below search button
  • click Upload geojson button
  • click inside green dashed upload box
  • navigate and select test file test_geojson/invalid_geometryCollection.geojson
  • confirm file name shows in upload modal
  • click add button
  • confirm error message shows and states ERROR: GeometryCollection not supported
  • confirm upload modal still showing

PR Checklist:

  • I have added my changes to the CHANGELOG or a CHANGELOG entry is not required.

@philvarner
Copy link

image

Advanced menu is behind scene modal.

@philvarner
Copy link

Filed #201 about error handling.

src/utils/mapHelper.js Outdated Show resolved Hide resolved
@bradleyandrick
Copy link
Contributor Author

Advanced menu is behind scene modal has been correctly z ordered per #200 (comment)

@bradleyandrick bradleyandrick merged commit ccfe30b into main Jul 14, 2023
1 check passed
@bradleyandrick bradleyandrick deleted the ba/feature/upload-geojson-for-search branch August 2, 2024 17:41
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.

2 participants