Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main/webapp/app/components/tabs/CurationToolsTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ export function CurationToolsTab({
{!isGermline && (
<Row className="border-top pt-3">
<Col>
<SaveGeneButton hugoSymbol={hugoSymbol} />
<SaveGeneButton isGermline={isGermline} hugoSymbol={hugoSymbol} />
</Col>
</Row>
)}
Expand Down
4 changes: 2 additions & 2 deletions src/main/webapp/app/components/tabs/GeneListPageToolsTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,10 @@ function GeneListPageToolsTab({ metaData, isDev, createGene, isGermline }: IGene
<EvidenceDownloader />
</div>
</Row>
{!isGermline && isDev && (
{isDev && (
<Row className="pt-3 border-top mb-3">
<div>
<SaveGeneButton />
<SaveGeneButton isGermline={isGermline!} />
</div>
</Row>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -686,6 +686,7 @@ export class FirebaseGeneService {
);
const data = searchResponse.data;
const args: Parameters<typeof getDriveAnnotations>[1] = {
isGermline: isGermlineProp,
gene: nullableGene == null ? undefined : nullableGene,
vus: nullableVus == null ? undefined : Object.values(nullableVus),
releaseGene: data.some(gene => geneIsReleased(gene, isGermlineProp)),
Expand Down
4 changes: 2 additions & 2 deletions src/main/webapp/app/shared/button/SaveGeneButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ import { AsyncSaveButton } from './AsyncSaveButton';
import { notifyError, notifySuccess } from 'app/oncokb-commons/components/util/NotificationUtils';

type ISaveGeneButtonProps = StoreProps & {
isGermline: boolean;
hugoSymbol?: string;
} & ButtonProps &
Omit<React.HTMLAttributes<HTMLButtonElement>, 'onClick' | 'disabled'>;

function SaveGeneButton({ hugoSymbol, firebaseGeneService, ...buttonProps }: ISaveGeneButtonProps) {
function SaveGeneButton({ isGermline, hugoSymbol, firebaseGeneService, ...buttonProps }: ISaveGeneButtonProps) {
const [isSavePending, setIsSavePending] = useState(false);
const onClickHandler = useCallback(async () => {
setIsSavePending(true);
try {
const isGermline = false;
if (hugoSymbol === undefined) {
await firebaseGeneService?.saveAllGenes(isGermline);
notifySuccess('All genes saved!');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,12 @@ function getDrugsByUuids(keys: string[][], drugList: DrugCollection): Drug[][] {
});
}

export type DriveAnnotation = { gene: string | undefined; vus: string | undefined; releaseGene: boolean };
export type DriveAnnotation = { gene: string | undefined; vus: string | undefined; releaseGene: boolean; germline: boolean | undefined };
export function getDriveAnnotations(
drugList: DrugCollection,
{ gene, vus, releaseGene }: { gene: Gene | undefined; vus: Vus[] | undefined; releaseGene: boolean },
{ gene, vus, releaseGene, isGermline }: { gene: Gene | undefined; vus: Vus[] | undefined; releaseGene: boolean; isGermline: boolean },
): DriveAnnotation {
const params: DriveAnnotation = { gene: undefined, vus: undefined, releaseGene: false };
const params: DriveAnnotation = { gene: undefined, vus: undefined, releaseGene: false, germline: undefined };
if (gene !== undefined) {
const geneData = getGeneData(gene, drugList);
if (geneData !== undefined) {
Expand All @@ -152,5 +152,8 @@ export function getDriveAnnotations(
if (releaseGene) {
params.releaseGene = releaseGene;
}
if (isGermline) {
params.germline = isGermline;
}
return params;
}