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

SCRUM-4012 add reference name lookup for mod references #1318

Merged
merged 1 commit into from
May 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
6 changes: 5 additions & 1 deletion src/components/dataTable/AnnotatedEntitiesPopupCuration.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ import StrainBackground from './StrainBackground';

function renderLink(entity) {
const curie = getIdentifier(entity.diseaseAnnotationSubject);
const url = getResourceUrl(curie, entity.diseaseAnnotationSubject.type, entity.diseaseAnnotationSubject.subtype)
const url = getResourceUrl({
curie,
type: entity.diseaseAnnotationSubject.type,
subtype: entity.diseaseAnnotationSubject.subtype
})

if (entity.type === 'AlleleDiseaseAnnotation') {
const innerText = entity.diseaseAnnotationSubject.alleleSymbol ? entity.diseaseAnnotationSubject.alleleSymbol.displayText : entity.diseaseAnnotationSubject.name;
Expand Down
2 changes: 1 addition & 1 deletion src/components/dataTable/GeneticModifiersCellCuration.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function GeneticModifierLink(modifier) {
}
break;
case 'AffectedGenomicModel':
let url = getResourceUrl(identifier, modifier.type, modifier.subtype);
let url = getResourceUrl({ curie: identifier, type: modifier.type, subtype: modifier.subtype});
if (url && modifier.name) {
return (
<ExternalLink href={url}>
Expand Down
2 changes: 1 addition & 1 deletion src/components/dataTable/getResourceUrl.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { resourceDescriptors } from "../../resourceDescriptors";

export const getResourceUrl = (curie, type, subtype ) => {
export const getResourceUrl = ({ curie, type, subtype }) => {
const [prefix, id] = curie.split(':');

let resource;
Expand Down
7 changes: 6 additions & 1 deletion src/components/dataTable/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,12 @@ export const getIsViaOrthology = (annotation) => {
};

export const getSingleReferenceUrl = (pubModId) => {
const url = getResourceUrl(pubModId);
let url;
if(pubModId.includes("PMID")){
url = getResourceUrl({curie: pubModId});
} else {
url = getResourceUrl({curie: pubModId, type: "reference"});
}
return {pubModId, url};
}

Expand Down
Loading