Skip to content

Commit a99823e

Browse files
authored
Update news 4.20 (#1142)
1 parent 3e00c88 commit a99823e

File tree

14 files changed

+524
-24
lines changed

14 files changed

+524
-24
lines changed

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

+1
Original file line numberDiff line numberDiff line change
@@ -800,6 +800,7 @@ export type DataRelease = {
800800
};
801801

802802
export const DATA_RELEASES: DataRelease[] = [
803+
{ date: '08152024', version: 'v4.20' },
803804
{ date: '07042024', version: 'v4.19' },
804805
{ date: '07022024', version: 'v4.18' },
805806
{ date: '06042024', version: 'v4.17' },

src/main/webapp/app/config/constants/regex.ts

+2
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@
44
// (NCT1234567)
55
export const REF_CAPTURE = /(\(\s*(?:PMID|NCT|Abstract):?.*?(?:\([^()]*\).*?)*\))/i;
66
export const VALID_LATIN_TEXT = /^[\p{Script=Latin}\p{M}\p{N}\p{Z}\p{P}\p{Sm}\p{Sc}\p{Sk}]+$/u;
7+
8+
export const ALTERNATIVE_ALLELES_REGEX = /([A-Z]+[0-9]+)([A-Z]+(\/[A-Z]+)*)/i;

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

+10-17
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
import React from 'react';
2-
import { AlterationPageLink } from 'app/shared/utils/UrlUtils';
2+
import {
3+
AlterationPageLink,
4+
getAlternativeAllelesPageLinks,
5+
} from 'app/shared/utils/UrlUtils';
36
import WithSeparator from 'react-with-separator';
47
import SummaryWithRefs from 'app/oncokb-frontend-commons/src/components/SummaryWithRefs';
8+
import { ALTERNATIVE_ALLELES_REGEX } from 'app/config/constants/regex';
59

610
const MutationEffectDescription: React.FunctionComponent<{
711
hugoSymbol: string;
@@ -18,30 +22,19 @@ const MutationEffectDescription: React.FunctionComponent<{
1822
const varSegs = segments[1].split(' ');
1923
let alterationStr = varSegs.pop();
2024
if (alterationStr) {
21-
const altRegex = new RegExp('([A-Z]+[0-9]+)([A-Z]+(/[A-Z]+)*)', 'i');
25+
const altRegex = ALTERNATIVE_ALLELES_REGEX;
2226
alterationStr = alterationStr.replace('.', '');
2327
if (altRegex.test(alterationStr)) {
2428
const matches = altRegex.exec(alterationStr);
2529
if (matches) {
26-
const positionalVar = matches[1];
27-
const alternativeAlleles = matches[2];
28-
const alleleLines = alternativeAlleles
29-
.split('/')
30-
.map((allele, index) => {
31-
return (
32-
<AlterationPageLink
33-
hugoSymbol={props.hugoSymbol}
34-
alteration={`${positionalVar}${allele}`}
35-
>
36-
{index === 0 ? `${positionalVar}${allele}` : allele}
37-
</AlterationPageLink>
38-
);
39-
});
4030
return (
4131
<span>
4232
{segments[0]} {additionalMutationEffectSeparator}
4333
{varSegs.join(' ')}{' '}
44-
<WithSeparator separator={'/'}>{alleleLines}</WithSeparator>.
34+
{getAlternativeAllelesPageLinks(
35+
props.hugoSymbol,
36+
alterationStr
37+
)}
4538
</span>
4639
);
4740
}

src/main/webapp/app/pages/newsPage/ChangedAnnotatonListItem.tsx

+14-2
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ export const ChangedAnnotationListItem = (props: {
4343
title?: string;
4444
data: SimpleTableRow[];
4545
columnHeaderType?: AnnotationColumnHeaderType;
46+
headers?: {
47+
name: string;
48+
}[];
49+
useOneLineRowClass?: boolean;
4650
}) => {
4751
let longestRow = 0;
4852
if (props.data.length > 0) {
@@ -158,9 +162,17 @@ export const ChangedAnnotationListItem = (props: {
158162
{props.title ? props.title : defaultTitle}
159163
<Row className={'overflow-auto'}>
160164
<SimpleTable
161-
columns={annotationColumnHeader.slice(0, longestRow)}
165+
columns={
166+
props.headers
167+
? props.headers
168+
: annotationColumnHeader.slice(0, longestRow)
169+
}
162170
rows={props.data}
163-
theadClassName={useOneLineRowClass ? mainStyle.oneRowHeader : ''}
171+
theadClassName={
172+
props.useOneLineRowClass ?? useOneLineRowClass
173+
? mainStyle.oneRowHeader
174+
: ''
175+
}
164176
/>
165177
</Row>
166178
</li>

src/main/webapp/app/pages/newsPage/NewsList.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,8 @@ export default class NewsList extends React.Component<NewsListProps> {
136136
<ChangedAnnotationListItem
137137
title={annotation.title}
138138
columnHeaderType={annotation.columnHeaderType}
139+
headers={annotation.headers}
140+
useOneLineRowClass={annotation.useOneLineRowClass}
139141
data={
140142
annotation.content
141143
? annotation.content.map((item, index) => {

src/main/webapp/app/pages/newsPage/NewsPage.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ export default class NewsPage extends React.Component<{
9191
<CitationText />
9292
</div>
9393
<div className="mt-2">
94+
<NewsList date={'08152024'} />
9495
<NewsList date={'07042024'} />
9596
<NewsList date={'07022024'} />
9697
<NewsList date={'06042024'} />

0 commit comments

Comments
 (0)