Skip to content

Commit

Permalink
fix: make StrucvarGeneListCard work without gene-details route (#143)
Browse files Browse the repository at this point in the history
  • Loading branch information
holtgrewe authored Feb 23, 2024
1 parent eb519cc commit 39de318
Showing 1 changed file with 20 additions and 11 deletions.
31 changes: 20 additions & 11 deletions src/components/StrucvarGeneListCard/GeneListEntry.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<script setup lang="ts">
import { computed } from 'vue'
import { useRouter } from 'vue-router'
import { type GenomeBuild } from '../../lib/genomeBuilds'
import GeneDosage from './GeneDosage.vue'
Expand All @@ -18,6 +19,12 @@ const props = defineProps<{
/** This component's emits. */
const emit = defineEmits(['toggleSelected'])
/** The global router. */
const router = useRouter()
/** Whether or not a gene detail route exists. */
const hasGeneDetailsRoute = router.hasRoute('gene-details')
/**
* Pick smallest of the shortest RefSeq transcript IDs.
*
Expand Down Expand Up @@ -75,17 +82,19 @@ const sortIcon = computed<string>(() => {
</div>
<div>
{{ pickRefSeqId(item.raw.dbnsfp?.refseqId) }}
|
<router-link
style="cursor: pointer"
title="go to Gene details page"
:to="{
name: 'gene-details',
params: { gene: item.raw.hgnc.symbol }
}"
>
<v-icon>mdi-arrow-right-circle-outline</v-icon>
</router-link>
<template v-if="hasGeneDetailsRoute">
|
<router-link
style="cursor: pointer"
title="go to Gene details page"
:to="{
name: 'gene-details',
params: { gene: item.raw.hgnc.symbol }
}"
>
<v-icon>mdi-arrow-right-circle-outline</v-icon>
</router-link>
</template>
</div>
</div>
</v-col>
Expand Down

0 comments on commit 39de318

Please sign in to comment.