From 7d972d925798d8b4f64e1e84b8e299df1e2174c8 Mon Sep 17 00:00:00 2001 From: Nicolas Van Labeke Date: Thu, 26 Oct 2023 21:36:50 +0100 Subject: [PATCH] fix(17144): refactor table and panel not to show undefined information --- .../EventLog/components/panel/EventDrawer.tsx | 39 ++++++++++++------- .../components/table/EventLogTable.tsx | 4 +- 2 files changed, 26 insertions(+), 17 deletions(-) diff --git a/hivemq-edge/src/frontend/src/modules/EventLog/components/panel/EventDrawer.tsx b/hivemq-edge/src/frontend/src/modules/EventLog/components/panel/EventDrawer.tsx index 0dea3ac1b3..37fe7c7447 100644 --- a/hivemq-edge/src/frontend/src/modules/EventLog/components/panel/EventDrawer.tsx +++ b/hivemq-edge/src/frontend/src/modules/EventLog/components/panel/EventDrawer.tsx @@ -88,21 +88,30 @@ const EventDrawer: FC = ({ event, isOpen, onClose }) => { {event.message} - - - {t('eventLog.table.header.payload')} - - {event.payload?.contentType} - - - - - {JSONFormat && JSONFormat} - {XMLFormat && XMLFormat} - {!isJSON && !isXML && event.payload?.content} - - - + {event.payload && ( + + + {t('eventLog.table.header.payload')} + + {event.payload?.contentType} + + + + + {JSONFormat && JSONFormat} + {XMLFormat && XMLFormat} + {!isJSON && !isXML && event.payload?.content} + + + + )} diff --git a/hivemq-edge/src/frontend/src/modules/EventLog/components/table/EventLogTable.tsx b/hivemq-edge/src/frontend/src/modules/EventLog/components/table/EventLogTable.tsx index e3df3f4686..cd0c708e8e 100644 --- a/hivemq-edge/src/frontend/src/modules/EventLog/components/table/EventLogTable.tsx +++ b/hivemq-edge/src/frontend/src/modules/EventLog/components/table/EventLogTable.tsx @@ -37,7 +37,7 @@ const EventLogTable: FC = ({ onOpen }) => { cell: (info) => { return ( - + {info.row.original.payload ? ( = ({ onOpen }) => { aria-label={t('eventLog.table.cta.open')} icon={} /> - + ) : null} ) },