diff --git a/frontend/src/components/AcmgCriteriaCard.vue b/frontend/src/components/AcmgCriteriaCard.vue new file mode 100644 index 00000000..920e101d --- /dev/null +++ b/frontend/src/components/AcmgCriteriaCard.vue @@ -0,0 +1,105 @@ + + + + + diff --git a/frontend/src/components/VariantDetails/AcmgRating.vue b/frontend/src/components/VariantDetails/AcmgRating.vue index 19342096..2879c7f9 100644 --- a/frontend/src/components/VariantDetails/AcmgRating.vue +++ b/frontend/src/components/VariantDetails/AcmgRating.vue @@ -4,15 +4,13 @@ import { computed, onMounted, ref, watch } from 'vue' import { StoreState } from '@/stores/misc' import { useVariantAcmgRatingStore } from '@/stores/variantAcmgRating' import { type SmallVariant } from '@/stores/variantInfo' +import AcmgCriteriaCard from '@/components/AcmgCriteriaCard.vue' import { - AcmgCriteria, - StateSource, Presence, ALL_ACMG_CRITERIA, ACMG_EVIDENCE_LEVELS_PATHOGENIC, ACMG_EVIDENCE_LEVELS_BENIGN, - ACMG_CRITERIA_DEFS, - AcmgEvidenceLevel + ACMG_CRITERIA_DEFS } from '@/lib/acmgSeqVar' const props = defineProps({ @@ -48,35 +46,6 @@ const calculateAcmgRating = computed((): string => { return acmgClass }) -const findSwitchColor = (criteria: AcmgCriteria): string => { - const evidence = acmgRatingStore.acmgRating.getCriteriaState(criteria).evidenceLevel - if (evidence === AcmgEvidenceLevel.PathogenicVeryStrong) { - return 'red-accent-4' - } else if (evidence === AcmgEvidenceLevel.PathogenicStrong) { - return 'orange-darken-4' - } else if (evidence === AcmgEvidenceLevel.PathogenicModerate) { - return 'amber-darken-4' - } else if (evidence === AcmgEvidenceLevel.PathogenicSupporting) { - return 'yellow-darken-3' - } else if (evidence === AcmgEvidenceLevel.BenignStandalone) { - return 'green-darken-4' - } else if (evidence === AcmgEvidenceLevel.BenignStrong) { - return 'light-green' - } else if (evidence === AcmgEvidenceLevel.BenignSupporting) { - return 'lime' - } else { - return 'primary' - } -} - -const switchCriteria = (criteria: AcmgCriteria, presence: Presence) => { - if (presence === Presence.Present) { - acmgRatingStore.acmgRating.setPresence(StateSource.User, criteria, Presence.Absent) - } else { - acmgRatingStore.acmgRating.setPresence(StateSource.User, criteria, Presence.Present) - } -} - watch( () => [props.smallVariant, acmgRatingStore.storeState], async () => { @@ -153,19 +122,10 @@ onMounted(async () => { ) " > - @@ -183,19 +143,10 @@ onMounted(async () => { ) " > - @@ -221,44 +172,11 @@ onMounted(async () => { Presence.Present || showFailed " > - -
- - - - -
- - -
+