Skip to content

Commit a9db5f2

Browse files
authored
Updates based on the UX feedback (#1187)
1 parent d01515e commit a9db5f2

File tree

57 files changed

+170
-120
lines changed

Some content is hidden

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

57 files changed

+170
-120
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"mobx-react": "^4.2.1",
4040
"mobx-react-router": "^4.0.7",
4141
"moment": "2.29.4",
42-
"oncokb-styles": "~1.4.0-alpha.0",
42+
"oncokb-styles": "~1.6.0-alpha.1",
4343
"pluralize": "^8.0.0",
4444
"query-string": "^6.13.1",
4545
"react": "16.13.1",

screenshot-test/AnnotationPages.screenshot.js

+3
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,7 @@ describe('Tests with login', () => {
432432
else request.continue();
433433
});
434434
await page.goto(`${CLIENT_URL}`);
435+
await page.setViewport(VIEW_PORT_1080);
435436
await page.evaluate(() => {
436437
localStorage.setItem('localdev', 'true');
437438
localStorage.setItem('disablebanner', 'true');
@@ -516,6 +517,7 @@ describe('Tests without login', () => {
516517
}
517518
});
518519
await page.goto(`${CLIENT_URL}`);
520+
await page.setViewport(VIEW_PORT_1080);
519521
await page.evaluate(() => {
520522
localStorage.setItem('localdev', 'true');
521523
localStorage.setItem('disablebanner', 'true');
@@ -587,6 +589,7 @@ describe('Tests on mobile view (< large grid)', () => {
587589
else request.continue();
588590
});
589591
await page.goto(`${CLIENT_URL}`);
592+
await page.setViewport(VIEW_PORT_1080);
590593
await page.evaluate(() => {
591594
localStorage.setItem('localdev', 'true');
592595
localStorage.setItem('disablebanner', 'true');

screenshot-test/App.screenshot.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,7 @@ describe('Tests without ROLE_API and requested', () => {
372372
} else request.continue();
373373
});
374374
await page.goto(`${CLIENT_URL}`);
375+
await page.setViewport(VIEW_PORT_1080);
375376
await page.evaluate(() => {
376377
localStorage.setItem('localdev', 'true');
377378
localStorage.setItem('disablebanner', 'true');
@@ -414,6 +415,7 @@ describe('Tests without ROLE_API and not requested', () => {
414415
} else request.continue();
415416
});
416417
await page.goto(`${CLIENT_URL}`);
418+
await page.setViewport(VIEW_PORT_1080);
417419
await page.evaluate(() => {
418420
localStorage.setItem('localdev', 'true');
419421
localStorage.setItem('disablebanner', 'true');
@@ -456,6 +458,7 @@ describe('Tests with login', () => {
456458
} else request.continue();
457459
});
458460
await page.goto(`${CLIENT_URL}`);
461+
await page.setViewport(VIEW_PORT_1080);
459462
await page.evaluate(() => {
460463
localStorage.setItem('localdev', 'true');
461464
localStorage.setItem('disablebanner', 'true');
@@ -610,6 +613,7 @@ describe('Tests without login', () => {
610613
}
611614
});
612615
await page.goto(`${CLIENT_URL}`);
616+
await page.setViewport(VIEW_PORT_1080);
613617
await page.evaluate(() => {
614618
localStorage.setItem('localdev', 'true');
615619
localStorage.setItem('disablebanner', 'true');
@@ -809,4 +813,4 @@ describe('Tests without login', () => {
809813
afterAll(async () => {
810814
await browser.close();
811815
});
812-
});
816+
});

src/main/webapp/app/components/geneticTypeTabs/genetic-type-tabs.module.scss

-2
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,10 @@
1313
}
1414

1515
.tab:first-child {
16-
border-left: 0;
1716
border-top-right-radius: 3px;
1817
}
1918

2019
.tab:last-child {
21-
border-right: 0;
2220
border-top-left-radius: 3px;
2321
}
2422

src/main/webapp/app/components/geneticTypeTag/genetic-type-tag.module.scss

+6-4
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22

33
.geneticTypeTag {
44
font-weight: 500 !important;
5-
font-family: "Gotham Book";
5+
font-family: 'Gotham Book';
6+
font-size: 12px;
7+
line-height: 18px;
68
display: inline-flex;
7-
padding: 0 var(--radius-8, 8px);
9+
padding: 0 var(--radius-8, 0.5rem);
810
justify-content: center;
911
align-items: center;
1012
gap: var(--radius-8, 8px);
@@ -15,11 +17,11 @@
1517
@extend .geneticTypeTag;
1618
color: $primary;
1719
border: var(--radius-2, 2px) solid var(--Color-11, $primary);
18-
background: #F0F5FF;
20+
background: #f0f5ff;
1921
}
2022

2123
.somaticTag {
2224
@extend .geneticTypeTag;
23-
color: #FFFFFF;
25+
color: #ffffff;
2426
background: $primary;
2527
}

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const Category: React.FunctionComponent<Category> = props => {
3636

3737
const InfoTile: React.FunctionComponent<InfoTile> = props => {
3838
return props.categories.length > 0 ? (
39-
<div className={classnames(styles.tile, 'mr-2', props.className)}>
39+
<div className={classnames(styles.tile, props.className)}>
4040
<div className={'h6 font-bold mb-2'}>{props.title}</div>
4141
<div className={'d-flex'}>
4242
{props.categories.map((category, idx) => (

src/main/webapp/app/index.scss

-6
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,6 @@ body {
1414
background-color: $pale-warm-grey !important;
1515
}
1616

17-
#root {
18-
max-width: 1500px;
19-
margin: 0 auto;
20-
background-color: #fff;
21-
}
22-
2317
h1,
2418
h2,
2519
.h1,
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
import styles from 'app/pages/genePage/GenePage.module.scss';
2+
import InfoTile from 'app/components/infoTile/InfoTile';
3+
import LoETile from 'app/components/infoTile/LoETile';
4+
import React from 'react';
5+
import { GeneNumber } from 'app/shared/api/generated/OncoKbPrivateAPI';
6+
import {
7+
Oncogenicity,
8+
Pathogenicity,
9+
} from 'app/components/oncokbMutationMapper/OncokbMutationMapper';
10+
import classnames from 'classnames';
11+
12+
export interface IGeneInfoTil {
13+
isGermline: boolean;
14+
geneNumber: GeneNumber;
15+
oncogenicities: Oncogenicity[];
16+
pathogenicities: Pathogenicity[];
17+
}
18+
19+
const GeneInfoTile = (props: IGeneInfoTil) => {
20+
let count = 1;
21+
const hasGeneticRiskInfo =
22+
props.geneNumber.penetrance || props.geneNumber.inheritanceMechanism;
23+
if (hasGeneticRiskInfo) count++;
24+
if (
25+
props.geneNumber.highestSensitiveLevel ||
26+
props.geneNumber.highestResistanceLevel ||
27+
props.geneNumber.highestDiagnosticImplicationLevel ||
28+
props.geneNumber.highestPrognosticImplicationLevel ||
29+
props.geneNumber.highestFdaLevel
30+
) {
31+
count++;
32+
}
33+
34+
const tileStyle = count === 2 ? styles.evenInfoTile : styles.autoInfoTile;
35+
36+
return (
37+
<div className={styles.infoTileContainer}>
38+
{hasGeneticRiskInfo && (
39+
<InfoTile
40+
className={classnames(styles.infoTile, tileStyle)}
41+
title={'Genetic Risk'}
42+
categories={[
43+
{
44+
title: 'Penetrance',
45+
content: props.geneNumber.penetrance,
46+
},
47+
{
48+
title: 'Mechanism of Inheritance',
49+
content: props.geneNumber.inheritanceMechanism,
50+
},
51+
]}
52+
/>
53+
)}
54+
<LoETile
55+
className={classnames(styles.infoTile, tileStyle)}
56+
highestSensitiveLevel={props.geneNumber.highestSensitiveLevel}
57+
highestResistanceLevel={props.geneNumber.highestResistanceLevel}
58+
highestDiagnosticImplicationLevel={
59+
props.geneNumber.highestDiagnosticImplicationLevel
60+
}
61+
highestPrognosticImplicationLevel={
62+
props.geneNumber.highestPrognosticImplicationLevel
63+
}
64+
highestFdaLevel={props.geneNumber.highestFdaLevel}
65+
/>
66+
<InfoTile
67+
className={classnames(styles.infoTile, tileStyle)}
68+
title={`Annotated ${props.isGermline ? 'variants' : 'alterations'}`}
69+
categories={
70+
props.isGermline
71+
? props.pathogenicities.map(pathogenicity => {
72+
return {
73+
title: pathogenicity.pathogenicity,
74+
content: pathogenicity.counts.toString(),
75+
};
76+
})
77+
: props.oncogenicities.map(oncogenicity => {
78+
return {
79+
title: oncogenicity.oncogenicity,
80+
content: oncogenicity.counts.toString(),
81+
};
82+
})
83+
}
84+
/>
85+
</div>
86+
);
87+
};
88+
89+
export default GeneInfoTile;

src/main/webapp/app/pages/genePage/GenePage.module.scss

+14-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,20 @@
2929
padding-right: 0;
3030
}
3131

32+
.infoTileContainer {
33+
display: flex;
34+
gap: 0.5rem;
35+
flex-wrap: wrap;
36+
}
37+
38+
.evenInfoTile {
39+
flex: 1 1 calc(50% - 0.25rem);
40+
}
41+
42+
.autoInfoTile {
43+
flex: 1 1 auto;
44+
}
45+
3246
.infoTile {
33-
margin-top: 1rem;
3447
flex-grow: 1;
3548
}

0 commit comments

Comments
 (0)