Skip to content

Commit

Permalink
[Platform]: use displayVariant comp on clinvar evidence (#598)
Browse files Browse the repository at this point in the history
  • Loading branch information
carcruz authored Dec 6, 2024
1 parent 3dd8f9d commit 9f2b8b2
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 12 deletions.
29 changes: 17 additions & 12 deletions packages/sections/src/evidence/EVA/Body.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
ClinvarStars,
DirectionOfEffectIcon,
DirectionOfEffectTooltip,
DisplayVariantId,
} from "ui";

import {
Expand Down Expand Up @@ -110,16 +111,20 @@ function getColumns(label) {
{
id: "variantId",
label: "Variant",
renderCell: ({ variant: { id: variantId } }) =>
// trim long IDs and append '...'
variantId ? (
<>
{variantId.substring(0, 20)}
{variantId.length > 20 ? "\u2026" : ""}
</>
) : (
naLabel
),
renderCell: ({ variant }) => {
if (!variant) return naLabel;
const { id: variantId, referenceAllele, alternateAllele } = variant;
return (
<Link to={`/variant/${variantId}`}>
<DisplayVariantId
variantId={variantId}
referenceAllele={referenceAllele}
alternateAllele={alternateAllele}
expand={false}
/>
</Link>
);
},
},
{
id: "variantRsId",
Expand All @@ -139,8 +144,8 @@ function getColumns(label) {
{
id: "variantHgvsId",
label: "HGVS ID",
renderCell: ({ variant }) => variant.hgvsId || naLabel,
filterValue: ({ variant }) => `${variant.hgvsId}`,
renderCell: ({ variant }) => variant?.hgvsId || naLabel,
filterValue: ({ variant }) => `${variant?.hgvsId}`,
},
{
id: "studyId",
Expand Down
2 changes: 2 additions & 0 deletions packages/sections/src/evidence/EVA/ClinvarQuery.gql
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ query ClinvarQuery($ensemblId: String!, $efoId: String!, $size: Int!, $cursor: S
variant {
id
hgvsId
referenceAllele
alternateAllele
}
variantEffect
directionOnTrait
Expand Down

0 comments on commit 9f2b8b2

Please sign in to comment.