Skip to content

Commit

Permalink
Timeline: open event attributes in new window (when signaled)
Browse files Browse the repository at this point in the history
  • Loading branch information
alisman committed Jun 13, 2023
1 parent e9a08df commit 127db7d
Showing 1 changed file with 24 additions and 6 deletions.
30 changes: 24 additions & 6 deletions packages/cbioportal-clinical-timeline/src/TimelineTrack.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -472,21 +472,39 @@ export const EventTooltipContent: React.FunctionComponent<{
<div>
<table className={'table table-condensed'}>
<tbody>
{_.map(attributes, (att: any) => {
{_.map(attributes, (attr: any) => {
return (
<tr>
<td>{att.key.replace(/_/g, ' ')}</td>
<td>{attr.key.replace(/_/g, ' ')}</td>
<td>
<ReactMarkdown
allowedElements={['p', 'a']}
linkTarget={'_blank'}
components={{
a: ({ node, ...props }) => (
<OurPopup {...props} />
),
a: ({ node, ...props }) => {
const text = props.children[0]!.toString();
if (/:blank$/.test(text)) {
/* @ts-ignore */
return (
<a
href={props.href}
target={'_blank'}
>
{text.replace(
/:blank$/,
''
)}
</a>
);
} else {
return (
<OurPopup {...props} />
);
}
},
}}
>
{att.value}
{attr.value}
</ReactMarkdown>
</td>
</tr>
Expand Down

0 comments on commit 127db7d

Please sign in to comment.