Skip to content

Commit

Permalink
fix(17144): refactor table and panel not to show undefined information
Browse files Browse the repository at this point in the history
  • Loading branch information
vanch3d committed Oct 26, 2023
1 parent 96e53e6 commit 7d972d9
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,21 +88,30 @@ const EventDrawer: FC<BridgeMainDrawerProps> = ({ event, isOpen, onClose }) => {
<CardBody data-testid={'event-value-message'}>{event.message}</CardBody>
</Card>

<Card w={'100%'}>
<CardHeader data-testid={'event-title-payload'}>
{t('eventLog.table.header.payload')}
<Badge variant="outline" mx={2}>
{event.payload?.contentType}
</Badge>
</CardHeader>
<CardBody>
<Code w={'100%'} p={2} whiteSpace={'pre-wrap'}>
{JSONFormat && JSONFormat}
{XMLFormat && XMLFormat}
{!isJSON && !isXML && event.payload?.content}
</Code>
</CardBody>
</Card>
{event.payload && (
<Card w={'100%'}>
<CardHeader data-testid={'event-title-payload'}>
{t('eventLog.table.header.payload')}
<Badge variant="outline" mx={2}>
{event.payload?.contentType}
</Badge>
</CardHeader>
<CardBody pt={0}>
<Code
w={'100%'}
p={2}
whiteSpace={'pre-wrap'}
overflow={'auto'}
sx={{ textWrap: 'nowrap' }}
maxH={400}
>
{JSONFormat && JSONFormat}
{XMLFormat && XMLFormat}
{!isJSON && !isXML && event.payload?.content}
</Code>
</CardBody>
</Card>
)}
</VStack>
</DrawerBody>
</DrawerContent>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ const EventLogTable: FC<EventLogTableProps> = ({ onOpen }) => {
cell: (info) => {
return (
<Skeleton isLoaded={!isLoading}>
<Box whiteSpace={'nowrap'}>
{info.row.original.payload ? (
<IconButton
size={'sm'}
mr={2}
onClick={() => onOpen(info.row.original)}
aria-label={t('eventLog.table.cta.open')}
icon={<MdOutlineEventNote />}
/>
</Box>
) : null}
</Skeleton>
)
},
Expand Down

0 comments on commit 7d972d9

Please sign in to comment.