From f60ba40ba2dca75d383c0c9d583ef839b1398a03 Mon Sep 17 00:00:00 2001 From: Calvin Lu <59149377+calvinlu3@users.noreply.github.com> Date: Thu, 12 Sep 2024 13:12:20 -0400 Subject: [PATCH] Fix alt cat not deleted and add tooltip to alt cat badge --- .../mutation-collapsible/MutationCollapsibleTitle.tsx | 9 ++++++++- src/main/webapp/app/shared/modal/AddMutationModal.tsx | 8 ++++---- .../webapp/app/shared/model/firebase/firebase.model.ts | 3 +-- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/main/webapp/app/pages/curation/collapsible/mutation-collapsible/MutationCollapsibleTitle.tsx b/src/main/webapp/app/pages/curation/collapsible/mutation-collapsible/MutationCollapsibleTitle.tsx index 6a4b5691..2b622415 100644 --- a/src/main/webapp/app/pages/curation/collapsible/mutation-collapsible/MutationCollapsibleTitle.tsx +++ b/src/main/webapp/app/pages/curation/collapsible/mutation-collapsible/MutationCollapsibleTitle.tsx @@ -27,7 +27,14 @@ const MutationCollapsibleTitle = ({ name, mutationAlterations, alterationCategor
{alterationCategories.flags.map(flag => { const matchedFlagEntity = flagEntities.find(flagEntity => isFlagEqualToIFlag(flag, flagEntity)); - return ; + return ( + + ); })} {tooltipOverlay ? : undefined}
diff --git a/src/main/webapp/app/shared/modal/AddMutationModal.tsx b/src/main/webapp/app/shared/modal/AddMutationModal.tsx index 7df59fed..2d8b25dc 100644 --- a/src/main/webapp/app/shared/modal/AddMutationModal.tsx +++ b/src/main/webapp/app/shared/modal/AddMutationModal.tsx @@ -1044,6 +1044,8 @@ function AddMutationModal({ if (field === 'comment') { setStringMutationComment(value as string); } else if (field === 'flags') { + /* eslint-disable no-console */ + console.log('value is ', value); const flagOptions = value as DropdownOption[]; setSelectedStringMutationFlags(flagOptions.map(option => option.value)); } @@ -1199,7 +1201,7 @@ function AddMutationModal({ async function handleAlterationCategoriesConfirm() { let newAlterationCategories: AlterationCategories | null = new AlterationCategories(); - if (stringMutationComment === '' && selectedStringMutationFlags.length === 0) { + if (selectedStringMutationFlags.length === 0) { newAlterationCategories = null; } else { newAlterationCategories.comment = stringMutationComment; @@ -1240,9 +1242,7 @@ function AddMutationModal({ newMutation.name = newAlterations.map(alteration => alteration.name).join(', '); newMutation.alterations = newAlterations; const newAlterationCategories = await handleAlterationCategoriesConfirm(); - if (newAlterationCategories) { - newMutation.alteration_categories = newAlterationCategories; - } + newMutation.alteration_categories = newAlterationCategories; setErrorMessagesEnabled(false); setIsConfirmPending(true); diff --git a/src/main/webapp/app/shared/model/firebase/firebase.model.ts b/src/main/webapp/app/shared/model/firebase/firebase.model.ts index eeb3b29e..3962ade0 100644 --- a/src/main/webapp/app/shared/model/firebase/firebase.model.ts +++ b/src/main/webapp/app/shared/model/firebase/firebase.model.ts @@ -4,7 +4,6 @@ import { AlterationTypeEnum, Gene as OncoKBGene } from 'app/shared/api/generated import { generateUuid } from 'app/shared/util/utils'; import _ from 'lodash'; import { ICancerType } from '../cancer-type.model'; -import { IFlag } from '../flag.model'; export type MetaCollection = { [hugoSymbol: string]: Meta; @@ -215,7 +214,7 @@ export class Mutation { mutation_effect: MutationEffect = new MutationEffect(); mutation_effect_uuid: string = generateUuid(); mutation_effect_comments?: Comment[] = []; // used for somatic - alteration_categories?: AlterationCategories; + alteration_categories?: AlterationCategories | null; name: string = ''; name_comments?: Comment[] = []; name_review?: Review;