|
@@ -1,5 +1,4 @@
|
|
|
import React from 'react';
|
|
|
-import styled from 'styled-components';
|
|
|
import useDataSaver from 'lib/hooks/useDataSaver';
|
|
|
import { TopicMessage } from 'generated-sources';
|
|
|
import MessageToggleIcon from 'components/common/Icons/MessageToggleIcon';
|
|
@@ -7,22 +6,12 @@ import IconButtonWrapper from 'components/common/Icons/IconButtonWrapper';
|
|
|
import { Dropdown, DropdownItem } from 'components/common/Dropdown';
|
|
|
import { formatTimestamp } from 'lib/dateTimeHelpers';
|
|
|
import { JSONPath } from 'jsonpath-plus';
|
|
|
+import Ellipsis from 'components/common/Ellipsis/Ellipsis';
|
|
|
+import WarningRedIcon from 'components/common/Icons/WarningRedIcon';
|
|
|
|
|
|
import MessageContent from './MessageContent/MessageContent';
|
|
|
import * as S from './MessageContent/MessageContent.styled';
|
|
|
|
|
|
-const StyledDataCell = styled.td`
|
|
|
- overflow: hidden;
|
|
|
- white-space: nowrap;
|
|
|
- text-overflow: ellipsis;
|
|
|
- max-width: 350px;
|
|
|
- min-width: 350px;
|
|
|
-`;
|
|
|
-
|
|
|
-const ClickableRow = styled.tr`
|
|
|
- cursor: pointer;
|
|
|
-`;
|
|
|
-
|
|
|
export interface PreviewFilter {
|
|
|
field: string;
|
|
|
path: string;
|
|
@@ -43,6 +32,8 @@ const Message: React.FC<Props> = ({
|
|
|
partition,
|
|
|
content,
|
|
|
headers,
|
|
|
+ valueSerde,
|
|
|
+ keySerde,
|
|
|
},
|
|
|
keyFilters,
|
|
|
contentFilters,
|
|
@@ -100,7 +91,7 @@ const Message: React.FC<Props> = ({
|
|
|
|
|
|
return (
|
|
|
<>
|
|
|
- <ClickableRow
|
|
|
+ <S.ClickableRow
|
|
|
onMouseEnter={() => setVEllipsisOpen(true)}
|
|
|
onMouseLeave={() => setVEllipsisOpen(false)}
|
|
|
onClick={toggleIsOpen}
|
|
@@ -115,16 +106,20 @@ const Message: React.FC<Props> = ({
|
|
|
<td>
|
|
|
<div>{formatTimestamp(timestamp)}</div>
|
|
|
</td>
|
|
|
- <StyledDataCell title={key}>
|
|
|
- {renderFilteredJson(key, keyFilters)}
|
|
|
- </StyledDataCell>
|
|
|
- <StyledDataCell title={content}>
|
|
|
+ <S.DataCell title={key}>
|
|
|
+ <Ellipsis text={renderFilteredJson(key, keyFilters)}>
|
|
|
+ {keySerde === 'Fallback' && <WarningRedIcon />}
|
|
|
+ </Ellipsis>
|
|
|
+ </S.DataCell>
|
|
|
+ <S.DataCell title={content}>
|
|
|
<S.Metadata>
|
|
|
<S.MetadataValue>
|
|
|
- {renderFilteredJson(content, contentFilters)}
|
|
|
+ <Ellipsis text={renderFilteredJson(content, contentFilters)}>
|
|
|
+ {valueSerde === 'Fallback' && <WarningRedIcon />}
|
|
|
+ </Ellipsis>
|
|
|
</S.MetadataValue>
|
|
|
</S.Metadata>
|
|
|
- </StyledDataCell>
|
|
|
+ </S.DataCell>
|
|
|
<td style={{ width: '5%' }}>
|
|
|
{vEllipsisOpen && (
|
|
|
<Dropdown>
|
|
@@ -135,7 +130,7 @@ const Message: React.FC<Props> = ({
|
|
|
</Dropdown>
|
|
|
)}
|
|
|
</td>
|
|
|
- </ClickableRow>
|
|
|
+ </S.ClickableRow>
|
|
|
{isOpen && (
|
|
|
<MessageContent
|
|
|
messageKey={key}
|