From 9be207e77e4de33381d3e645d68ba3c0505262c5 Mon Sep 17 00:00:00 2001 From: Manuel Holtgrewe Date: Mon, 5 Feb 2024 17:12:38 +0100 Subject: [PATCH] feat: more types in stores and slot in GenePathogenicityCard (#89) --- .../GenePathogenicityCard/GenePathogenicityCard.vue | 3 +++ src/stores/geneInfo/store.ts | 12 +++++++----- vitest.config.mts | 8 +++++++- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/src/components/GenePathogenicityCard/GenePathogenicityCard.vue b/src/components/GenePathogenicityCard/GenePathogenicityCard.vue index 512be69..d5f14ca 100644 --- a/src/components/GenePathogenicityCard/GenePathogenicityCard.vue +++ b/src/components/GenePathogenicityCard/GenePathogenicityCard.vue @@ -231,6 +231,9 @@ const props = withDefaults( + + + diff --git a/src/stores/geneInfo/store.ts b/src/stores/geneInfo/store.ts index cc85d73..4136c1d 100644 --- a/src/stores/geneInfo/store.ts +++ b/src/stores/geneInfo/store.ts @@ -7,10 +7,12 @@ import { defineStore } from 'pinia' import { ref } from 'vue' import { AnnonarsClient } from '../../api/annonars' -import { DottyClient } from '../../api/dotty' +import { DottyClient, TranscriptResult } from '../../api/dotty' import { type HpoTerm, VigunoClient } from '../../api/viguno' import { type GenomeBuild } from '../../lib/genomeBuilds' import { urlConfig } from '../../lib/urlConfig' +import { ClinvarPerGeneRecord } from '../../pbs/annonars/clinvar/per_gene' +import { Record as GeneInfoRecord } from '../../pbs/annonars/genes/base' import { StoreState } from '../types' export const useGeneInfoStore = defineStore('geneInfo', () => { @@ -21,16 +23,16 @@ export const useGeneInfoStore = defineStore('geneInfo', () => { const hgncId = ref(undefined) /** The retrieved gene data from annonars. */ - const geneInfo = ref(undefined) + const geneInfo = ref(undefined) /** The HPO terms retrieved from viguno. */ const hpoTerms = ref([]) /** ClinVar gene-related information from annoars. */ - const geneClinvar = ref(undefined) + const geneClinvar = ref(undefined) /** Transcript information from dotty (unless dotty API not available). */ - const transcripts = ref(undefined) + const transcripts = ref(undefined) function clearData() { storeState.value = StoreState.Initial @@ -88,7 +90,7 @@ export const useGeneInfoStore = defineStore('geneInfo', () => { hgncIdQuery, genomeBuild === 'grch37' ? 'GRCh37' : 'GRCh38' ) - transcripts.value = transcriptsData + transcripts.value = transcriptsData ?? undefined } } catch (e) { console.error('There was an error loading the gene data.', e) diff --git a/vitest.config.mts b/vitest.config.mts index 66bc91f..546c7cc 100644 --- a/vitest.config.mts +++ b/vitest.config.mts @@ -19,10 +19,16 @@ export default mergeConfig( provider: 'istanbul', reporter: ['text', 'html', 'clover', 'json'], include: [ + 'src/router/**/*.ts', + 'src/router/*.ts', 'src/lib/**/*.ts', + 'src/lib/*/*.ts', 'src/stores/**/*.ts', + 'src/stores/*/*.ts', 'src/components/**/*.{vue,ts}', - 'src/views/**/*.{vue,ts}' + 'src/components/*/*.ts', + 'src/views/**/*.{vue,ts}', + 'src/views/*/*.ts' ], exclude: ['**/*.spec.ts', '**/*.stories.ts'] },