Skip to content

Commit

Permalink
Add mutation list sorting options and review filter (oncokb#344)
Browse files Browse the repository at this point in the history
add reviewed filter to mutation list
  • Loading branch information
bprize15 authored Jun 7, 2024
1 parent 220753a commit 4adbb8a
Show file tree
Hide file tree
Showing 12 changed files with 492 additions and 173 deletions.
11 changes: 7 additions & 4 deletions src/main/webapp/app/config/sentry-error.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
import * as Sentry from '@sentry/react';

export function notifySentryException(errorMessage, data: Record<string, unknown>) {
return Sentry.captureException(errorMessage, scope => {
scope.setExtra('functionArgs', JSON.stringify(data));
return scope;
});
}
export class SentryError extends Error {
public sentryId: string;
constructor(errMessage: string, data: any) {
super(errMessage);

this.name = 'SentryError';

this.sentryId = Sentry.captureException(errMessage, scope => {
scope.setExtra('functionArgs', JSON.stringify(data));
return scope;
});
this.sentryId = notifySentryException(errMessage, data);
}
}
5 changes: 3 additions & 2 deletions src/main/webapp/app/pages/curation/CurationPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { connect } from 'app/shared/util/typed-inject';
import { IRootStore } from 'app/stores';
import { RouteComponentProps, useLocation } from 'react-router-dom';
import { getFirebaseGenePath, getFirebaseHistoryPath, getFirebaseMetaGenePath } from 'app/shared/util/firebase/firebase-utils';
import { HistoryRecord } from 'app/shared/model/firebase/firebase.model';
import { Col, Row } from 'reactstrap';
import { getSectionClassName } from 'app/shared/util/utils';
import { GENE_TYPE, GENE_TYPE_KEY, INHERITANCE_MECHANISM_OPTIONS, READABLE_FIELD, PENETRANCE_OPTIONS } from 'app/config/constants/firebase';
Expand Down Expand Up @@ -52,7 +51,8 @@ export const CurationPage = (props: ICurationPageProps) => {
const firebaseHistoryPath = getFirebaseHistoryPath(isGermline, hugoSymbol);
const mutationsPath = `${firebaseGenePath}/mutations`;
const genomicIndicatorsPath = `${firebaseGenePath}/genomic_indicators`;
const firebaseMetaCurrentReviewerPath = `${getFirebaseMetaGenePath(isGermline, hugoSymbol)}/review/currentReviewer`;
const firebaseMetaGeneReviewPath = `${getFirebaseMetaGenePath(isGermline, hugoSymbol)}/review`;
const firebaseMetaCurrentReviewerPath = `${firebaseMetaGeneReviewPath}/currentReviewer`;

useEffect(() => {
props.searchGeneEntities({ query: hugoSymbolParam, exact: true });
Expand Down Expand Up @@ -234,6 +234,7 @@ export const CurationPage = (props: ICurationPageProps) => {
<div ref={mutationsSectionRef}>
<MutationsSection
mutationsPath={mutationsPath}
metaGeneReviewPath={firebaseMetaGeneReviewPath}
hugoSymbol={hugoSymbol}
isGermline={isGermline}
parsedHistoryList={tooltipHistoryList}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import { Alteration, Review } from 'app/shared/model/firebase/firebase.model';
import DefaultTooltip from 'app/shared/tooltip/DefaultTooltip';
import { FlattenedHistory } from 'app/shared/util/firebase/firebase-history-utils';
import {
findNestedUuids,
getFirebaseGenePath,
getFirebaseVusPath,
getMutationName,
Expand All @@ -36,11 +35,12 @@ import { IRootStore } from 'app/stores';
import { get, onValue, ref } from 'firebase/database';
import _ from 'lodash';
import { observer } from 'mobx-react';
import React, { useEffect, useMemo, useState } from 'react';
import React, { useCallback, useEffect, useMemo, useState } from 'react';
import { Button } from 'reactstrap';
import BadgeGroup from '../BadgeGroup';
import { DeleteSectionButton } from '../button/DeleteSectionButton';
import FirebaseList from '../list/FirebaseList';
import MutationLastModified from '../mutation/mutation-last-modified';
import MutationLevelSummary from '../nestLevelSummary/MutationLevelSummary';
import * as styles from '../styles.module.scss';
import CancerTypeCollapsible from './CancerTypeCollapsible';
Expand All @@ -56,6 +56,7 @@ export interface IMutationCollapsibleProps extends StoreProps {
disableOpen?: boolean;
onToggle?: () => void;
parsedHistoryList: Map<string, FlattenedHistory[]>;
showLastModified?: boolean;
}

const MutationCollapsible = ({
Expand All @@ -73,6 +74,7 @@ const MutationCollapsible = ({
modifyCancerTypeModalStore,
annotatedAltsCache,
genomicIndicators,
showLastModified,
}: IMutationCollapsibleProps) => {
const firebaseMutationsPath = `${getFirebaseGenePath(isGermline, hugoSymbol)}/mutations`;

Expand Down Expand Up @@ -171,6 +173,20 @@ const MutationCollapsible = ({
return () => callbacks.forEach(callback => callback?.());
}, [mutationPath, firebaseDb]);

const cancerTypeCollapsibleBuilder = useCallback(
index => {
return (
<CancerTypeCollapsible
allCancerTypesPath={`${mutationPath}/tumors`}
cancerTypePath={`${mutationPath}/tumors/${index}`}
mutationName={mutationName}
parsedHistoryList={parsedHistoryList}
/>
);
},
[mutationPath, mutationName, parsedHistoryList],
);

async function handleDeleteMutation(toVus = false) {
const snapshot = await get(ref(firebaseDb, mutationPath));
await deleteSection(`${mutationPath}/name`, snapshot.val(), mutationNameReview, mutationUuid, toVus);
Expand Down Expand Up @@ -202,6 +218,9 @@ const MutationCollapsible = ({
onToggle={() => !isMutationPendingDelete && onToggle()}
info={
<>
{showLastModified && (
<MutationLastModified className="me-2" mutationUuid={mutationUuid} hugoSymbol={hugoSymbol} isGermline={isGermline} />
)}
<MutationLevelSummary mutationPath={mutationPath} hideOncogenicity={isStringMutation} />
{hotspots.length > 0 && <HotspotIcon associatedHotspots={hotspots} />}
{exonRanges.length > 0 && (
Expand Down Expand Up @@ -466,20 +485,7 @@ const MutationCollapsible = ({
</Collapsible>
</>
)}
<FirebaseList
path={`${mutationPath}/tumors`}
pushDirection="back"
itemBuilder={index => {
return (
<CancerTypeCollapsible
allCancerTypesPath={`${mutationPath}/tumors`}
cancerTypePath={`${mutationPath}/tumors/${index}`}
mutationName={mutationName}
parsedHistoryList={parsedHistoryList}
/>
);
}}
/>
<FirebaseList path={`${mutationPath}/tumors`} pushDirection="back" itemBuilder={cancerTypeCollapsibleBuilder} />
<Button
className={'mt-2 mb-1'}
outline
Expand Down
Loading

0 comments on commit 4adbb8a

Please sign in to comment.