From a51b65fe78ef7fe8db1d0ba4506214da31295aae Mon Sep 17 00:00:00 2001 From: Timo Pollmeier Date: Tue, 24 Oct 2023 15:44:09 +0200 Subject: [PATCH] Fix: Fix handling of missing delta result fields The delta icons for severity, QoD and hostname now handle missing values for the delta result correctly. --- src/web/pages/results/row.js | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/src/web/pages/results/row.js b/src/web/pages/results/row.js index 9be9d5a693..c2b94835bf 100644 --- a/src/web/pages/results/row.js +++ b/src/web/pages/results/row.js @@ -70,8 +70,8 @@ const Row = ({ entity.overrides.filter(override => override.isActive()).length > 0; const hasTickets = entity.tickets.length > 0; const deltaSeverity = entity.delta?.result?.severity; - const deltaHostname = entity.delta?.result?.host.hostname; - const deltaQoD = entity.delta?.result?.qod.value; + const deltaHostname = entity.delta?.result?.host?.hostname; + const deltaQoD = entity.delta?.result?.qod?.value; return ( {delta && ( @@ -105,20 +105,19 @@ const Row = ({ - {isDefined(entity.delta?.result) && - entity.severity !== deltaSeverity && ( - - )} + {isDefined(deltaSeverity) && entity.severity !== deltaSeverity && ( + + )} - {isDefined(entity.delta?.result) && entity.qod.value !== deltaQoD && ( + {isDefined(deltaQoD) && entity.qod.value !== deltaQoD && ( @@ -141,7 +140,7 @@ const Row = ({ {host.hostname.length > 0 && ( {shorten(host.hostname, 40)} )} - {isDefined(entity.delta?.result) && + {isDefined(deltaHostname) && deltaHostname.length > 0 && host.hostname !== deltaHostname && (