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

[Platform]: use displayVariant comp on clinvar evidence #598

Merged
merged 1 commit into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
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
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
Loading