From 284dccb702da32bfb01209dadb84fa8a66d8fbdd Mon Sep 17 00:00:00 2001 From: Mathieu Oriol Date: Mon, 9 Sep 2024 23:11:10 +0200 Subject: [PATCH] front: msg avertissement si zones invalides creees (issue #23) --- traque-front/components/admin/mapPicker.jsx | 29 ++++++++++++------- .../components/admin/zoneSelector.jsx | 4 +-- 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/traque-front/components/admin/mapPicker.jsx b/traque-front/components/admin/mapPicker.jsx index e511c3b..c9d7993 100644 --- a/traque-front/components/admin/mapPicker.jsx +++ b/traque-front/components/admin/mapPicker.jsx @@ -80,17 +80,26 @@ export function ZonePicker({ minZone, setMinZone, maxZone, setMaxZone, editMode, minHover(e); } } + return ( - - - {minCenter && minRadius && } - {maxCenter && maxRadius && } - - - +
+
+ + + {minCenter && minRadius && } + {maxCenter && maxRadius && } + + + +
+ { maxCenter && minCenter && typeof maxCenter.distanceTo === 'function' + && maxRadius + maxCenter.distanceTo(minCenter) >= minRadius + &&

La zone de fin doit être incluse dans celle de départ

} +
+ ) } diff --git a/traque-front/components/admin/zoneSelector.jsx b/traque-front/components/admin/zoneSelector.jsx index 2ef1781..5b00205 100644 --- a/traque-front/components/admin/zoneSelector.jsx +++ b/traque-front/components/admin/zoneSelector.jsx @@ -41,9 +41,7 @@ export function ZoneSelector() {

Edit zones

{editMode == EditMode.MIN && setEditMode(EditMode.MAX)}>Edit end zone} {editMode == EditMode.MAX && setEditMode(EditMode.MIN)}>Edit start zone} -
- -
+

Number of reductions

setReductionCount(e.target.value)}>