Skip to content

Commit

Permalink
Merge pull request #1137 from zhx828/update-me-description
Browse files Browse the repository at this point in the history
Separate leading sentence when ME comes from relevant alteration
  • Loading branch information
zhx828 authored Jul 31, 2024
2 parents 43fab0d + 722c3b0 commit 656adb4
Showing 1 changed file with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const MutationEffectDescription: React.FunctionComponent<{
// Add link to alteration page when the allele is unknown but multiple alternative alleles at the same position have mutation effects
const description = props.description || '';
const additionalMutationEffectSeparator =
'however, we have mutation effect descriptions for';
'we have mutation effect description';
if (description.includes(additionalMutationEffectSeparator)) {
const segments = description.split(additionalMutationEffectSeparator);
if (segments.length === 2) {
Expand Down Expand Up @@ -49,6 +49,23 @@ const MutationEffectDescription: React.FunctionComponent<{
}
}
}

// Separate leading sentence when mutation effect comes from relevant alteration
const relevantAltMutationEffectSeparator = ' is: ';
if (description.includes(relevantAltMutationEffectSeparator)) {
const segments = description.split(relevantAltMutationEffectSeparator);
if (segments.length === 2) {
return (
<div>
<p>
{segments[0]} {relevantAltMutationEffectSeparator}
</p>
<SummaryWithRefs content={segments[1]} type="linkout" />
</div>
);
}
}

// don't do anything but add reference links in the description
return <SummaryWithRefs content={props.description} type="linkout" />;
};
Expand Down

0 comments on commit 656adb4

Please sign in to comment.