Skip to content

Conversation

@ismailsunni
Copy link
Contributor

@ismailsunni ismailsunni commented Nov 26, 2025

Some changes for fixing the tests:

  • Use ComputedRef as the parameter for useFieldValidation to maintain reactivity
  • Handling the KML and GPX more properly: attributions, kmlName, hasWarning
  • Prioritize errors from parsing
  • Fix intercepts, wrong layer menu id, etc

Test link

@github-actions github-actions bot added the bug label Nov 26, 2025
@ismailsunni ismailsunni changed the title Fix pb 2026 fix import tool file PB-2026: Fix import tool file Nov 26, 2025
@cypress
Copy link

cypress bot commented Nov 26, 2025

web-mapviewer    Run #6091

Run Properties:  status check errored Errored #6091  •  git commit abde6f8592: PB-2064: Add another goToMapView to fix cypress running issue in the CI.
Project web-mapviewer
Branch Review fix-pb-2026-fix-import-tool-file
Run status status check errored Errored #6091
Run duration 11m 41s
Commit git commit abde6f8592: PB-2064: Add another goToMapView to fix cypress running issue in the CI.
Committer Ismail Sunni
View all properties for this run ↗︎

Test results
Tests that failed  Failures 50
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 20
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 128
View all changes introduced in this branch ↗︎

Tests for review

Failed  legacyParamImport.cy.ts • 1 failed test • e2e/chrome/mobile

View Output

Test Artifacts
An uncaught error was detected outside of a test Test Replay Screenshots
Failed  3d/layers.cy.ts • 10 failed tests • e2e/chrome/mobile

View Output

Test Artifacts
Test of layer handling in 3D > add layer from search bar Test Replay Screenshots
Test of layer handling in 3D > sets the opacity to the value defined in the layers URL param or menu UI Test Replay Screenshots
Test of layer handling in 3D > sets the timestamp of a layer when specified in the layers URL param Test Replay Screenshots
Test of layer handling in 3D > reorders visible layers when corresponding buttons are pressed Test Replay Screenshots
Test of layer handling in 3D > add GeoJson layer with opacity from URL param Test Replay Screenshots
Test of layer handling in 3D > removes a layer from the visible layers when the "remove" button is pressed Test Replay Screenshots
Test of layer handling in 3D > uses the 3D configuration of a layer if one exists Test Replay Screenshots
Test of layer handling in 3D > add KML layer from drawing Test Replay Screenshots
Test of layer handling in 3D > Verify layer features in 2D and 3D Test Replay Screenshots
Test of layer handling in 3D > Verify a layer with EPSG:4326(WEBMERCATOR) bounding box in 2D and 3D Test Replay Screenshots
Failed  menuTray.cy.ts • 1 failed test • e2e/chrome/mobile

View Output

Test Artifacts
An uncaught error was detected outside of a test Test Replay Screenshots
Failed  changeLanguage.cy.ts • 1 failed test • e2e/chrome/mobile

View Output

Test Artifacts
An uncaught error was detected outside of a test Test Replay Screenshots
Failed  drawing.cy.ts • 1 failed test • e2e/chrome/mobile

View Output

Test Artifacts
An uncaught error was detected outside of a test Test Replay Screenshots

The first 5 failed specs are shown, see all 24 specs in Cypress Cloud.

@ismailsunni ismailsunni force-pushed the fix-pb-2026-fix-import-tool-file branch from 6d73615 to 72ddce0 Compare November 28, 2025 14:12
and fix some TS error found in legacyParamImport.cy.ts
@ismailsunni ismailsunni force-pushed the fix-pb-2026-fix-import-tool-file branch 4 times, most recently from 0574a90 to b0e473a Compare December 1, 2025 03:07
- Add validation checks before store assertions for non-CORS GPX import
- Handle menu re-renders after layer removal with stabilization waits
- Add conditional warning window handling
- Move profile intercept setup before interactions
When importing a KML file that is outside the extent, the parser was
showing "Invalid file" error instead of the correct "out of bounds" error.

The issue occurred because parseAll() threw the first rejected error from
any parser, which was typically InvalidFileContentError from parsers that
couldn't handle the file format. However, the KML parser correctly
identified the file as KML and threw a more specific OutOfBoundsError.

Fixed by prioritizing specific errors (OutOfBounds, Empty, UnknownProjection)
over generic InvalidFileContentError, ensuring users see the most relevant
error message.
@ismailsunni ismailsunni force-pushed the fix-pb-2026-fix-import-tool-file branch from b0e473a to abde6f8 Compare December 1, 2025 04:05
@ismailsunni ismailsunni requested a review from Copilot December 1, 2025 04:06
@ismailsunni ismailsunni changed the title PB-2026: Fix import tool file PB-2064: Fix import tool file Dec 1, 2025
Copilot finished reviewing on behalf of ismailsunni December 1, 2025 04:09
@ismailsunni ismailsunni marked this pull request as ready for review December 1, 2025 04:09
@ismailsunni ismailsunni requested a review from pakb December 1, 2025 04:09
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes issues with the import tool file functionality, including improvements to layer ID handling, validation reactivity, error message prioritization, and test stability.

Key changes:

  • Added KML| and GPX| prefixes to layer IDs throughout the application for consistent layer identification
  • Refactored validation composable to use ComputedRef<props> for better reactivity
  • Improved error prioritization in file parsers to show more specific errors (OutOfBounds, Empty, UnknownProjection) over generic errors

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/viewer/tests/cypress/tests-e2e/importToolFile.cy.ts Updated test expectations to match new layer ID format with KML| and GPX| prefixes; improved test stability with proper wait conditions; refactored 3D test into separate skipped test; added profile intercept constant
packages/viewer/src/utils/composables/useFieldValidation.ts Changed props parameter from object to ComputedRef for proper reactivity; updated to emit full ValidationResult object instead of boolean; removed unused toRef import
packages/viewer/src/utils/components/TextInput.vue Converted validationProps to computed ref for consistency with updated composable
packages/viewer/src/utils/components/TextAreaInput.vue Converted validationProps to computed ref for consistency with updated composable
packages/viewer/src/utils/components/FileInput.vue Converted validationProps to computed ref; updated default prop values and parameter handling; added computedRequired usage
packages/viewer/src/utils/components/EmailInput.vue Converted validationProps to computed ref for consistency with updated composable
packages/viewer/src/modules/menu/components/advancedTools/ImportFile/parser/index.ts Implemented error prioritization logic to show specific errors (OutOfBounds, Empty, UnknownProjection) before generic InvalidFileContentError
packages/viewer/src/modules/menu/components/advancedTools/ImportFile/parser/KMLParser.class.ts Added KML name parsing and proper layer initialization with name, hasWarning, and isLoading properties
packages/viewer/src/modules/menu/components/advancedTools/ImportFile/parser/GPXParser.class.ts Added gpxFileUrl parameter to layer creation for proper GPX layer initialization
packages/viewer/src/modules/menu/components/advancedTools/ImportFile/ImportFileOnlineTab.vue Fixed loading state handling by removing delayed timeout and setting state immediately; reordered props for clarity
packages/viewer/src/modules/menu/components/advancedTools/ImportFile/ImportFileLocalTab.vue Added validMarker prop to FileInput for consistent validation feedback
packages/layers/src/utils/layerUtils.ts Added automatic attribution generation based on file source (local files use filename, URLs use hostname); improved isLocalFile detection; added error handling for URL parsing

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

cy.reload()
cy.waitMapIsReady()

// TODO(IS): We shoudl check for warnings about missing local files, but it needs to be fixed first (related to url)
Copy link

Copilot AI Dec 1, 2025

Choose a reason for hiding this comment

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

Typo in comment: "shoudl" should be "should"

Suggested change
// TODO(IS): We shoudl check for warnings about missing local files, but it needs to be fixed first (related to url)
// TODO(IS): We should check for warnings about missing local files, but it needs to be fixed first (related to url)

Copilot uses AI. Check for mistakes.
@sommerfe sommerfe force-pushed the feat-PB-1383-pinia-store branch 2 times, most recently from a1cccff to 9e6d8d7 Compare December 2, 2025 08:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants