Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import ChangesTable, { Change } from '../../../../components/common/table/Change
import Loader from '../../../../components/Loader';
import useAuth from '../../../../utils/hooks/useAuth';
import { HistoryDrawerQuery } from './__generated__/HistoryDrawerQuery.graphql';
import MarkdownDisplay from '../../../../components/MarkdownDisplay';

interface HistoryDrawerProps {
open: boolean;
Expand Down Expand Up @@ -58,7 +59,11 @@ const HistoryDrawerContent: FunctionComponent<HistoryDrawerContentProps> = ({ lo
<Alert
content={(
<>
<strong>{data?.log?.user?.name}</strong> {data?.log?.context_data?.message ?? ''}
<MarkdownDisplay
content={data?.log?.context_data?.message ?? ''}
remarkGfmPlugin={true}
commonmark={true}
/>
</>
)}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,11 @@ const StixCoreObjectHistoryLine = ({ node, isRelation }) => {
</div>
<Tooltip sx={{ maxWidth: '80%', lineHeight: 2, padding: 10 }} title={<><b>{data.user?.name}</b> {data.context_data.message}</>}>
<div style={{ height: '100%', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }}>
<b>{data.user?.name}</b> {data.context_data.message}
<MarkdownDisplay
content={`\`${data.user?.name}\` ${data.context_data.message}`}
remarkGfmPlugin={true}
commonmark={true}
/>
</div>
</Tooltip>
{hasExternalRefs && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { useFormatter } from '../../../../../components/i18n';
import { useGenerateAuditMessage } from '../../../../../utils/history';
import useAuth from '../../../../../utils/hooks/useAuth';
import { AuditDrawerQuery } from './__generated__/AuditDrawerQuery.graphql';
import MarkdownDisplay from '../../../../../components/MarkdownDisplay';

interface AuditDrawerProps {
open: boolean;
Expand Down Expand Up @@ -77,7 +78,13 @@ const AuditDrawerContent: FunctionComponent<{ logId: string }> = ({ logId }) =>
<Alert
content={(
<>
<strong>{data?.audit?.user?.name}</strong> {message}
<div>
<MarkdownDisplay
content={`\`${data?.audit?.user?.name}\` ${message}`}
remarkGfmPlugin={true}
commonmark={true}
/>
</div>
</>
)}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { useGenerateAuditMessage } from '../../../../../utils/history';
import { HandleAddFilter } from '../../../../../utils/hooks/useLocalStorage';
import AuditDrawer from './AuditDrawer';
import { EMPTY_VALUE } from '../../../../../utils/String';
import MarkdownDisplay from '../../../../../components/MarkdownDisplay';

// Deprecated - https://mui.com/system/styles/basics/
// Do not use it for new code.
Expand Down Expand Up @@ -135,7 +136,11 @@ export const AuditLine: FunctionComponent<AuditLineProps> = ({
style={{ width: dataColumns.message.width }}
>
<span style={{ color }}>
<b>{data.user?.name}</b> {message}
<MarkdownDisplay
content={`\`${data.user?.name}\` ${message}`}
remarkGfmPlugin={true}
commonmark={true}
/>
</span>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ test('Incident Response Creation', { tag: ['@ce'] }, async ({ page }) => {
const updateDate = incidentResponseDetailsPage.getTextForHeading('Modification date', now);
await expect(updateDate).toBeVisible();

const historyDescription = cardPage.getTextInCard('Most recent history', `creates a Case-Incident \`${incidentResponseName}\``);
const historyDescription = cardPage.getTextInCard('Most recent history', `creates a Case-Incident ${incidentResponseName}`);
await expect(historyDescription).toBeVisible();
const historyDate = cardPage.getTextInCard('Most recent history', format(new Date(), 'MMM d, yyyy'));
await expect(historyDate).toBeVisible();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ test('Report CRUD', { tag: ['@report', '@knowledge', '@mutation', '@ce'] }, asyn
const updateDate = reportDetailsPage.getTextForHeading('Modification date', now);
await expect(updateDate).toBeVisible();

const historyDescription = reportDetailsPage.getTextForCard('Most recent history', `creates a Report \`${reportName}\``);
const historyDescription = reportDetailsPage.getTextForCard('Most recent history', `creates a Report ${reportName}`);
await expect(historyDescription).toBeVisible();
const historyDate = reportDetailsPage.getTextForCard('Most recent history', format(new Date(), 'MMM d, yyyy'));
await expect(historyDate).toBeVisible();
Expand Down
Loading