-
Notifications
You must be signed in to change notification settings - Fork 16
PB-2064: Fix import tool file #1516
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
base: feat-PB-1383-pinia-store
Are you sure you want to change the base?
PB-2064: Fix import tool file #1516
Conversation
6d73615 to
72ddce0
Compare
and fix some TS error found in legacyParamImport.cy.ts
0574a90 to
b0e473a
Compare
…s and simplify composable
- 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
…after reload on the KML layer
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.
b0e473a to
abde6f8
Compare
There was a problem hiding this 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|andGPX|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) |
Copilot
AI
Dec 1, 2025
There was a problem hiding this comment.
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"
| // 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) |
a1cccff to
9e6d8d7
Compare
Some changes for fixing the tests:
Test link