Skip to content

Commit ac2f313

Browse files
committed
Added new variant page
1 parent b356f42 commit ac2f313

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+3197
-636
lines changed

src/main/webapp/app/Main.tsx

+4-8
Original file line numberDiff line numberDiff line change
@@ -104,16 +104,12 @@ class Main extends React.Component<IMainPage> {
104104
routing={this.props.routing}
105105
appStore={this.props.appStore}
106106
/>
107-
<PageContainer
107+
<AppRoutes
108+
authenticationStore={this.props.authenticationStore}
109+
appStore={this.props.appStore}
108110
routing={this.props.routing}
109111
windowStore={this.props.windowStore}
110-
>
111-
<AppRoutes
112-
authenticationStore={this.props.authenticationStore}
113-
appStore={this.props.appStore}
114-
routing={this.props.routing}
115-
/>
116-
</PageContainer>
112+
/>
117113
<FeedbackModal
118114
showModal={this.props.appStore.showFeedbackFormModal}
119115
feedback={this.feedbackAnnotation}

src/main/webapp/app/components/LevelWithDescription.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import ReactHtmlParser from 'react-html-parser';
88
import { LEVELS } from 'app/config/constants';
99

1010
export const LevelWithDescription: React.FunctionComponent<{
11-
level: LEVELS;
11+
level: LEVELS | undefined;
1212
appStore?: AppStore;
1313
description?: string;
1414
}> = inject('appStore')(props => {

src/main/webapp/app/components/PageContainer.tsx

+8-25
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,25 @@
11
import React, { FunctionComponent } from 'react';
22
import { Col, Row } from 'react-bootstrap';
33
import WindowStore from 'app/store/WindowStore';
4-
import { RouterStore } from 'mobx-react-router';
5-
import { PAGE_ROUTE } from 'app/config/constants';
6-
import { GENETIC_TYPE } from 'app/components/geneticTypeTabs/GeneticTypeTabs';
7-
import { parseGenePagePath } from 'app/shared/utils/UrlUtils';
84

9-
const Container: FunctionComponent<{
10-
inGenePage: boolean;
11-
}> = props => {
12-
if (props.inGenePage) {
13-
return <div>{props.children}</div>;
14-
} else {
15-
return (
16-
<Row className={`justify-content-center`}>
17-
<Col md={11}>{props.children}</Col>
18-
</Row>
19-
);
20-
}
5+
const Container: FunctionComponent<{}> = props => {
6+
return (
7+
<Row className={`justify-content-center`}>
8+
<Col md={11}>{props.children}</Col>
9+
</Row>
10+
);
2111
};
2212
const PageContainer: React.FunctionComponent<{
23-
routing: RouterStore;
2413
windowStore: WindowStore;
2514
}> = props => {
26-
const genePagePath = parseGenePagePath(props.routing.location.pathname);
27-
const inGenePage = genePagePath.geneticType !== undefined;
2815
return (
2916
<div className={'view-wrapper'}>
3017
<div
3118
className={
32-
inGenePage
33-
? ''
34-
: props.windowStore.isXLscreen
35-
? 'container'
36-
: 'container-fluid'
19+
props.windowStore.isXLscreen ? 'container' : 'container-fluid'
3720
}
3821
>
39-
<Container inGenePage={inGenePage}>{props.children}</Container>
22+
<Container>{props.children}</Container>
4023
</div>
4124
</div>
4225
);

src/main/webapp/app/components/geneticTypeTag/GeneticTypeTag.tsx

+5-5
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,19 @@ import styles from './genetic-type-tag.module.scss';
55
import { capitalize } from 'cbioportal-frontend-commons';
66

77
const GeneticTypeTag: FunctionComponent<{
8-
geneticType: GENETIC_TYPE;
8+
isGermline: boolean;
99
className?: string;
1010
}> = props => {
1111
return (
1212
<span
1313
className={classnames(
1414
props.className,
15-
props.geneticType === GENETIC_TYPE.GERMLINE
16-
? styles.germlineTag
17-
: styles.somaticTag
15+
props.isGermline ? styles.germlineTag : styles.somaticTag
1816
)}
1917
>
20-
{capitalize(props.geneticType)}
18+
{capitalize(
19+
props.isGermline ? GENETIC_TYPE.GERMLINE : GENETIC_TYPE.SOMATIC
20+
)}
2121
</span>
2222
);
2323
};

src/main/webapp/app/components/infoTile/InfoTile.tsx

-52
This file was deleted.

src/main/webapp/app/components/infoTile/LoETile.tsx

-100
This file was deleted.

src/main/webapp/app/components/infoTile/info-tile.module.scss

-17
This file was deleted.

src/main/webapp/app/components/searchOption/SearchOption.tsx

+13-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import React from 'react';
2-
import { levelOfEvidence2Level, OncoKBAnnotationIcon } from 'app/shared/utils/Utils';
2+
import {
3+
levelOfEvidence2Level,
4+
OncoKBAnnotationIcon,
5+
} from 'app/shared/utils/Utils';
36
import { Else, If, Then } from 'react-if';
47
import Highlighter from 'react-highlight-words';
58
import styles from './SearchOption.module.scss';
@@ -50,9 +53,15 @@ const GeneSearchOption: React.FunctionComponent<{
5053
searchWords={[props.search]}
5154
textToHighlight={`${props.data.gene.hugoSymbol} (Entrez Gene: ${props.data.gene.entrezGeneId})`}
5255
/>
53-
{props.data.annotation && Object.values(GENETIC_TYPE).includes(props.data.annotation.toLowerCase() as GENETIC_TYPE) && (
54-
<GeneticTypeTag geneticType={props.data.annotation.toLowerCase() === 'germline' ? GENETIC_TYPE.GERMLINE : GENETIC_TYPE.SOMATIC} className={'ml-2'}/>
55-
)}
56+
{props.data.annotation &&
57+
Object.values(GENETIC_TYPE).includes(
58+
props.data.annotation.toLowerCase() as GENETIC_TYPE
59+
) && (
60+
<GeneticTypeTag
61+
isGermline={props.data.annotation.toLowerCase() === 'germline'}
62+
className={'ml-2'}
63+
/>
64+
)}
5665
{props.data.highestSensitiveLevel ||
5766
props.data.highestResistanceLevel ? (
5867
<span className={classnames(styles.subTitle, 'ml-2')}>

src/main/webapp/app/config/constants.tsx

+4
Original file line numberDiff line numberDiff line change
@@ -605,6 +605,10 @@ export enum PAGE_ROUTE {
605605
SOMATIC_GENE = '/gene/:hugoSymbol/somatic',
606606
GERMLINE_GENE = '/gene/:hugoSymbol/germline',
607607
ALTERATION = '/gene/:hugoSymbol/:alteration',
608+
SOMATIC_ALTERATION = '/gene/:hugoSymbol/somatic/:alteration',
609+
GERMLINE_ALTERATION = '/gene/:hugoSymbol/germline/:alteration',
610+
SOMATIC_TUMOR_TYPE = '/gene/:hugoSymbol/somatic/:alteration/:tumorType',
611+
GERMLINE_TUMOR_TYPE = '/gene/:hugoSymbol/germline/:alteration/:tumorType',
608612
HGVSG = '/hgvsg',
609613
HGVSG_WITH_QUERY = '/hgvsg/:query',
610614
GENOMIC_CHANGE = '/genomic-change',

src/main/webapp/app/pages/annotationPage/AnnotatedAlterations.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ const getColumns = (germline: boolean, hugoSymbol: string) => {
3535
alterationRefGenomes={
3636
props.original.variant.referenceGenomes as REFERENCE_GENOME[]
3737
}
38+
germline={germline}
3839
/>
3940
</>
4041
);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.breadcrumb {
2+
max-width: 40ch;
3+
text-overflow: ellipsis;
4+
text-wrap: nowrap;
5+
overflow: hidden;
6+
}

0 commit comments

Comments
 (0)