feat: transform map-editor markers into Kirby subpages
Some checks failed
Deploy / Build and Deploy to Production (push) Has been cancelled

Major refactoring of the map-editor plugin to store markers as Kirby
subpages instead of YAML data, enabling extensible block content.

Backend Changes:
- Add API routes for marker CRUD operations (GET, POST, PATCH, DELETE)
- Create marker.yml blueprint with content & position tabs
- Add markers section to map.yml blueprint
- Update useMapData to only handle center/zoom/background
- Create useMarkersApi composable for API communication

Frontend Changes:
- Refactor MapEditor.vue to support multi/single modes
- Multi mode: loads markers via API, redirects to Panel for editing
- Single mode: displays single marker for position tab in marker page
- Remove MarkerEditor.vue modal (replaced by Panel editing)
- Normalize position format handling (lon vs lng)

API Features:
- Session-based auth for Panel requests (no CSRF needed)
- Proper error handling and validation
- Markers created as listed pages (not drafts)
- Uses Kirby's data() method for JSON parsing

Documentation:
- Add IMPLEMENTATION_SUMMARY.md with technical details
- Add TESTING_CHECKLIST.md with 38 test cases

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
isUnknown 2026-01-29 14:08:40 +01:00
parent b47195488a
commit 32e8301d91
13 changed files with 1513 additions and 670 deletions

View file

@ -7,10 +7,10 @@ columns:
fields:
type: fields
fields:
tags:
tags:
label: Mots-clés
type: tags
text:
text:
label: Présentation de la carte
type: writer
mapdata:
@ -25,6 +25,3 @@ columns:
files:
label: Fichiers
type: files

View file

@ -0,0 +1,63 @@
title: Marqueur
icon: location
tabs:
content:
label: Contenu
columns:
main:
width: 1/1
sections:
fields:
type: fields
fields:
title:
label: Titre du marqueur
type: text
required: true
content:
label: Contenu
type: blocks
fieldsets:
- heading
- text
- image
- list
- quote
position:
label: Position
columns:
left:
width: 1/3
sections:
coordinates:
type: fields
fields:
latitude:
label: Latitude
type: number
step: 0.000001
min: -90
max: 90
required: true
longitude:
label: Longitude
type: number
step: 0.000001
min: -180
max: 180
required: true
right:
width: 2/3
sections:
map:
type: fields
fields:
mapPreview:
label: Position sur la carte
type: map-editor
mode: single
latitude: "{{ page.latitude }}"
longitude: "{{ page.longitude }}"
help: Déplacez le marqueur ou recherchez une adresse