diff --git a/frontend/src/component/events/EventDiff/EventDiff.tsx b/frontend/src/component/events/EventDiff/EventDiff.tsx index c0b3c8dfd9..f5bc7bf8fd 100644 --- a/frontend/src/component/events/EventDiff/EventDiff.tsx +++ b/frontend/src/component/events/EventDiff/EventDiff.tsx @@ -23,6 +23,7 @@ interface IEventDiffProps { * @deprecated remove with flag improvedJsonDiff */ sort?: (a: IEventDiffResult, b: IEventDiffResult) => number; + excludeKeys?: string[]; } const DiffStyles = styled('div')(({ theme }) => ({ @@ -37,7 +38,6 @@ const DiffStyles = styled('div')(({ theme }) => ({ position: 'absolute', left: 0, top: 0, - marginLeft: '-10px', }, }, @@ -47,35 +47,65 @@ const DiffStyles = styled('div')(({ theme }) => ({ content: '"+"', }, }, + '.deletion': { color: theme.palette.eventLog.diffSub, '::before': { content: '"-"', }, }, + + '&[data-change-type="replacement"]': { + ':has(.addition)': { + color: theme.palette.eventLog.diffAdd, + }, + ':has(.deletion)': { + color: theme.palette.eventLog.diffSub, + }, + '.addition::before, .deletion::before': { + content: 'none', + }, + }, + + '.diff:not(:has(*))': { + '::before': { + content: '"(no changes)"', + }, + }, })); -const NewEventDiff: FC = ({ entry }) => { +const ButtonIcon = styled('span')(({ theme }) => ({ + marginInlineEnd: theme.spacing(0.5), +})); + +const NewEventDiff: FC = ({ entry, excludeKeys }) => { + const changeType = entry.preData && entry.data ? 'edit' : 'replacement'; + const showExpandButton = changeType === 'edit'; const [full, setFull] = useState(false); const diffId = useId(); return ( <> - - + {showExpandButton ? ( + + ) : null} +