- Add proper array length checks before accessing error.errors[0]
- Secure error handling in App.tsx for both map loading and layer loading
- Fix unsafe array access in mapApi.ts error handler
- Prevent crashes when error.errors is undefined or empty array
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-authored-by: Claude <noreply@anthropic.com>
* removed ocean nomad specific collections
* removed vessel icon
* updated seeds
* added profilecomponentes to type
* added text to item
* improved sample data
* improved sample data
* improved sample data
* fix comment
---------
Co-authored-by: Anton Tranelis <mail@antontranelis.de>
* seed directus data as a whole per project, fix marker icon: user-outline
* rename deploy.sh back to seed.sh
* workflow to test the seed in the backend
* test workflow failure
* wait 3 seconds for all docker containers to be ready
* sleep 3 seconds not 3000
* mod permissions
* try sudo
* revert breaking change
* enforce exit status 0
* fix exit enforce
* test if failing seed files is related to the data folder
fix
* revert volume removal, create uploads folder
* also chmod
* add marker icons, images & seeds
* added sample items to the development environment
Co-authored-by: Anton Tranelis
<31516529+antontranelis@users.noreply.github.com>
* added ocean nomads layers
* added and restructured files
* added menu texts and removed place layer from sample map
---------
Co-authored-by: Anton Tranelis <31516529+antontranelis@users.noreply.github.com>
Co-authored-by: Anton Tranelis <mail@antontranelis.de>
* sync collections & other settings with production
missing changes
* deactivated specific flows
---------
Co-authored-by: Anton Tranelis <mail@antontranelis.de>
- Add user_created field to all item update operations to maintain proper user association
- Update useMyProfile hook to use direct computation instead of useMemo to avoid React hook queue issues
- Refactor UserControl to use useMyProfile hook for consistency
- Fix user_created handling in LocateControl, ItemFormPopup, useSelectPosition, and itemFunctions
- Add user parameter to linkItem, unlinkItem, and related functions with proper TypeScript signatures
- Update all function calls and tests to include user parameter
- Ensure proper null safety with user ?? undefined pattern
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* improved locate control
* fix(lib): clean up setTimeout and fix Chrome modal layout issue
- Add proper cleanup for setTimeout in LocateControl to prevent memory leaks
- Replace modal-open class with direct overflow style to fix Chrome scrollbar issue
- Add timeout reference tracking for better component unmount handling
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix linting
* set distance rule
* optimized locatecontrol
* working for new users without profile now
* test(lib): add comprehensive tests for LocateControl component
- Add 9 comprehensive unit tests covering all LocateControl functionality
- Test modal display logic for new and existing users
- Test profile creation and position updates
- Test navigation after successful operations
- Test error handling with proper toast notifications
- Mock all external dependencies (React Router, Leaflet, APIs)
- Verify dialog behavior prevents re-appearance after decline
- Include snapshot tests for UI consistency
- All tests pass with proper TypeScript typing
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* removed unused code, add 1s delay
* updated tests
* fixed tests
* fix test for LocateControl
* fix linting
---------
Co-authored-by: Claude <noreply@anthropic.com>
* improved locate control
* fix(lib): clean up setTimeout and fix Chrome modal layout issue
- Add proper cleanup for setTimeout in LocateControl to prevent memory leaks
- Replace modal-open class with direct overflow style to fix Chrome scrollbar issue
- Add timeout reference tracking for better component unmount handling
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix linting
* set distance rule
* optimized locatecontrol
* working for new users without profile now
* test(lib): add comprehensive tests for LocateControl component
- Add 9 comprehensive unit tests covering all LocateControl functionality
- Test modal display logic for new and existing users
- Test profile creation and position updates
- Test navigation after successful operations
- Test error handling with proper toast notifications
- Mock all external dependencies (React Router, Leaflet, APIs)
- Verify dialog behavior prevents re-appearance after decline
- Include snapshot tests for UI consistency
- All tests pass with proper TypeScript typing
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* removed unused code, add 1s delay
* updated tests
* fixed tests
---------
Co-authored-by: Claude <noreply@anthropic.com>
* use server response for local state updates
* fix formatting
* refactor: comprehensive server-response-first pattern implementation
## Major Changes
### LayerProps ID Required
- Made `LayerProps.id` required (was optional)
- All layers now guaranteed to have server-provided UUID
- Enables reliable layer ID mapping from server responses
### useSelectPosition Hook Refactored
- Added reusable `handleApiOperation` helper function
- Refactored `itemUpdatePosition`, `itemUpdateParent`, `linkItem`
- All functions now use server response + layer ID mapping
- Consistent error handling and toast management
### itemFunctions.ts Complete Refactor
- **submitNewItem**: Server response with layer mapping
- **linkItem**: Server response preserves layer object
- **unlinkItem**: Same pattern as linkItem
- **handleDelete**: Simplified error handling
- **onUpdateItem**: Complex function refactored for both update/create branches
### Benefits
- ✅ Eliminates race conditions from manual state construction
- ✅ Server response as single source of truth for all updates
- ✅ Consistent error handling across all API operations
- ✅ Items no longer disappear from map after updates
- ✅ Type-safe layer ID mapping
### Testing
- Updated ItemFunctions.spec.tsx with new toast patterns
- Added required layer IDs to test objects
- All 19 tests passing (3 skipped)
- ESLint clean
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix linting
* fix: resolve TypeScript undefined data errors
- Add non-null assertions for result.data in conditional blocks
- TypeScript now properly recognizes data is defined after success check
- All linting and TypeScript errors resolved
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fixed examples
* remove unneccessary uuid generation
---------
Co-authored-by: Claude <noreply@anthropic.com>