Skip to content

Commit 6806192

Browse files
committed
support saving germline genes
1 parent 952e6ce commit 6806192

File tree

5 files changed

+12
-8
lines changed

5 files changed

+12
-8
lines changed

src/main/webapp/app/components/tabs/CurationToolsTab.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ export function CurationToolsTab({
209209
{!isGermline && (
210210
<Row className="border-top pt-3">
211211
<Col>
212-
<SaveGeneButton hugoSymbol={hugoSymbol} />
212+
<SaveGeneButton isGermline={isGermline} hugoSymbol={hugoSymbol} />
213213
</Col>
214214
</Row>
215215
)}

src/main/webapp/app/components/tabs/GeneListPageToolsTab.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,10 @@ function GeneListPageToolsTab({ metaData, isDev, createGene, isGermline }: IGene
9292
<EvidenceDownloader />
9393
</div>
9494
</Row>
95-
{!isGermline && isDev && (
95+
{isDev && (
9696
<Row className="pt-3 border-top mb-3">
9797
<div>
98-
<SaveGeneButton />
98+
<SaveGeneButton isGermline={isGermline!} />
9999
</div>
100100
</Row>
101101
)}

src/main/webapp/app/service/firebase/firebase-gene-service.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -686,6 +686,7 @@ export class FirebaseGeneService {
686686
);
687687
const data = searchResponse.data;
688688
const args: Parameters<typeof getDriveAnnotations>[1] = {
689+
isGermline: isGermlineProp,
689690
gene: nullableGene == null ? undefined : nullableGene,
690691
vus: nullableVus == null ? undefined : Object.values(nullableVus),
691692
releaseGene: data.some(gene => geneIsReleased(gene, isGermlineProp)),

src/main/webapp/app/shared/button/SaveGeneButton.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@ import { AsyncSaveButton } from './AsyncSaveButton';
77
import { notifyError, notifySuccess } from 'app/oncokb-commons/components/util/NotificationUtils';
88

99
type ISaveGeneButtonProps = StoreProps & {
10+
isGermline: boolean;
1011
hugoSymbol?: string;
1112
} & ButtonProps &
1213
Omit<React.HTMLAttributes<HTMLButtonElement>, 'onClick' | 'disabled'>;
1314

14-
function SaveGeneButton({ hugoSymbol, firebaseGeneService, ...buttonProps }: ISaveGeneButtonProps) {
15+
function SaveGeneButton({ isGermline, hugoSymbol, firebaseGeneService, ...buttonProps }: ISaveGeneButtonProps) {
1516
const [isSavePending, setIsSavePending] = useState(false);
1617
const onClickHandler = useCallback(async () => {
1718
setIsSavePending(true);
1819
try {
19-
const isGermline = false;
2020
if (hugoSymbol === undefined) {
2121
await firebaseGeneService?.saveAllGenes(isGermline);
2222
notifySuccess('All genes saved!');

src/main/webapp/app/shared/util/core-drive-annotation-submission/core-drive-annotation-submission.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,12 +134,12 @@ function getDrugsByUuids(keys: string[][], drugList: DrugCollection): Drug[][] {
134134
});
135135
}
136136

137-
export type DriveAnnotation = { gene: string | undefined; vus: string | undefined; releaseGene: boolean };
137+
export type DriveAnnotation = { gene: string | undefined; vus: string | undefined; releaseGene: boolean; germline: boolean | undefined };
138138
export function getDriveAnnotations(
139139
drugList: DrugCollection,
140-
{ gene, vus, releaseGene }: { gene: Gene | undefined; vus: Vus[] | undefined; releaseGene: boolean },
140+
{ gene, vus, releaseGene, isGermline }: { gene: Gene | undefined; vus: Vus[] | undefined; releaseGene: boolean; isGermline: boolean },
141141
): DriveAnnotation {
142-
const params: DriveAnnotation = { gene: undefined, vus: undefined, releaseGene: false };
142+
const params: DriveAnnotation = { gene: undefined, vus: undefined, releaseGene: false, germline: undefined };
143143
if (gene !== undefined) {
144144
const geneData = getGeneData(gene, drugList);
145145
if (geneData !== undefined) {
@@ -152,5 +152,8 @@ export function getDriveAnnotations(
152152
if (releaseGene) {
153153
params.releaseGene = releaseGene;
154154
}
155+
if (isGermline) {
156+
params.germline = isGermline;
157+
}
155158
return params;
156159
}

0 commit comments

Comments
 (0)