diff --git a/src/main/webapp/app/shared/badge/NotCuratableBadge.tsx b/src/main/webapp/app/shared/badge/NotCuratableBadge.tsx index fec0d1240..71c22f1c6 100644 --- a/src/main/webapp/app/shared/badge/NotCuratableBadge.tsx +++ b/src/main/webapp/app/shared/badge/NotCuratableBadge.tsx @@ -2,9 +2,11 @@ import React, { useMemo } from 'react'; import DefaultBadge from './DefaultBadge'; import { IRootStore } from 'app/stores'; import { componentInject } from '../util/typed-inject'; -import { getMutationName } from '../util/firebase/firebase-utils'; +import { getMutationName, isMutationEffectCuratable } from '../util/firebase/firebase-utils'; import { RADIO_OPTION_NONE } from 'app/config/constants/constants'; import { observer } from 'mobx-react'; +import { CategoricalAlterationType } from '../model/enumerations/categorical-alteration-type.model'; +import { parseAlterationName } from '../util/utils'; const NOT_CURATABLE_TOOLTIP_TEXT = { stringMutations: 'Each mutation should have its own mutation effect curated', @@ -22,6 +24,10 @@ const NotCuratableBadge: React.FunctionComponent = ({ m const mutationStrings: [string[], string[]] = [[], []]; for (const name of mutationName.split(',')) { const trimmedName = name.trim(); + if (!isMutationEffectCuratable(trimmedName)) { + continue; + } + const foundMutation = mutations?.find(mut => getMutationName(mut.name, mut.alterations) === trimmedName); if (!foundMutation?.mutation_effect.effect || foundMutation.mutation_effect.effect === RADIO_OPTION_NONE) { @@ -41,9 +47,13 @@ const NotCuratableBadge: React.FunctionComponent = ({ m tooltipOverlay={
{text} -
-
- {mutationsWithoutEffect.length > 1 && ( + {(mutationsWithEffect || mutationsWithoutEffect) && ( + <> +
+
+ + )} + {mutationsWithoutEffect && ( <> Need curation: @@ -52,7 +62,7 @@ const NotCuratableBadge: React.FunctionComponent = ({ m
)} - {mutationsWithEffect.length > 1 && ( + {mutationsWithEffect && ( Curated: {mutationsWithEffect}