Skip to content

Commit c604e93

Browse files
committed
show coming soon for clinical implications section for germline (oncokb#1280)
1 parent 53a6846 commit c604e93

File tree

5 files changed

+101
-30
lines changed

5 files changed

+101
-30
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import React from 'react';
2+
import styles from './tag.module.scss';
3+
import classnames from 'classnames';
4+
5+
export interface IComingSoonTagProps {
6+
size?: 'sm' | 'lg';
7+
className?: string;
8+
}
9+
10+
export default function ComingSoonTag({
11+
size = 'sm',
12+
className,
13+
}: IComingSoonTagProps) {
14+
return (
15+
<span
16+
className={classnames(
17+
size === 'sm' ? styles.comingSoonTagSmall : styles.comingSoonTagLarge,
18+
className
19+
)}
20+
>
21+
Coming Soon!
22+
</span>
23+
);
24+
}

src/main/webapp/app/components/tag/tag.module.scss

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,18 @@
4848
color: #684e00;
4949
background: #fcf4d6;
5050
}
51+
52+
.comingSoonTagSmall {
53+
@extend .tag;
54+
color: $primary;
55+
border: var(--radius-2, 2px) solid var(--Color-11, $primary);
56+
}
57+
58+
.comingSoonTagLarge {
59+
@extend .tag;
60+
color: white;
61+
font-size: 18px;
62+
background: $primary;
63+
padding: 4px var(--radius-8, 0.5rem);
64+
border: var(--radius-2, 2px) solid var(--Color-11, $primary);
65+
}

src/main/webapp/app/pages/somaticGermlineAlterationPage/SomaticGermlineAlterationPage.tsx

Lines changed: 38 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -665,31 +665,44 @@ export class SomaticGermlineAlterationPage extends React.Component<
665665
/>
666666
</>
667667
)}
668-
<MiniNavBarHeader id="clinical-implications">
669-
Clinical Implications for this Biomarker
670-
</MiniNavBarHeader>
671-
<SomaticGermlineAlterationView
672-
appStore={this.props.appStore}
673-
hugoSymbol={this.store.hugoSymbol}
674-
alteration={this.store.alterationName}
675-
alterationQuery={this.store.alterationQuery}
676-
germline={this.store.germline}
677-
matchedAlteration={this.store.alteration.result}
678-
tumorType={this.store.cancerTypeName}
679-
onChangeTumorType={this.onChangeTumorType.bind(this)}
680-
annotation={this.store.annotationData.result}
681-
biologicalAlterations={
682-
this.store.biologicalAlterations.result
683-
}
684-
relevantAlterations={undefined}
685-
fdaImplication={this.fdaImplication}
686-
therapeuticImplications={this.therapeuticImplications}
687-
diagnosticImplications={this.diagnosticImplications}
688-
prognosticImplications={this.prognosticImplications}
689-
defaultSelectedTab={this.selectedTab}
690-
onChangeTab={this.onChangeTab}
691-
routing={this.props.routing}
692-
/>
668+
<div className="d-flex align-items-center">
669+
<MiniNavBarHeader
670+
id="clinical-implications"
671+
comingSoon={this.store.germline}
672+
>
673+
<span
674+
className={
675+
this.store.germline ? 'text-secondary' : undefined
676+
}
677+
>
678+
Clinical Implications for this Biomarker
679+
</span>
680+
</MiniNavBarHeader>
681+
</div>
682+
{!this.store.germline && (
683+
<SomaticGermlineAlterationView
684+
appStore={this.props.appStore}
685+
hugoSymbol={this.store.hugoSymbol}
686+
alteration={this.store.alterationName}
687+
alterationQuery={this.store.alterationQuery}
688+
germline={this.store.germline}
689+
matchedAlteration={this.store.alteration.result}
690+
tumorType={this.store.cancerTypeName}
691+
onChangeTumorType={this.onChangeTumorType.bind(this)}
692+
annotation={this.store.annotationData.result}
693+
biologicalAlterations={
694+
this.store.biologicalAlterations.result
695+
}
696+
relevantAlterations={undefined}
697+
fdaImplication={this.fdaImplication}
698+
therapeuticImplications={this.therapeuticImplications}
699+
diagnosticImplications={this.diagnosticImplications}
700+
prognosticImplications={this.prognosticImplications}
701+
defaultSelectedTab={this.selectedTab}
702+
onChangeTab={this.onChangeTab}
703+
routing={this.props.routing}
704+
/>
705+
)}
693706
</Col>
694707
</Row>
695708
</Container>

src/main/webapp/app/shared/nav/MiniNavBarHeader.tsx

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
11
import React, { useContext, useEffect } from 'react';
22
import { StickyMiniNavBarContext } from './StickyMiniNavBar';
3+
import classnames from 'classnames';
4+
import ComingSoonTag from 'app/components/tag/ComingSoonTag';
35

46
type IMiniNavBarHeader = {
57
id: string;
68
children: React.ReactNode;
79
className?: string;
810
showOnPage?: boolean;
11+
comingSoon?: boolean;
912
};
1013
export default function MiniNavBarHeader({
1114
id,
1215
children,
1316
className = 'mt-5',
1417
showOnPage = true,
18+
comingSoon = false,
1519
}: IMiniNavBarHeader) {
1620
const { invalidateCache } = useContext(StickyMiniNavBarContext);
1721
useEffect(() => {
@@ -33,8 +37,15 @@ export default function MiniNavBarHeader({
3337
);
3438
}
3539
return (
36-
<h3 id={id} className={className} mini-nav-bar-header="">
37-
{children}
40+
<h3 className={classnames('d-flex align-items-center', className)}>
41+
<span
42+
id={id}
43+
mini-nav-bar-header=""
44+
coming-soon={comingSoon ? '' : undefined}
45+
>
46+
{children}
47+
</span>
48+
{comingSoon && <ComingSoonTag className="ml-2" size="lg" />}
3849
</h3>
3950
);
4051
}

src/main/webapp/app/shared/nav/StickyMiniNavBar.tsx

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { Row, Col, Container } from 'react-bootstrap';
1111
import styles from './StickyMiniNavBar.module.scss';
1212
import classNames from 'classnames';
1313
import classnames from 'classnames';
14+
import ComingSoonTag from 'app/components/tag/ComingSoonTag';
1415

1516
function getNavBarSectionElements() {
1617
return document.querySelectorAll('[mini-nav-bar-header]');
@@ -86,7 +87,7 @@ export default function StickyMiniNavBar({
8687
const [headerHeight, setHeaderHeight] = useState(0);
8788
const [isSticky, setIsSticky] = useState(false);
8889
const [sections, setSections] = useState<
89-
{ id: string; label: string | null }[]
90+
{ id: string; label: string | null; comingSoon: boolean }[]
9091
>([]);
9192
const [passedElements, setPassedElements] = useState<
9293
Record<string, { isPassed: boolean; isInView: boolean }>
@@ -106,6 +107,7 @@ export default function StickyMiniNavBar({
106107
newSections.push({
107108
id: ele.id,
108109
label: ele.textContent,
110+
comingSoon: ele.getAttribute('coming-soon') !== null ? true : false,
109111
});
110112
});
111113
setSections(newSections);
@@ -266,18 +268,24 @@ export default function StickyMiniNavBar({
266268
gap: '10px',
267269
}}
268270
>
269-
{sections.map(({ id, label }) => {
271+
{sections.map(({ id, label, comingSoon }) => {
270272
const isInSection = currentSectionId === id;
271273
return (
272274
<Link
275+
style={comingSoon ? { pointerEvents: 'none' } : undefined}
273276
key={id}
274277
to={`#${id}`}
275278
className={classNames(
276279
styles.stickySection,
277280
isInSection ? styles.stickySectionSelected : ''
278281
)}
279282
>
280-
{label}
283+
<span
284+
className={comingSoon ? 'text-secondary' : undefined}
285+
>
286+
{label}
287+
</span>
288+
{comingSoon && <ComingSoonTag className="ml-2" />}
281289
</Link>
282290
);
283291
})}

0 commit comments

Comments
 (0)