Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: make StrucvarGeneListCard work without gene-details route #143

Merged
merged 1 commit into from
Feb 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading