Project NOMAD is an offline-first knowledge and education server. Wikipedia, thousands of books, courses, maps, and optional local AI, all running on hardware you own with no internet required.
TypeScript
fix(Maps): render notes in marker popup when populated
Chris Sherwoodf41027ca399b
diff --git a/admin/inertia/components/maps/MapComponent.tsx b/admin/inertia/components/maps/MapComponent.tsxindex 07fe1c65..f7a3a8ad 100644--- a/admin/inertia/components/maps/MapComponent.tsx+++ b/admin/inertia/components/maps/MapComponent.tsx@@ -243,6 +243,11 @@ export default function MapComponent({closeOnClick={false}><div className="text-sm font-medium">{selectedMarker.name}</div>+ {selectedMarker.notes && selectedMarker.notes.trim() && (+ <div className="mt-1 text-xs text-desert-stone-dark whitespace-pre-wrap break-words max-w-[240px]">+ {selectedMarker.notes}+ </div>+ )}</Popup>)}diff --git a/admin/inertia/hooks/useMapMarkers.ts b/admin/inertia/hooks/useMapMarkers.tsindex ba999ebb..a0e818e5 100644--- a/admin/inertia/hooks/useMapMarkers.ts+++ b/admin/inertia/hooks/useMapMarkers.ts@@ -18,6 +18,7 @@ export interface MapMarker {longitude: numberlatitude: numbercolor: PinColorId+ notes: string | nullcreatedAt: string}@@ -36,6 +37,7 @@ export function useMapMarkers() {longitude: m.longitude,latitude: m.latitude,color: m.color as PinColorId,+ notes: m.notes ?? null,createdAt: m.created_at,})))@@ -54,6 +56,7 @@ export function useMapMarkers() {longitude: result.longitude,latitude: result.latitude,color: result.color as PinColorId,+ notes: result.notes ?? null,createdAt: result.created_at,}setMarkers((prev) => [...prev, marker])diff --git a/admin/inertia/lib/api.ts b/admin/inertia/lib/api.tsindex 3e015d84..aa1369b7 100644--- a/admin/inertia/lib/api.ts+++ b/admin/inertia/lib/api.ts@@ -631,7 +631,7 @@ class API {async listMapMarkers() {return catchInternal(async () => {const response = await this.client.get<- Array<{ id: number; name: string; longitude: number; latitude: number; color: string; created_at: string }>+ Array<{ id: number; name: string; longitude: number; latitude: number; color: string; notes: string | null; created_at: string }>>('/maps/markers')return response.data})()@@ -640,7 +640,7 @@ class API {async createMapMarker(data: { name: string; longitude: number; latitude: number; color?: string }) {return catchInternal(async () => {const response = await this.client.post<- { id: number; name: string; longitude: number; latitude: number; color: string; created_at: string }+ { id: number; name: string; longitude: number; latitude: number; color: string; notes: string | null; created_at: string }>('/maps/markers', data)return response.data})()