Conversation
* Map refactoring * Implementing reading new optional bindings * Adding changes to map component from upstream/refactor/map --------- Co-authored-by: Ole Martin Handeland <git@olemartin.org>
* Add toolbar config * Add config validation - Add config validation for geometryIsEditable & toolbar * Update useValidateGeometriesBindings.ts - Only check for geometryIsEditable if simpleBinding is not set when geometries are defined * Update map config validation - Update useValidateGeometriesBindings to check for geometryIsEditable if toolbar also is set - Update Map.tsx to only show MapSingleMarker if simpleBinding is set * Add PR fixes
- save to datamodel and load geometries to editable layer
* WIP edit geometry * working editing geometries
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (1)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughAdded optional per-geometry bindings Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
|
/publish |
PR release:
|
|
|
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/layout/Map/config.ts`:
- Around line 59-66: The description for the CG.prop 'geometryStyle' (created
with CG.dataModelBinding) is too vague — update its setDescription to state that
the binding expects a JSON-serialized Leaflet PathOptions object (i.e., a string
containing JSON like {"color":"#ff0000","weight":2,"fillOpacity":0.3}) because
the code calls JSON.parse(style) and passes the result to Leaflet's GeoJSON
style prop; make the description explicitly mention the required JSON shape and
an example to prevent authors from supplying plain color strings.
In `@src/layout/Map/features/geometries/fixed/MapGeometries.tsx`:
- Around line 42-50: The MapGeometries render currently calls JSON.parse(style)
directly (inside the GeoJSON element) which will throw on malformed input and
also uses an unsafe type cast; update MapGeometries to safely parse the optional
style string per row by wrapping JSON.parse in try/catch and returning undefined
on error, remove any "as PathOptions" casting, and optionally memoize the parsed
result (keyed by altinnRowId + style) so parsing isn’t repeated each render;
locate the GeoJSON usage in MapGeometries.tsx and replace the direct
JSON.parse(style) with a guarded parser that returns undefined on failure and
ensures the value passed to the GeoJSON style prop is correctly typed without
unsafe casting.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 9f0df339-78f2-462e-95cf-7b9c3a413c95
⛔ Files ignored due to path filters (1)
yarn.lockis excluded by!**/yarn.lock,!**/*.lock
📒 Files selected for processing (5)
src/layout/Map/config.tssrc/layout/Map/features/geometries/fixed/MapGeometries.tsxsrc/layout/Map/features/geometries/fixed/hooks.tssrc/layout/Map/index.tsxsrc/layout/Map/types.ts
|
/publish |
PR release:
|





Description
Related Issue(s)
Verification/QA
kind/*andbackport*label to this PR for proper release notes groupingSummary by CodeRabbit