-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
1,037 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
src/main/webapp/app/pages/somaticGermlineAlterationPage/AlterationTile.module.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
.itemLink a { | ||
justify-content: initial; | ||
} | ||
|
||
.itemHeader { | ||
font-size: 1rem; | ||
color: #878d96; | ||
} | ||
|
||
.alterationTile { | ||
padding: 16px; | ||
padding-bottom: 24px; | ||
min-width: 347px; | ||
max-width: 392px; | ||
gap: 8px; | ||
box-shadow: $default-box-shadow; | ||
border-radius: 8px; | ||
height: 200px; | ||
} | ||
|
||
.alterationTileColumnMerge { | ||
grid-column: 1 / 3; | ||
} | ||
|
||
.alterationTileItems { | ||
gap: 16px; | ||
display: grid; | ||
grid-template-columns: repeat(2, 1fr); | ||
grid-auto-rows: 1fr; | ||
height: 100%; | ||
} |
74 changes: 74 additions & 0 deletions
74
src/main/webapp/app/pages/somaticGermlineAlterationPage/AlterationTile.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
import React from 'react'; | ||
import styles from './AlterationTile.module.scss'; | ||
import classNames from 'classnames'; | ||
import ExternalLinkIcon from 'app/shared/icons/ExternalLinkIcon'; | ||
|
||
type AlterationItemProps = | ||
| { | ||
title: string; | ||
value: JSX.Element | string; | ||
link?: undefined; | ||
} | ||
| { | ||
title: string; | ||
value: string; | ||
link: string; | ||
}; | ||
|
||
function AlterationItem({ | ||
title: itemTitle, | ||
value, | ||
link, | ||
}: AlterationItemProps) { | ||
return ( | ||
<div> | ||
<h4 className={classNames(styles.itemHeader)}>{itemTitle}</h4> | ||
<div> | ||
{typeof value === 'string' ? ( | ||
<div className={classNames('h5')}> | ||
{link ? ( | ||
<div className={classNames(styles.itemLink)}> | ||
<ExternalLinkIcon link={link}>{value}</ExternalLinkIcon> | ||
</div> | ||
) : ( | ||
value | ||
)} | ||
</div> | ||
) : ( | ||
value | ||
)} | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
type AlterationTileProps = { | ||
title: string; | ||
items: (AlterationItemProps | [AlterationItemProps, AlterationItemProps])[]; | ||
}; | ||
|
||
export default function AlterationTile({ | ||
title, | ||
items, | ||
}: AlterationTileProps): JSX.Element { | ||
return ( | ||
<div className={classNames('d-flex', 'flex-column', styles.alterationTile)}> | ||
<h3 className="h6">{title}</h3> | ||
<div className={classNames(styles.alterationTileItems)}> | ||
{items.map((parent, i) => { | ||
if (Array.isArray(parent)) { | ||
return parent.map((child, j) => { | ||
return <AlterationItem key={`${i}:${j}`} {...child} />; | ||
}); | ||
} else { | ||
return ( | ||
<div className={classNames(styles.alterationTileColumnMerge)}> | ||
<AlterationItem key={i} {...parent} /> | ||
</div> | ||
); | ||
} | ||
})} | ||
</div> | ||
</div> | ||
); | ||
} |
59 changes: 59 additions & 0 deletions
59
src/main/webapp/app/pages/somaticGermlineAlterationPage/HighestLevelEvidence.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import React from 'react'; | ||
import { | ||
levelOfEvidence2Level, | ||
OncoKBLevelIcon, | ||
FdaLevelIcon, | ||
} from 'app/shared/utils/Utils'; | ||
|
||
type HighestLevelEvidenceProp = { | ||
type: | ||
| 'Sensitive' | ||
| 'Resistance' | ||
| 'DiagnosticImplication' | ||
| 'PrognosticImplication' | ||
| 'Fda'; | ||
level: string | undefined; | ||
}; | ||
|
||
export default function HighestLevelEvidence({ | ||
type, | ||
level: rawLevel = '', | ||
}: HighestLevelEvidenceProp): JSX.Element { | ||
if (type === 'Sensitive') { | ||
const level = levelOfEvidence2Level(rawLevel, false); | ||
return ( | ||
<OncoKBLevelIcon size="s2" level={level} key="highestSensitiveLevel" /> | ||
); | ||
} | ||
if (type === 'Resistance') { | ||
const level = levelOfEvidence2Level(rawLevel, false); | ||
return ( | ||
<OncoKBLevelIcon size="s2" level={level} key="highestResistanceLevel" /> | ||
); | ||
} | ||
if (type === 'DiagnosticImplication') { | ||
const level = levelOfEvidence2Level(rawLevel, false); | ||
return ( | ||
<OncoKBLevelIcon | ||
size="s2" | ||
level={level} | ||
key={'highestDiagnosticImplicationLevel'} | ||
/> | ||
); | ||
} | ||
if (type === 'PrognosticImplication') { | ||
const level = levelOfEvidence2Level(rawLevel, false); | ||
return ( | ||
<OncoKBLevelIcon | ||
size="s2" | ||
level={level} | ||
key={'highestPrognosticImplicationLevel'} | ||
/> | ||
); | ||
} | ||
if (type === 'Fda') { | ||
const level = levelOfEvidence2Level(rawLevel, false); | ||
return <FdaLevelIcon size="s2" level={level} key={'highestFdaLevel'} />; | ||
} | ||
return <></>; | ||
} |
42 changes: 42 additions & 0 deletions
42
.../webapp/app/pages/somaticGermlineAlterationPage/SomaticGermlineAlterationPage.module.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
.backLink { | ||
gap: 0.5rem; | ||
} | ||
|
||
.header { | ||
margin-bottom: 0.5rem; | ||
} | ||
|
||
.headerContent { | ||
gap: 0.5rem; | ||
} | ||
|
||
.navBarTitle { | ||
.pill { | ||
font-size: 0.85rem; | ||
} | ||
} | ||
|
||
.pill { | ||
font-size: 1rem; | ||
border: #0968c3; | ||
color: #0968c3; | ||
border-style: solid; | ||
border-width: 2px; | ||
border-radius: 56px; | ||
padding: 0px 8px; | ||
background: #f0f5ff; | ||
} | ||
|
||
.alterationTiles { | ||
gap: 8px; | ||
padding: 32px 0px; | ||
align-items: center; | ||
justify-content: center; | ||
flex-direction: row; | ||
display: flex; | ||
flex-wrap: wrap; | ||
} | ||
|
||
.descriptionContainer { | ||
margin-bottom: 1rem; | ||
} |
Oops, something went wrong.