fix: POIs können per Drag und Drop verschoben werden auf die Map
This commit is contained in:
@@ -147,8 +147,9 @@ const MapComponent = ({ locations, onLocationUpdate, lineCoordinates }) => {
|
||||
useEffect(() => {
|
||||
fetchUserRights().then(() => {
|
||||
setIsRightsLoaded(true);
|
||||
console.log("Benutzerrechte in useEffect in MapComponent:", userRights);
|
||||
});
|
||||
}, []); // Lade die Berechtigungen beim Initialisieren der Komponente
|
||||
}, [urls.SERVER_URL]); // Lade die Berechtigungen beim Initialisieren der Komponente
|
||||
|
||||
const [showVersionInfoModal, setShowVersionInfoModal] = useState(false);
|
||||
const zoomTrigger = useRecoilValue(zoomTriggerState);
|
||||
@@ -557,14 +558,21 @@ const MapComponent = ({ locations, onLocationUpdate, lineCoordinates }) => {
|
||||
fetchUserRights();
|
||||
}, []); */
|
||||
useEffect(() => {
|
||||
if (serverURL) {
|
||||
fetchUserRights(serverURL).then((rights) => {
|
||||
setUserRights(rights);
|
||||
setIsRightsLoaded(true);
|
||||
setHasRights(rights && rights.includes(56)); // Prüfen, ob Benutzer die Rechte hat
|
||||
});
|
||||
}
|
||||
}, [serverURL]); // Läuft, wenn serverURL sich ändert
|
||||
console.log(
|
||||
"Server URL ist verfügbar:",
|
||||
config.url.origin,
|
||||
"idMap:",
|
||||
config.idMap,
|
||||
"idUser:",
|
||||
config.idUser
|
||||
);
|
||||
fetchUserRights().then((rights) => {
|
||||
console.log("Benutzerrechte in server URL:", rights);
|
||||
setUserRights(rights);
|
||||
setIsRightsLoaded(true);
|
||||
setHasRights(rights && rights.includes(56)); // Prüfen, ob Benutzer die Rechte hat
|
||||
});
|
||||
}, [urls.SERVER_URL]); // Läuft, wenn serverURL sich ändert
|
||||
|
||||
// Anzeigen von Modals basierend auf Benutzerrechten
|
||||
useEffect(() => {
|
||||
@@ -1047,7 +1055,15 @@ const MapComponent = ({ locations, onLocationUpdate, lineCoordinates }) => {
|
||||
{
|
||||
text: "POI Bearbeiten",
|
||||
icon: "/img/poi-edit.png",
|
||||
callback: () => handleEditPoi(marker),
|
||||
callback: () =>
|
||||
handleEditPoi(
|
||||
marker,
|
||||
userRights,
|
||||
setCurrentPoiData,
|
||||
setShowPoiUpdateModal,
|
||||
fetchPoiData,
|
||||
toast
|
||||
),
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user