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
|
# 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
|
# basePath wird jetzt in public/config.json gepflegt
|
||||||
# App-Versionsnummer
|
# 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
|
# basePath wird jetzt in public/config.json gepflegt
|
||||||
|
|
||||||
# App-Versionsnummer
|
# 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 alarmLink = "";
|
||||||
let alarmText = "";
|
let alarmText = "";
|
||||||
let alarmIdLD = null;
|
let alarmIdLD = null;
|
||||||
|
// Hilfsfunktion: alle aktiven Alarme sammeln
|
||||||
|
let alarmList = [];
|
||||||
if (Array.isArray(gisStationsStatusDistrict)) {
|
if (Array.isArray(gisStationsStatusDistrict)) {
|
||||||
const alarmObj = gisStationsStatusDistrict.find(item => item?.Alarm === 1);
|
alarmList = gisStationsStatusDistrict.filter(item => item?.Alarm === 1);
|
||||||
hasActiveAlarm = !!alarmObj;
|
|
||||||
alarmIdLD = alarmObj?.IdLD;
|
|
||||||
alarmText = alarmObj?.Me || "Alarm aktiv";
|
|
||||||
} else if (gisStationsStatusDistrict?.Statis) {
|
} else if (gisStationsStatusDistrict?.Statis) {
|
||||||
const alarmObj = gisStationsStatusDistrict.Statis.find(item => item?.Alarm === 1);
|
alarmList = gisStationsStatusDistrict.Statis.filter(item => item?.Alarm === 1);
|
||||||
hasActiveAlarm = !!alarmObj;
|
|
||||||
alarmIdLD = alarmObj?.IdLD;
|
|
||||||
alarmText = alarmObj?.Me || "Alarm aktiv";
|
|
||||||
}
|
}
|
||||||
if (hasActiveAlarm && alarmIdLD) {
|
// Suche das erste Alarmobjekt, das auch einen Link im StaticDistrict hat
|
||||||
const staticObj = pointsArr.find(p => p.IdLD === alarmIdLD);
|
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) {
|
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 =
|
const isAbsolute =
|
||||||
staticObj.Link.startsWith("http://") || staticObj.Link.startsWith("https://");
|
staticObj.Link.startsWith("http://") || staticObj.Link.startsWith("https://");
|
||||||
alarmLink = isAbsolute
|
alarmLink = isAbsolute
|
||||||
? staticObj.Link
|
? staticObj.Link
|
||||||
: // : `${window.location.origin}/talas5/devices/${staticObj.Link}`;
|
: `http://10.10.0.13/talas5/devices/${staticObj.Link}`;
|
||||||
`http://10.10.0.13/talas5/devices/${staticObj.Link}`; // nur zum Testen
|
found = true;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const poiIconsData = useSelector(selectPoiIconsData);
|
const poiIconsData = useSelector(selectPoiIconsData);
|
||||||
|
|||||||
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "nodemap",
|
"name": "nodemap",
|
||||||
"version": "1.1.393",
|
"version": "1.1.394",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "nodemap",
|
"name": "nodemap",
|
||||||
"version": "1.1.393",
|
"version": "1.1.394",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@emotion/react": "^11.13.3",
|
"@emotion/react": "^11.13.3",
|
||||||
"@emotion/styled": "^11.13.0",
|
"@emotion/styled": "^11.13.0",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "nodemap",
|
"name": "nodemap",
|
||||||
"version": "1.1.393",
|
"version": "1.1.394",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@emotion/react": "^11.13.3",
|
"@emotion/react": "^11.13.3",
|
||||||
"@emotion/styled": "^11.13.0",
|
"@emotion/styled": "^11.13.0",
|
||||||
|
|||||||
@@ -327,7 +327,7 @@
|
|||||||
"Me": "KÜG 01: Isolationsminderung kommend",
|
"Me": "KÜG 01: Isolationsminderung kommend",
|
||||||
"Feld": 4,
|
"Feld": 4,
|
||||||
"Icon": 0,
|
"Icon": 0,
|
||||||
"Alarm": 0
|
"Alarm": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"IdLD": 50977,
|
"IdLD": 50977,
|
||||||
@@ -387,7 +387,7 @@
|
|||||||
"Me": "KÜG 02: Isolationsminderung kommend",
|
"Me": "KÜG 02: Isolationsminderung kommend",
|
||||||
"Feld": 4,
|
"Feld": 4,
|
||||||
"Icon": 0,
|
"Icon": 0,
|
||||||
"Alarm": 0
|
"Alarm": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"IdLD": 50975,
|
"IdLD": 50975,
|
||||||
|
|||||||
Reference in New Issue
Block a user