Skip to content

Commit

Permalink
Feature/v4.24 (#1194)
Browse files Browse the repository at this point in the history
* v4.24

* Update src/main/webapp/app/pages/genePage/SomaticGermlineGenePage.tsx

Co-authored-by: Calvin Lu <[email protected]>

* Update src/main/webapp/app/components/userMessager/UserMessage.tsx

Co-authored-by: Calvin Lu <[email protected]>

* Fixed screenshot

* Addressed Comments

---------

Co-authored-by: Calvin Lu <[email protected]>
  • Loading branch information
jfkonecn and calvinlu3 authored Dec 19, 2024
1 parent 1f28289 commit 9cec336
Show file tree
Hide file tree
Showing 65 changed files with 795 additions and 58 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshot-test/__baseline_snapshots__/Login Page-snap.png
Binary file modified screenshot-test/__baseline_snapshots__/User Details Page-snap.png
2 changes: 1 addition & 1 deletion src/main/java/org/mskcc/cbio/oncokb/web/rest/ApiProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public ResponseEntity<String> proxy(@RequestBody(required = false) String body,
}
}

@RequestMapping("/private/utils/data/sqlDump")
@RequestMapping(path = {"/private/utils/data/sqlDump", "/private/utils/data/transcriptSqlDump"})
public ResponseEntity<byte[]> proxyDataReleaseDownload(@RequestBody(required = false) String body, HttpMethod method, HttpServletRequest request)
throws URISyntaxException {
URI uri = apiProxyService.prepareURI(request);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import org.springframework.web.bind.MethodArgumentNotValidException;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.client.HttpClientErrorException;
import org.springframework.web.context.request.NativeWebRequest;
import org.springframework.web.context.request.WebRequest;
import org.springframework.core.env.Environment;
Expand Down Expand Up @@ -56,6 +57,20 @@ public ExceptionTranslator(Environment env) {
this.env = env;
}

@ExceptionHandler
public ResponseEntity<Problem> handleHttpClientErrorException(HttpClientErrorException ex, NativeWebRequest request) {
Problem problem = Problem.builder()
.withType(ErrorConstants.DEFAULT_TYPE)
.withTitle("HTTP Error")
.withStatus(Status.valueOf(ex.getStatusCode().value()))
.with(MESSAGE_KEY, "error.http." + ex.getStatusCode().value())
.withDetail(ex.getResponseBodyAsString())
.with(PATH_KEY, request.getNativeRequest(HttpServletRequest.class).getRequestURI())
.build();

return create(ex, problem, request);
}

/**
* Post-process the Problem payload to add the message key for the front-end if needed.
*/
Expand Down Expand Up @@ -146,7 +161,6 @@ public ResponseEntity<Problem> handleDatabaseReadOnlyException(DatabaseReadOnlyE

@Override
public ProblemBuilder prepare(final Throwable throwable, final StatusType status, final URI type) {

Collection<String> activeProfiles = Arrays.asList(env.getActiveProfiles());

if (activeProfiles.contains(JHipsterConstants.SPRING_PROFILE_PRODUCTION)) {
Expand All @@ -161,7 +175,6 @@ public ProblemBuilder prepare(final Throwable throwable, final StatusType status
.map(this::toProblem)
.orElse(null));
}

if (throwable instanceof DataAccessException) {
return Problem.builder()
.withType(type)
Expand All @@ -173,7 +186,6 @@ public ProblemBuilder prepare(final Throwable throwable, final StatusType status
.map(this::toProblem)
.orElse(null));
}

if (containsPackageName(throwable.getMessage())) {
return Problem.builder()
.withType(type)
Expand Down
2 changes: 0 additions & 2 deletions src/main/webapp/app/components/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import ExternalLinkIcon from 'app/shared/icons/ExternalLinkIcon';
import { OncoTreeLink } from 'app/shared/utils/UrlUtils';
import {
LinkedInLink,
TwitterLink,
UserGoogleGroupLink,
} from 'app/shared/links/SocialMediaLinks';

Expand Down Expand Up @@ -58,7 +57,6 @@ class Footer extends React.Component<{ lastDataUpdate: string }> {
<Link to={PAGE_ROUTE.TERMS}>Terms of Use</Link>
<ContactLink emailSubject={'Contact us'}>Contact Us</ContactLink>
<LinkedInLink short />
<TwitterLink short />
<Linkout link={API_DOCUMENT_LINK}>API</Linkout>
</div>
<div className={classnames(styles.footerAList)}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { observer, inject } from 'mobx-react';
import { observable, action } from 'mobx';
import { LoadingButton } from 'app/shared/button/LoadingButton';
import { IDownloadButtonWithPromise } from 'app/components/downloadButtonWithPromise/DownloadButtonWithPromise';
import { notifyError } from 'app/shared/utils/NotificationUtils';

interface IAuthDownloadButton extends IDownloadButtonWithPromise {
routing?: RouterStore;
Expand All @@ -28,10 +29,19 @@ export class AuthDownloadButton extends React.Component<IAuthDownloadButton> {
.then(data => {
if (Array.isArray(data)) {
data = data.join('');
} else if (data === undefined || data === null) {
return;
}
fileDownload(data, this.props.fileName, this.props.mime);
})
.catch(error => {})
.catch(error => {
console.error(error);
notifyError(
new Error(
`There was an error fetching the file "${this.props.fileName}"`
)
);
})
.finally(() => {
this.downloading = false;
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ import fileDownload from 'js-file-download';
import { observer, inject } from 'mobx-react';
import { observable, action } from 'mobx';
import { LoadingButton } from 'app/shared/button/LoadingButton';
import { notifyError } from 'app/shared/utils/NotificationUtils';

export interface IDownloadButtonWithPromise extends ButtonProps {
getDownloadData: () => Promise<string | Blob | string[]>;
getDownloadData: () => Promise<string | Blob | string[] | null | undefined>;
fileName: string;
mime?: string;
buttonText: string;
Expand All @@ -27,10 +28,19 @@ export class DownloadButtonWithPromise extends React.Component<
.then(data => {
if (Array.isArray(data)) {
data = data.join('');
} else if (data === undefined || data === null) {
return;
}
fileDownload(data, this.props.fileName, this.props.mime);
})
.catch(error => {})
.catch(error => {
console.error(error);
notifyError(
new Error(
`There was an error fetching the file "${this.props.fileName}"`
)
);
})
.finally(() => {
this.downloading = false;
});
Expand Down
4 changes: 1 addition & 3 deletions src/main/webapp/app/components/userMessager/UserMessage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import { Linkout } from 'app/shared/links/Linkout';
import { COLOR_BLACK, COLOR_DARK_BLUE, COLOR_WARNING } from 'app/config/theme';
import {
LinkedInLink,
TwitterLink,
UserGoogleGroupLink,
} from 'app/shared/links/SocialMediaLinks';

Expand Down Expand Up @@ -60,8 +59,7 @@ if (
<div>
<div>
<span>
Follow us on <LinkedInLink /> and <TwitterLink />, or subscribe to
our{' '}
Follow us on <LinkedInLink /> or subscribe to our{' '}
<UserGoogleGroupLink>low-volume email list</UserGoogleGroupLink>,
to stay updated on our latest data releases and new features!
</span>
Expand Down
1 change: 1 addition & 0 deletions src/main/webapp/app/config/constants.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -864,6 +864,7 @@ export type DataRelease = {
};

export const DATA_RELEASES: DataRelease[] = [
{ date: '12192024', version: 'v4.24' },
{ date: '11262024', version: 'v4.23' },
{ date: '10242024', version: 'v4.22' },
{ date: '09252024', version: 'v4.21' },
Expand Down
5 changes: 4 additions & 1 deletion src/main/webapp/app/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ superagent.Request.prototype.query = function (queryParameters: any) {
const token = getStoredToken();
if (token) {
this.set('Authorization', `Bearer ${token}`);
if (this.url.endsWith('sqlDump')) {
if (
this.url.endsWith('sqlDump') ||
this.url.endsWith('transcriptSqlDump')
) {
this.responseType('blob');
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/main/webapp/app/pages/CancerGenesPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -449,10 +449,10 @@ export default class CancerGenesPage extends React.Component<{
</Col>
<Col className="col-auto">
<DownloadButtonWithPromise
fileName="cancerGeneList.tsv"
getDownloadData={() =>
oncokbClient.utilsCancerGeneListTxtGetUsingGET({})
}
fileName={'cancerGeneList.tsv'}
getDownloadData={() => {
return oncokbClient.utilsCancerGeneListTxtGetUsingGET({});
}}
buttonText="Cancer Gene List"
/>
</Col>
Expand Down
88 changes: 69 additions & 19 deletions src/main/webapp/app/pages/apiAccessGroup/APIAccessPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,48 +38,92 @@ const getDataTitle = (date: string, version: string) => {
return `${getNewsTitle(date)} (${version})`;
};

function getMajorVersion(versionString: string): number | undefined {
const match = versionString.match(/^v(\d+)\./);

return match ? parseInt(match[1], 10) : undefined;
}
function getMinorVersion(versionString: string): number | undefined {
const match = versionString.match(/^v(\d+)\.(\d+)/);

return match ? parseInt(match[2], 10) : undefined;
}

const BUTTON_CLASS_NAME = 'mr-2 my-1';
const DownloadButtonGroups: React.FunctionComponent<{
data: DownloadAvailabilityWithDate;
}> = props => {
const majorVersion = getMajorVersion(props.data.version) ?? 0;
const minorVersion = getMinorVersion(props.data.version) ?? 0;
const versionIsLessThan4 = majorVersion < 4;
return (
<>
{props.data.hasAllCuratedGenes ? (
<AuthDownloadButton
className={BUTTON_CLASS_NAME}
fileName={`all_curated_genes_${props.data.version}.tsv`}
getDownloadData={() =>
oncokbClient.utilsAllCuratedGenesTxtGetUsingGET({
getDownloadData={() => {
return oncokbClient.utilsAllCuratedGenesTxtGetUsingGET({
version: props.data.version,
})
}
});
}}
buttonText="All Curated Genes"
/>
) : null}
{props.data.hasCancerGeneList ? (
<AuthDownloadButton
className={BUTTON_CLASS_NAME}
fileName={`cancer_gene_list_${props.data.version}.tsv`}
getDownloadData={() =>
oncokbClient.utilsCancerGeneListTxtGetUsingGET({
getDownloadData={() => {
return oncokbClient.utilsCancerGeneListTxtGetUsingGET({
version: props.data.version,
})
}
});
}}
buttonText="Cancer Gene List"
/>
) : null}
{props.data.hasAllActionableVariants ? (
<AuthDownloadButton
className={BUTTON_CLASS_NAME}
fileName={`oncokb_${props.data.version.replace('.', '_')}.sql.gz`}
getDownloadData={async () => {
const data = await oncokbPrivateClient.utilDataSqlDumpGetUsingGET({
version: props.data.version,
});
return data;
}}
buttonText="Data Dump"
/>
<>
<AuthDownloadButton
className={BUTTON_CLASS_NAME}
fileName={`oncokb_${props.data.version.replace('.', '_')}.sql.gz`}
getDownloadData={async () => {
const data = await oncokbPrivateClient.utilDataSqlDumpGetUsingGET(
{
version: props.data.version,
}
);
return data;
}}
buttonText="Data Dump"
/>
<AuthDownloadButton
disabled={versionIsLessThan4}
title={
versionIsLessThan4
? 'Not available for versions below 4.0'
: undefined
}
className={BUTTON_CLASS_NAME}
fileName={`oncokb_transcript_${props.data.version.replace(
'.',
'_'
)}.sql.gz`}
getDownloadData={async () => {
const version =
majorVersion === 4 && minorVersion < 23
? 'v4.23'
: props.data.version;
const data = await oncokbPrivateClient.utilDataTranscriptSqlDumpUsingGET(
{
version,
}
);
return data;
}}
buttonText="Transcript Data"
/>
</>
) : null}
</>
);
Expand Down Expand Up @@ -224,6 +268,12 @@ export default class APIAccessPage extends React.Component<{
)}
, the latest
</h6>
<p className="rounded">
The transcript database serves OncoKB metadata
included gene, transcript, sequence, etc. Only
required for local installations that will utilize the
/byGenomicChange and /byHGVSg endpoints
</p>
<DownloadButtonGroups
data={this.dataAvailability.result[0]}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ import GeneticTypeTabs, {
} from 'app/components/geneticTypeTabs/GeneticTypeTabs';
import InfoTile from 'app/components/infoTile/InfoTile';
import AnnotatedAlterations from 'app/pages/annotationPage/AnnotatedAlterations';
import { LinkedInLink, TwitterLink } from 'app/shared/links/SocialMediaLinks';
import { LinkedInLink } from 'app/shared/links/SocialMediaLinks';
import styles from './GenePage.module.scss';
import StickyMiniNavBar from 'app/shared/nav/StickyMiniNavBar';
import MiniNavBarHeader from 'app/shared/nav/MiniNavBarHeader';
Expand Down Expand Up @@ -106,8 +106,8 @@ const NoContent: FunctionComponent<{
<p className={'d-flex flex-column'}>
<div>Don’t miss out on the latest data releases and new features.</div>
<div>
Follow us on <LinkedInLink /> and <TwitterLink />, or subscribe to our
low-volume email list!
Follow us on <LinkedInLink /> or subscribe to our low-volume email
list!
</div>
</p>
<Button
Expand Down
4 changes: 4 additions & 0 deletions src/main/webapp/app/pages/newsPage/Links.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,16 @@ export const FdaApprovalLink: React.FunctionComponent<{
link: string;
approval: string;
year?: string;
for?: string;
}> = props => {
let linkText = 'FDA approval ';
if (props.year) {
linkText += `(${props.year}) `;
}
linkText += `of ${props.approval}`;
if (props.for) {
linkText += ` for ${props.for}`;
}
return <Linkout link={props.link}>{linkText}</Linkout>;
};
export const FdaWithdrawalLink: React.FunctionComponent<{
Expand Down
4 changes: 2 additions & 2 deletions src/main/webapp/app/pages/newsPage/NewsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ import { FdaApprovalLink } from 'app/pages/newsPage/Links';
import { LevelOfEvidencePageLink } from 'app/shared/links/LevelOfEvidencePageLink';
import {
LinkedInLink,
TwitterLink,
UserGoogleGroupLink,
} from 'app/shared/links/SocialMediaLinks';
import { Helmet } from 'react-helmet-async';
Expand Down Expand Up @@ -80,13 +79,14 @@ export default class NewsPage extends React.Component<{
<p>
<b>Stay tuned</b> for future data updates (improved annotations, new
alterations), as well as new features. You can follow us on{' '}
<LinkedInLink /> and <TwitterLink />, or subscribe to our{' '}
<LinkedInLink />, or subscribe to our{' '}
<UserGoogleGroupLink>low-volume email list</UserGoogleGroupLink> for
updates.
</p>
<CitationText />
</div>
<div className="mt-2">
<NewsList date={'12192024'} />
<NewsList date={'11262024'} />
<NewsList date={'10242024'} />
<NewsList date={'09252024'} />
Expand Down
Loading

0 comments on commit 9cec336

Please sign in to comment.