Skip to content

Commit

Permalink
Make disease context qualifier a link, drive by cleanup of 'already o…
Browse files Browse the repository at this point in the history
…n this page' check
  • Loading branch information
kevinschaper committed Oct 17, 2024
1 parent 4c42ee6 commit 5117639
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion frontend/src/components/AppNodeBadge.vue
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ const info = computed(() =>
const isLink = computed(() => {
/** make sure we're already on page we're linking to */
return (
!window.location.pathname.endsWith("/node/" + (props.node.id || "")) &&
!window.location.pathname.endsWith("/" + (props.node.id || "")) &&
/** make sure id is a valid curie */
!!props.node.id?.match(/^\w/)
);
Expand Down
15 changes: 12 additions & 3 deletions frontend/src/pages/node/AssociationsTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,16 @@
: row.subject_taxon_label
}}
</template>
<template #disease_context_qualifier="{ row }">
{{ row.disease_context_qualifier_label }}
<template #disease_context="{ row }">
<AppNodeBadge
v-if="row.disease_context_qualifier"
:node="{
id: row.disease_context_qualifier,
name: row.disease_context_qualifier_label,
category: 'biolink:Disease',
}"
/>
<span v-else class="empty">No info</span>
</template>
<!-- phenotype specific -->
<!-- no template needed because info just plain text -->
Expand Down Expand Up @@ -225,7 +233,8 @@ const cols = computed((): Cols<Datum> => {
props.category.id.includes("GeneToPhenotypicFeature")
) {
extraCols.push({
key: "disease_context_qualifier_label",
slot: "disease_context",
key: "disease_context_qualifier",
heading: "Disease Context",
sortable: true,
});
Expand Down

0 comments on commit 5117639

Please sign in to comment.