From f900f668c19c51168ccad5afc3fc40b70ec07866 Mon Sep 17 00:00:00 2001 From: John Konecny <24961694+jfkonecn@users.noreply.github.com> Date: Fri, 15 Nov 2024 16:46:20 -0500 Subject: [PATCH] Added new variant page --- src/main/webapp/app/Main.tsx | 12 +- .../app/components/LevelWithDescription.tsx | 2 +- .../webapp/app/components/PageContainer.tsx | 33 +- .../geneticTypeTag/GeneticTypeTag.tsx | 10 +- .../app/components/infoTile/InfoTile.tsx | 52 -- .../app/components/infoTile/LoETile.tsx | 100 --- .../components/infoTile/info-tile.module.scss | 17 - .../components/searchOption/SearchOption.tsx | 17 +- src/main/webapp/app/config/constants.tsx | 4 + .../annotationPage/AnnotatedAlterations.tsx | 1 + .../AnnotationBreadcrumbs.module.scss | 6 + .../annotationPage/AnnotationBreadcrumbs.tsx | 26 +- .../pages/annotationPage/AnnotationPage.tsx | 60 +- .../pages/annotationPage/CancerTypeView.tsx | 46 +- .../SomaticGermlineAlterationView.tsx | 185 +++++ .../SomaticGermlineCancerTypePage.tsx | 730 ++++++++++++++++++ .../webapp/app/pages/genePage/GeneInfo.tsx | 2 +- .../app/pages/genePage/GeneInfoTile.tsx | 89 --- .../genePage/SomaticGermlineGenePage.tsx | 428 +++++----- .../app/pages/newsPage/NewsPageContent.tsx | 3 +- .../HighestLevelEvidence.tsx | 59 ++ .../SomaticGermlineAlterationPage.module.scss | 18 + .../SomaticGermlineAlterationPage.tsx | 706 +++++++++++++++++ .../yearEndSummaryPage/BiomarkerTableData.tsx | 22 +- src/main/webapp/app/routes/AdminRoutes.tsx | 13 +- src/main/webapp/app/routes/routes.tsx | 127 ++- ...omaticGermlineCancerTypeSelect.module.scss | 8 + .../SomaticGermlineCancerTypeSelect.tsx | 167 ++++ .../header/GermlineSomaticHeader.module.scss | 29 + .../shared/header/GermlineSomaticHeader.tsx | 46 ++ .../app/shared/nav/MiniNavBarHeader.tsx | 21 +- .../shared/nav/SomaticGermlineBreadcrumbs.tsx | 60 ++ .../shared/nav/StickyMiniNavBar.module.scss | 12 + .../app/shared/nav/StickyMiniNavBar.tsx | 54 +- .../webapp/app/shared/route/OncokbRoute.tsx | 52 +- .../webapp/app/shared/texts/ShowHideText.tsx | 6 +- .../tiles/SomaticGermlineTiles.module.scss | 86 +++ .../app/shared/tiles/SomaticGermlineTiles.tsx | 116 +++ .../webapp/app/shared/tiles/tile-utils.tsx | 350 +++++++++ src/main/webapp/app/shared/utils/UrlUtils.tsx | 41 +- src/main/webapp/app/shared/utils/Utils.tsx | 11 +- src/main/webapp/app/variables.scss | 6 +- 42 files changed, 3197 insertions(+), 636 deletions(-) delete mode 100644 src/main/webapp/app/components/infoTile/InfoTile.tsx delete mode 100644 src/main/webapp/app/components/infoTile/LoETile.tsx delete mode 100644 src/main/webapp/app/components/infoTile/info-tile.module.scss create mode 100644 src/main/webapp/app/pages/annotationPage/AnnotationBreadcrumbs.module.scss create mode 100644 src/main/webapp/app/pages/annotationPage/SomaticGermlineAlterationView.tsx create mode 100644 src/main/webapp/app/pages/annotationPage/SomaticGermlineCancerTypePage.tsx delete mode 100644 src/main/webapp/app/pages/genePage/GeneInfoTile.tsx create mode 100644 src/main/webapp/app/pages/somaticGermlineAlterationPage/HighestLevelEvidence.tsx create mode 100644 src/main/webapp/app/pages/somaticGermlineAlterationPage/SomaticGermlineAlterationPage.module.scss create mode 100644 src/main/webapp/app/pages/somaticGermlineAlterationPage/SomaticGermlineAlterationPage.tsx create mode 100644 src/main/webapp/app/shared/dropdown/SomaticGermlineCancerTypeSelect.module.scss create mode 100644 src/main/webapp/app/shared/dropdown/SomaticGermlineCancerTypeSelect.tsx create mode 100644 src/main/webapp/app/shared/header/GermlineSomaticHeader.module.scss create mode 100644 src/main/webapp/app/shared/header/GermlineSomaticHeader.tsx create mode 100644 src/main/webapp/app/shared/nav/SomaticGermlineBreadcrumbs.tsx create mode 100644 src/main/webapp/app/shared/tiles/SomaticGermlineTiles.module.scss create mode 100644 src/main/webapp/app/shared/tiles/SomaticGermlineTiles.tsx create mode 100644 src/main/webapp/app/shared/tiles/tile-utils.tsx diff --git a/src/main/webapp/app/Main.tsx b/src/main/webapp/app/Main.tsx index d2339828e..0bbba6412 100644 --- a/src/main/webapp/app/Main.tsx +++ b/src/main/webapp/app/Main.tsx @@ -104,16 +104,12 @@ class Main extends React.Component { routing={this.props.routing} appStore={this.props.appStore} /> - - - + /> = inject('appStore')(props => { diff --git a/src/main/webapp/app/components/PageContainer.tsx b/src/main/webapp/app/components/PageContainer.tsx index 6b52726b4..55034db1f 100644 --- a/src/main/webapp/app/components/PageContainer.tsx +++ b/src/main/webapp/app/components/PageContainer.tsx @@ -1,42 +1,25 @@ import React, { FunctionComponent } from 'react'; import { Col, Row } from 'react-bootstrap'; import WindowStore from 'app/store/WindowStore'; -import { RouterStore } from 'mobx-react-router'; -import { PAGE_ROUTE } from 'app/config/constants'; -import { GENETIC_TYPE } from 'app/components/geneticTypeTabs/GeneticTypeTabs'; -import { parseGenePagePath } from 'app/shared/utils/UrlUtils'; -const Container: FunctionComponent<{ - inGenePage: boolean; -}> = props => { - if (props.inGenePage) { - return
{props.children}
; - } else { - return ( - - {props.children} - - ); - } +const Container: FunctionComponent<{}> = props => { + return ( + + {props.children} + + ); }; const PageContainer: React.FunctionComponent<{ - routing: RouterStore; windowStore: WindowStore; }> = props => { - const genePagePath = parseGenePagePath(props.routing.location.pathname); - const inGenePage = genePagePath.geneticType !== undefined; return (
- {props.children} + {props.children}
); diff --git a/src/main/webapp/app/components/geneticTypeTag/GeneticTypeTag.tsx b/src/main/webapp/app/components/geneticTypeTag/GeneticTypeTag.tsx index f4e38f6a7..e1f5e82f0 100644 --- a/src/main/webapp/app/components/geneticTypeTag/GeneticTypeTag.tsx +++ b/src/main/webapp/app/components/geneticTypeTag/GeneticTypeTag.tsx @@ -5,19 +5,19 @@ import styles from './genetic-type-tag.module.scss'; import { capitalize } from 'cbioportal-frontend-commons'; const GeneticTypeTag: FunctionComponent<{ - geneticType: GENETIC_TYPE; + isGermline: boolean; className?: string; }> = props => { return ( - {capitalize(props.geneticType)} + {capitalize( + props.isGermline ? GENETIC_TYPE.GERMLINE : GENETIC_TYPE.SOMATIC + )} ); }; diff --git a/src/main/webapp/app/components/infoTile/InfoTile.tsx b/src/main/webapp/app/components/infoTile/InfoTile.tsx deleted file mode 100644 index 836a91e4a..000000000 --- a/src/main/webapp/app/components/infoTile/InfoTile.tsx +++ /dev/null @@ -1,52 +0,0 @@ -import React, { CSSProperties } from 'react'; -import styles from './info-tile.module.scss'; -import { COLOR_GREY } from 'app/config/theme'; -import classnames from 'classnames'; - -export type Category = { - title: string; - content?: JSX.Element | string; - className?: string; -}; -export type InfoTile = { - title: string; - categories: Category[]; - className?: string; -}; - -const Category: React.FunctionComponent = props => { - const isNa = props.content === undefined || props.content === null; - const isText = isNa || typeof props.content === 'string'; - const style: CSSProperties = { height: '3rem' }; - if (isText) { - style.fontSize = '1.5rem'; - style.fontFamily = 'Gotham Bold'; - } - return ( -
-
- {props.title} -
-
- {props.content} -
-
- ); -}; - -const InfoTile: React.FunctionComponent = props => { - return props.categories.length > 0 ? ( -
-
{props.title}
-
- {props.categories.map((category, idx) => ( - - ))} -
-
- ) : ( - <> - ); -}; - -export default InfoTile; diff --git a/src/main/webapp/app/components/infoTile/LoETile.tsx b/src/main/webapp/app/components/infoTile/LoETile.tsx deleted file mode 100644 index f38cb77d2..000000000 --- a/src/main/webapp/app/components/infoTile/LoETile.tsx +++ /dev/null @@ -1,100 +0,0 @@ -import React from 'react'; -import InfoTile, { Category } from 'app/components/infoTile/InfoTile'; -import { - FdaLevelIcon, - levelOfEvidence2Level, - OncoKBLevelIcon, -} from 'app/shared/utils/Utils'; - -type LoETile = { - highestSensitiveLevel: string | undefined; - highestResistanceLevel: string | undefined; - highestDiagnosticImplicationLevel?: string | undefined; - highestPrognosticImplicationLevel?: string | undefined; - highestFdaLevel?: string | undefined; - className?: string; -}; - -const LoETile: React.FunctionComponent = props => { - const categories: Category[] = []; - if (props.highestSensitiveLevel || props.highestResistanceLevel) { - categories.push({ - title: 'Therapeutic', - content: ( -
- {props.highestSensitiveLevel && ( - - )} - {props.highestResistanceLevel && ( - - )} -
- ), - }); - } - if (props.highestDiagnosticImplicationLevel) { - categories.push({ - title: 'Diagnostic', - content: ( -
- -
- ), - }); - } - if (props.highestPrognosticImplicationLevel) { - categories.push({ - title: 'Prognostic', - content: ( -
- -
- ), - }); - } - if (props.highestFdaLevel) { - categories.push({ - title: 'FDA', - content: ( -
- -
- ), - }); - } - - return ( - - ); -}; - -export default LoETile; diff --git a/src/main/webapp/app/components/infoTile/info-tile.module.scss b/src/main/webapp/app/components/infoTile/info-tile.module.scss deleted file mode 100644 index aae0e6728..000000000 --- a/src/main/webapp/app/components/infoTile/info-tile.module.scss +++ /dev/null @@ -1,17 +0,0 @@ -@import '../../variables'; - -.tile { - border-radius: 8px; - border: 1px solid $light-grey; - padding: 1rem; - display: inline-block; - box-shadow: $default-box-shadow; -} - -.category:not(:last-child) { - border-right: 1px solid $light-grey; - padding-right: 1rem; -} -.category:not(:first-child) { - padding-left: 1rem; -} diff --git a/src/main/webapp/app/components/searchOption/SearchOption.tsx b/src/main/webapp/app/components/searchOption/SearchOption.tsx index 624e157ff..73c105915 100644 --- a/src/main/webapp/app/components/searchOption/SearchOption.tsx +++ b/src/main/webapp/app/components/searchOption/SearchOption.tsx @@ -1,5 +1,8 @@ import React from 'react'; -import { levelOfEvidence2Level, OncoKBAnnotationIcon } from 'app/shared/utils/Utils'; +import { + levelOfEvidence2Level, + OncoKBAnnotationIcon, +} from 'app/shared/utils/Utils'; import { Else, If, Then } from 'react-if'; import Highlighter from 'react-highlight-words'; import styles from './SearchOption.module.scss'; @@ -50,9 +53,15 @@ const GeneSearchOption: React.FunctionComponent<{ searchWords={[props.search]} textToHighlight={`${props.data.gene.hugoSymbol} (Entrez Gene: ${props.data.gene.entrezGeneId})`} /> - {props.data.annotation && Object.values(GENETIC_TYPE).includes(props.data.annotation.toLowerCase() as GENETIC_TYPE) && ( - - )} + {props.data.annotation && + Object.values(GENETIC_TYPE).includes( + props.data.annotation.toLowerCase() as GENETIC_TYPE + ) && ( + + )} {props.data.highestSensitiveLevel || props.data.highestResistanceLevel ? ( diff --git a/src/main/webapp/app/config/constants.tsx b/src/main/webapp/app/config/constants.tsx index 0400ffd2b..a36583422 100644 --- a/src/main/webapp/app/config/constants.tsx +++ b/src/main/webapp/app/config/constants.tsx @@ -605,6 +605,10 @@ export enum PAGE_ROUTE { SOMATIC_GENE = '/gene/:hugoSymbol/somatic', GERMLINE_GENE = '/gene/:hugoSymbol/germline', ALTERATION = '/gene/:hugoSymbol/:alteration', + SOMATIC_ALTERATION = '/gene/:hugoSymbol/somatic/:alteration', + GERMLINE_ALTERATION = '/gene/:hugoSymbol/germline/:alteration', + SOMATIC_TUMOR_TYPE = '/gene/:hugoSymbol/somatic/:alteration/:tumorType', + GERMLINE_TUMOR_TYPE = '/gene/:hugoSymbol/germline/:alteration/:tumorType', HGVSG = '/hgvsg', HGVSG_WITH_QUERY = '/hgvsg/:query', GENOMIC_CHANGE = '/genomic-change', diff --git a/src/main/webapp/app/pages/annotationPage/AnnotatedAlterations.tsx b/src/main/webapp/app/pages/annotationPage/AnnotatedAlterations.tsx index c59d3b91d..027cb1147 100644 --- a/src/main/webapp/app/pages/annotationPage/AnnotatedAlterations.tsx +++ b/src/main/webapp/app/pages/annotationPage/AnnotatedAlterations.tsx @@ -35,6 +35,7 @@ const getColumns = (germline: boolean, hugoSymbol: string) => { alterationRefGenomes={ props.original.variant.referenceGenomes as REFERENCE_GENOME[] } + germline={germline} /> ); diff --git a/src/main/webapp/app/pages/annotationPage/AnnotationBreadcrumbs.module.scss b/src/main/webapp/app/pages/annotationPage/AnnotationBreadcrumbs.module.scss new file mode 100644 index 000000000..1a0dbc18e --- /dev/null +++ b/src/main/webapp/app/pages/annotationPage/AnnotationBreadcrumbs.module.scss @@ -0,0 +1,6 @@ +.breadcrumb { + max-width: 40ch; + text-overflow: ellipsis; + text-wrap: nowrap; + overflow: hidden; +} diff --git a/src/main/webapp/app/pages/annotationPage/AnnotationBreadcrumbs.tsx b/src/main/webapp/app/pages/annotationPage/AnnotationBreadcrumbs.tsx index 34cd90370..aac8b5510 100644 --- a/src/main/webapp/app/pages/annotationPage/AnnotationBreadcrumbs.tsx +++ b/src/main/webapp/app/pages/annotationPage/AnnotationBreadcrumbs.tsx @@ -6,14 +6,17 @@ import Select from 'react-select'; import { REFERENCE_GENOME } from 'app/config/constants'; import { COLOR_BLUE } from 'app/config/theme'; import { Option } from 'app/shared/select/FormSelectWithLabelField'; +import classnames from 'classnames'; +import styles from './AnnotationBreadcrumbs.module.scss'; export type BreadcrumbType = 'text' | 'link' | 'input' | 'dropdown'; export interface IBasicBreadcrumb { type: BreadcrumbType; active?: boolean; - key: string; + //key: string; text: string; + className?: string; } export interface ITextBreadcrumb extends IBasicBreadcrumb { @@ -51,7 +54,7 @@ const Icon: React.FunctionComponent<{ }; const TextBreadcrumb: React.FunctionComponent = props => { return ( - + {props.text} ); @@ -60,10 +63,10 @@ const TextBreadcrumb: React.FunctionComponent = props => { const LinkBreadcrumb: React.FunctionComponent = props => { return ( {props.text} @@ -75,7 +78,11 @@ const InputBreadcrumb: React.FunctionComponent = props => { const [text, setText] = useState(props.text); const editableContentFontSize = '13px'; return ( - + @@ -136,7 +143,11 @@ const InputBreadcrumb: React.FunctionComponent = props => { const DropdownBreadcrumb: React.FunctionComponent = props => { const [editing, setEditing] = useState(false); return ( - +