Skip to content

Commit

Permalink
Merge pull request #1309 from alliance-genome/SCRUM-3986
Browse files Browse the repository at this point in the history
SCRUM-3986 update StrainBackground identifier
  • Loading branch information
adamgibs authored Apr 29, 2024
2 parents 36c279d + fbd317c commit b4f7df5
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/components/dataTable/StrainBackground.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
import ExternalLink from '../ExternalLink';
import { getIdentifier } from './utils';


function StrainBackground({strainBackground}) {
if(strainBackground?.curie && strainBackground?.name) {
const strainName = <span dangerouslySetInnerHTML={{__html: strainBackground.name}}/>;
const strain = strainBackground.curie.slice('SGD:'.length);
return <ExternalLink href={`https://www.yeastgenome.org/strain/${strain}`}>{strainName}</ExternalLink>;
}
return <></>;
const indentifier = getIdentifier(strainBackground);

if(!indentifier || !strainBackground?.name) return null;

const strainName = <span dangerouslySetInnerHTML={{__html: strainBackground.name}}/>;
const strain = indentifier.slice('SGD:'.length);

return <ExternalLink href={`https://www.yeastgenome.org/strain/${strain}`}>{strainName}</ExternalLink>;
}

export default StrainBackground;

0 comments on commit b4f7df5

Please sign in to comment.