Skip to content

Commit

Permalink
[frontend] Remove links from Notifications (#6657)
Browse files Browse the repository at this point in the history
Co-authored-by: Landry Trebon <[email protected]>
  • Loading branch information
Kedae and lndrtrbn authored Oct 8, 2024
1 parent 4d2c170 commit ae45222
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ import MarkdownDisplay from './MarkdownDisplay';
interface ExpandableMarkdownProps {
source?: string | null;
limit: number;
removeLinks?: boolean;
}

const ExpandableMarkdown: FunctionComponent<ExpandableMarkdownProps> = ({
source,
limit,
removeLinks = false,
}) => {
const [expand, setExpand] = useState(false);
const onClick = () => setExpand(!expand);
Expand All @@ -30,6 +32,7 @@ const ExpandableMarkdown: FunctionComponent<ExpandableMarkdownProps> = ({
content={expand ? emptyFilled(source) : truncate(source, limit)}
remarkGfmPlugin={true}
commonmark={true}
removeLinks={removeLinks}
/>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ const IndicatorDetailsComponent: FunctionComponent<IndicatorDetailsComponentProp
>
{t_i18n('Description')}
</Typography>
<ExpandableMarkdown source={indicator.description} limit={400} />
<ExpandableMarkdown source={indicator.description} limit={400} removeLinks />
<Typography
variant="h3"
gutterBottom={true}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ NotificationLineProps
{events.length > 1 ? (
<i>{t_i18n('Digest with multiple notifiers')}</i>
) : (
<MarkdownDisplay content={firstEvent?.message ?? '-'} remarkGfmPlugin={true} commonmark={true}/>
<MarkdownDisplay content={firstEvent?.message ?? '-'} remarkGfmPlugin commonmark removeLinks/>
)}
</div>
<div className={classes.bodyItem} style={{ width: dataColumns.created.width }}>
Expand Down

0 comments on commit ae45222

Please sign in to comment.