Skip to content

Commit

Permalink
fix: all converted links go to correct dictybase address
Browse files Browse the repository at this point in the history
  • Loading branch information
erichartline committed Nov 30, 2018
1 parent 80e133c commit f6d8350
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions src/features/Ontology/utils/withLinkGenerator.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,21 @@
*/

const withLinkGenerator = (id: string, db: string, name: ?string) => {
let baseUrl
if (process.env.NODE_ENV === "production") {
baseUrl = `/${process.env.REACT_APP_BASENAME}/`
} else {
baseUrl = "/"
}
if (id === undefined) {
return "#"
}
// if using converted gene name, link to gene page not uniprot
if (name && name.length < 10) {
return `${baseUrl}${name}`
if (name) {
return `/${name}`
}
switch (db) {
case "CHEBI": {
return `https://www.ebi.ac.uk/chebi/searchId.do?chebiId=CHEBI:${id}`
}
case "DDB":
return `${baseUrl}${id}`
return `/${id}`
case "dictyBase":
return `${baseUrl}${id}`
return `/${id}`
case "FB":
return `http://flybase.org/reports/${id}.html`
case "GO":
Expand Down

0 comments on commit f6d8350

Please sign in to comment.