feat: Geräteauswahl und Anzeige beim POI-Handling auf WebService umgestellt

- setupPOIs.js angepasst: Gerätedaten (LD_Name) aus GisStationsStaticDistrict verwendet
- MapComponent.js übergibt WebService-Geräte (`Points`) als gisDevices an setupPOIs
- PoiUpdateModal.js nutzt LD_Name für react-select Dropdown statt name aus DB
- Dropdown-Anzeige und Tooltip-Daten für POIs nun konsistent mit WebService-Geräteliste
This commit is contained in:
Ismail Ali
2025-06-10 17:55:36 +02:00
parent 004af608fc
commit 8e5dac82b5
11 changed files with 141 additions and 84 deletions

View File

@@ -10,7 +10,7 @@ import { fetchPoiIconsDataThunk } from "../../redux/thunks/database/pois/fetchPo
const AddPOIModal = ({ onClose, map, latlng }) => {
const dispatch = useDispatch();
const [selectedDeviceId, setSelectedDeviceId] = useState("");
const poiTypData = useSelector(state => state.poiTypes.data);
const status = useSelector(state => state.addPoi.status);
const error = useSelector(state => state.addPoi.error);
@@ -49,7 +49,7 @@ const AddPOIModal = ({ onClose, map, latlng }) => {
poiTypeId: Number(poiTypeId),
latitude,
longitude,
idLD: locationDeviceData.find(device => device.LD_Name === deviceName)?.IdLD,
idLD: Number(selectedDeviceId),
};
try {
@@ -110,14 +110,14 @@ const AddPOIModal = ({ onClose, map, latlng }) => {
<select
id="deviceName"
name="deviceName"
value={deviceName}
onChange={e => setDeviceName(e.target.value)}
value={selectedDeviceId}
onChange={e => setSelectedDeviceId(e.target.value)}
className="block p-2 w-full border-2 border-gray-200 rounded-md text-sm"
>
<option value="">-- Gerät auswählen --</option>
{locationDeviceData.map((device, index) => (
<option key={device?.IdLD || index} value={device?.LD_Name}>
{device?.LD_Name || "Unbekanntes Gerät"}
{locationDeviceData.map(device => (
<option key={device?.IdLD} value={device?.IdLD}>
{device?.LD_Name}
</option>
))}
</select>