fix: Die Logik für die Alarmanzeige wurde angepasst: Jetzt wird das Alarm-Icon nur angezeigt, wenn ein aktiver Alarm existiert und für diesen auch ein passender Link im StaticDistrict vorhanden ist – unabhängig von der Reihenfolge. Damit wird der Bug behoben, dass das Icon manchmal nicht erscheint, obwohl ein Alarm mit Link existiert.
This commit is contained in:
@@ -23,4 +23,4 @@ NEXT_PUBLIC_USE_MOCKS=true
|
||||
# z.B. http://10.10.0.13/xyz/index.aspx -> basePath in config.json auf /xyz setzen
|
||||
# basePath wird jetzt in public/config.json gepflegt
|
||||
# App-Versionsnummer
|
||||
NEXT_PUBLIC_APP_VERSION=1.1.393
|
||||
NEXT_PUBLIC_APP_VERSION=1.1.394
|
||||
|
||||
@@ -24,4 +24,4 @@ NEXT_PUBLIC_USE_MOCKS=false
|
||||
# basePath wird jetzt in public/config.json gepflegt
|
||||
|
||||
# App-Versionsnummer
|
||||
NEXT_PUBLIC_APP_VERSION=1.1.393
|
||||
NEXT_PUBLIC_APP_VERSION=1.1.394
|
||||
|
||||
@@ -152,27 +152,29 @@ const MapComponent = ({ locations, onLocationUpdate, lineCoordinates }) => {
|
||||
let alarmLink = "";
|
||||
let alarmText = "";
|
||||
let alarmIdLD = null;
|
||||
// Hilfsfunktion: alle aktiven Alarme sammeln
|
||||
let alarmList = [];
|
||||
if (Array.isArray(gisStationsStatusDistrict)) {
|
||||
const alarmObj = gisStationsStatusDistrict.find(item => item?.Alarm === 1);
|
||||
hasActiveAlarm = !!alarmObj;
|
||||
alarmIdLD = alarmObj?.IdLD;
|
||||
alarmText = alarmObj?.Me || "Alarm aktiv";
|
||||
alarmList = gisStationsStatusDistrict.filter(item => item?.Alarm === 1);
|
||||
} else if (gisStationsStatusDistrict?.Statis) {
|
||||
const alarmObj = gisStationsStatusDistrict.Statis.find(item => item?.Alarm === 1);
|
||||
hasActiveAlarm = !!alarmObj;
|
||||
alarmIdLD = alarmObj?.IdLD;
|
||||
alarmText = alarmObj?.Me || "Alarm aktiv";
|
||||
alarmList = gisStationsStatusDistrict.Statis.filter(item => item?.Alarm === 1);
|
||||
}
|
||||
if (hasActiveAlarm && alarmIdLD) {
|
||||
const staticObj = pointsArr.find(p => p.IdLD === alarmIdLD);
|
||||
// Suche das erste Alarmobjekt, das auch einen Link im StaticDistrict hat
|
||||
let found = false;
|
||||
for (let i = 0; i < alarmList.length; i++) {
|
||||
const alarmObj = alarmList[i];
|
||||
const staticObj = pointsArr.find(p => p.IdLD === alarmObj.IdLD);
|
||||
if (staticObj && staticObj.Link) {
|
||||
// Link kann relativ sein, ggf. mit Host ergänzen
|
||||
hasActiveAlarm = true;
|
||||
alarmIdLD = alarmObj.IdLD;
|
||||
alarmText = alarmObj.Me || "Alarm aktiv";
|
||||
const isAbsolute =
|
||||
staticObj.Link.startsWith("http://") || staticObj.Link.startsWith("https://");
|
||||
alarmLink = isAbsolute
|
||||
? staticObj.Link
|
||||
: // : `${window.location.origin}/talas5/devices/${staticObj.Link}`;
|
||||
`http://10.10.0.13/talas5/devices/${staticObj.Link}`; // nur zum Testen
|
||||
: `http://10.10.0.13/talas5/devices/${staticObj.Link}`;
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
const poiIconsData = useSelector(selectPoiIconsData);
|
||||
|
||||
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "nodemap",
|
||||
"version": "1.1.393",
|
||||
"version": "1.1.394",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "nodemap",
|
||||
"version": "1.1.393",
|
||||
"version": "1.1.394",
|
||||
"dependencies": {
|
||||
"@emotion/react": "^11.13.3",
|
||||
"@emotion/styled": "^11.13.0",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "nodemap",
|
||||
"version": "1.1.393",
|
||||
"version": "1.1.394",
|
||||
"dependencies": {
|
||||
"@emotion/react": "^11.13.3",
|
||||
"@emotion/styled": "^11.13.0",
|
||||
|
||||
@@ -327,7 +327,7 @@
|
||||
"Me": "KÜG 01: Isolationsminderung kommend",
|
||||
"Feld": 4,
|
||||
"Icon": 0,
|
||||
"Alarm": 0
|
||||
"Alarm": 1
|
||||
},
|
||||
{
|
||||
"IdLD": 50977,
|
||||
@@ -387,7 +387,7 @@
|
||||
"Me": "KÜG 02: Isolationsminderung kommend",
|
||||
"Feld": 4,
|
||||
"Icon": 0,
|
||||
"Alarm": 0
|
||||
"Alarm": 1
|
||||
},
|
||||
{
|
||||
"IdLD": 50975,
|
||||
|
||||
Reference in New Issue
Block a user