Access to fetch at 'http://localhost:3000/api/linesColorApi' from origin 'http://10.10.0.13:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
- Moved zoomIn and zoomOut functions from MapComponent.js to a new file zoomUtils.js in the utils directory.
- Updated MapComponent.js to import and use the zoomIn and zoomOut functions from the new file.
- This change improves code modularity and readability.
- Moved the openInSameWindow function from MapComponent.js to a new file openInSameWindow.js in the utils directory.
- Updated MapComponent.js to import and use the openInSameWindow function from the new file.
- This change improves code modularity and readability.
- Moved checkOverlappingMarkers function from MapComponent.js to a new file in /utils/mapUtils.js for better separation of concerns.
- Updated the import statement in MapComponent.js to reflect the new location of checkOverlappingMarkers.
- Configured Jenkins FreeStyle job to trigger on push
- Added `npm install` and `npm test` steps in Jenkins build configuration
- Updated pre-push hook script to trigger Jenkins job and wait for test results
- Installed jest, @testing-library/react, and @testing-library/jest-dom as dev dependencies for testing
This commit sets up automated testing in Jenkins before code is pushed to the remote repository, ensuring code quality and preventing broken builds.
Moved the restoreMapSettings function from MapComponent.js to mapUtils.js for better modularity and reusability. This change also helps in maintaining cleaner code and improving readability.
- Split utils.js into three separate files to enhance modularity and maintainability:
1. geometryUtils.js: Contains geometry-related functions like parsePoint and findClosestPoints.
2. mapUtils.js: Contains functions related to map operations such as redrawPolyline and saveLineData.
3. markerUtils.js: Contains functions related to marker operations like insertNewMarker and handleEditPoi.
- Updated import statements in the relevant files to reflect the new structure.
- Ensured that each utility module is self-contained and has clear responsibilities.
This refactor improves the separation of concerns, making the codebase more organized and easier to navigate. Future maintenance and enhancements can now be more easily localized to the appropriate utility module.