fix POI hinzufügen nach 10 Versuche hat immer noch funktioniert!
This commit is contained in:
@@ -104,9 +104,9 @@ const MapComponent = ({ locations, onLocationUpdate, lineCoordinates }) => {
|
||||
fetchPriorityConfig();
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
/* useEffect(() => {
|
||||
console.log("Aktualisierte Prioritätskonfiguration:", priorityConfig);
|
||||
}, [priorityConfig]);
|
||||
}, [priorityConfig]); */
|
||||
//---------------------------------------------------------------------
|
||||
|
||||
useEffect(() => {
|
||||
@@ -143,12 +143,12 @@ const MapComponent = ({ locations, onLocationUpdate, lineCoordinates }) => {
|
||||
setMapId(params.get("m"));
|
||||
setUserId(params.get("u"));
|
||||
}, [setMapId, setUserId]);
|
||||
useEffect(() => {
|
||||
/* useEffect(() => {
|
||||
fetchUserRights().then(() => {
|
||||
setIsRightsLoaded(true);
|
||||
console.log("Benutzerrechte in useEffect in MapComponent:", userRights);
|
||||
});
|
||||
}, [urls.SERVER_URL]); // 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);
|
||||
@@ -369,11 +369,11 @@ const MapComponent = ({ locations, onLocationUpdate, lineCoordinates }) => {
|
||||
useEffect(() => {
|
||||
const fetchAndSetUserRights = async () => {
|
||||
const rights = await fetchUserRights();
|
||||
console.log("Benutzerrechte in server URL:", rights);
|
||||
//console.log("Benutzerrechte in server URL:", rights);
|
||||
setUserRights(rights);
|
||||
setIsRightsLoaded(true);
|
||||
setHasRights(rights && rights.includes(56)); // Prüfen, ob Benutzer die Rechte hat
|
||||
console.log("Benutzerrechte in useEffect in MapComponent:", rights);
|
||||
//console.log("Benutzerrechte in useEffect in MapComponent:", rights);
|
||||
};
|
||||
|
||||
fetchAndSetUserRights();
|
||||
@@ -632,7 +632,7 @@ const MapComponent = ({ locations, onLocationUpdate, lineCoordinates }) => {
|
||||
/* useEffect(() => {
|
||||
fetchUserRights();
|
||||
}, []); */
|
||||
useEffect(() => {
|
||||
/* useEffect(() => {
|
||||
console.log(
|
||||
"Server URL ist verfügbar:",
|
||||
config.url.origin,
|
||||
@@ -642,13 +642,13 @@ const MapComponent = ({ locations, onLocationUpdate, lineCoordinates }) => {
|
||||
config.idUser
|
||||
);
|
||||
fetchUserRights().then((rights) => {
|
||||
console.log("Benutzerrechte in server URL:", rights);
|
||||
// console.log("Benutzerrechte in server URL:", rights);
|
||||
setUserRights(rights);
|
||||
setIsRightsLoaded(true);
|
||||
setHasRights(rights && rights.includes(56)); // Prüfen, ob Benutzer die Rechte hat
|
||||
console.log("Benutzerrechte in useEffect in MapComponent:", hasRights);
|
||||
});
|
||||
}, []);
|
||||
}, []); */
|
||||
|
||||
// Anzeigen von Modals basierend auf Benutzerrechten
|
||||
useEffect(() => {
|
||||
@@ -2062,7 +2062,7 @@ const MapComponent = ({ locations, onLocationUpdate, lineCoordinates }) => {
|
||||
);
|
||||
if (matchingLine) {
|
||||
colorsByModule[matchingLine.idModul] = stat.PrioColor;
|
||||
console.log("Übereinstimmung gefunden für: ", stat);
|
||||
//console.log("Übereinstimmung gefunden für: ", stat);
|
||||
setLinesData(matchingLine);
|
||||
}
|
||||
});
|
||||
@@ -2075,10 +2075,10 @@ const MapComponent = ({ locations, onLocationUpdate, lineCoordinates }) => {
|
||||
fetchData();
|
||||
}, []);
|
||||
//---------------------------------------------------------
|
||||
useEffect(() => {
|
||||
/* useEffect(() => {
|
||||
console.log("lineStatusData", lineStatusData);
|
||||
console.log("lineData:", linesData);
|
||||
}, [lineStatusData, linesData]);
|
||||
}, [lineStatusData, linesData]); */
|
||||
//---------------------------------------------------------
|
||||
const [newPoint, setNewPoint] = useState(null);
|
||||
const [newCoords, setNewCoords] = useState(null);
|
||||
|
||||
@@ -119,7 +119,7 @@ export const fetchUserRights = async () => {
|
||||
}
|
||||
|
||||
const data = await response.json();
|
||||
console.log("Benutzerrechte in fetchRights:", data);
|
||||
// console.log("Benutzerrechte in fetchRights:", data);
|
||||
|
||||
// Überprüfen der Struktur der Antwort
|
||||
if (!data || !data.Rights || !Array.isArray(data.Rights)) {
|
||||
@@ -127,13 +127,13 @@ export const fetchUserRights = async () => {
|
||||
}
|
||||
|
||||
const rightsArray = data.Rights; // Nehmen an, dass 'Rights' das Array von Rechten ist
|
||||
console.log("rightsArray in apiService:", rightsArray);
|
||||
//console.log("rightsArray in apiService:", rightsArray);
|
||||
|
||||
// Speichert die IDs der Rechte in einem Array
|
||||
const userRightsIds = rightsArray.map((right) => right.IdRight);
|
||||
|
||||
// Wenn alles gut geht, logge die erfolgreichen Abschluss
|
||||
console.log("Benutzerrechte erfolgreich abgerufen:", userRightsIds);
|
||||
// console.log("Benutzerrechte erfolgreich abgerufen:", userRightsIds);
|
||||
return userRightsIds;
|
||||
} catch (error) {
|
||||
console.error("Fehler beim Abrufen der Benutzerrechte", error);
|
||||
|
||||
Reference in New Issue
Block a user