Skip to content

Commit

Permalink
Merge branch 'stage' into update_cdk_jbrowse
Browse files Browse the repository at this point in the history
  • Loading branch information
oblodgett authored May 1, 2024
2 parents 690445a + 96047c4 commit f632691
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 23 deletions.
2 changes: 1 addition & 1 deletion cdk/cdk-app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ new AmplifyALBStack(app, 'stage-alb-stack', {
new AmplifyALBStack(app, 'test-alb-stack', {
stackName: 'test-alb-stack',
dnsName: 'test',
targetInstanceId: 'i-003fafec7d050fd97',
targetInstanceId: 'i-0ccfdcd8c43104be5',
env: {
region: process.env.CDK_DEFAULT_REGION,
account: process.env.CDK_DEFAULT_ACCOUNT,
Expand Down
4 changes: 2 additions & 2 deletions src/components/dataTable/AnnotatedEntitiesPopupCuration.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,11 @@ function AnnotatedEntitiesPopupCuration({ children, entities, parentPage, mainRo
<td>{renderLink(entity)}</td>
<td><TypeCellCuration subject={entity.diseaseAnnotationSubject}/></td>
<td><AssociationCellCuration association={entity.relation?.name}/></td>
{ parentPage === 'gene' || 'disease' ? <td><AssertedGenes assertedGenes={entity.assertedGenes} mainRowCurie={mainRowCurie}/></td> : <></>}
{ parentPage === 'gene' || parentPage === 'disease' ? <td><AssertedGenes assertedGenes={entity.assertedGenes} mainRowCurie={mainRowCurie}/></td> : <></>}
<td><ExperimentalConditionCellCuration conditions={entity.conditionRelations}/></td>
<td><ExperimentalConditionCellCuration conditions={entity.conditionModifiers}/></td>
<td><GeneticModifiersCellCuration relation={entity.diseaseGeneticModifierRelation} modifiers={entity.diseaseGeneticModifiers}/></td>
{ parentPage === 'gene' || 'disease' ? <td><StrainBackground strainBackground={entity.sgdStrainBackground}/></td> : <></> }
{ parentPage === 'gene' || parentPage === 'disease' ? <td><StrainBackground strainBackground={entity.sgdStrainBackground}/></td> : <></> }
<td><GeneticSex geneticSex={entity.geneticSex}/></td>
<td><RelatedNotes className={style.relatedNotes} relatedNotes={entity.relatedNotes}/></td>
<td><AnnotationType annotationType={entity.annotationType}/></td>
Expand Down
8 changes: 5 additions & 3 deletions src/components/dataTable/GeneticModifiersCellCuration.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,30 @@ import { CollapsibleList } from '../collapsibleList';
import ExternalLink from '../ExternalLink';
import { getResourceUrl } from './getResourceUrl';
import { Link } from 'react-router-dom';
import { getIdentifier } from './utils';


function GeneticModifierLink(modifier) {
const identifier = getIdentifier(modifier);
switch(modifier?.type) {
case 'Gene':
if (modifier.geneSymbol) {
return (
<Link to={`/gene/${modifier.curie}`} target='_blank'>
<Link to={`/gene/${identifier}`} target='_blank'>
<span dangerouslySetInnerHTML={{__html: modifier.geneSymbol.displayText}}/>
</Link>);
}
break;
case 'Allele':
if (modifier.alleleSymbol) {
return (
<Link to={`/allele/${modifier.curie}`} target='_blank'>
<Link to={`/allele/${identifier}`} target='_blank'>
<span dangerouslySetInnerHTML={{__html: modifier.alleleSymbol.displayText}}/>
</Link>);
}
break;
case 'AffectedGenomicModel':
let url = getResourceUrl(modifier.curie, modifier.type, modifier.subtype);
let url = getResourceUrl(identifier, modifier.type, modifier.subtype);
if (url && modifier.name) {
return (
<ExternalLink href={url}>
Expand Down
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;
19 changes: 10 additions & 9 deletions src/components/dataTable/basedOnGeneCellCuration.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
import { Link } from 'react-router-dom';
import { shortSpeciesName } from '../../lib/utils';
import { CollapsibleList } from '../../components/collapsibleList';
import { removeDuplicates } from './utils';
import { getIdentifier, removeDuplicates } from './utils';
import GeneSymbolCuration from '../GeneSymbolCuration';

const GeneLink = ({ gene }) => {
const identifier = getIdentifier(gene);
return (
<Link key={identifier} to={`/gene/${identifier}`}>
<GeneSymbolCuration gene={gene} /> ({shortSpeciesName(gene.taxon.curie)})
</Link>);
};
const BasedOnGeneCellCuration = (genes) => {
if (!genes) {
return null;
}
if (!genes) return null;
const uniqueGenes = removeDuplicates(genes, (gene) => gene.geneSymbol.displayText);
return (
<CollapsibleList collapsedSize={uniqueGenes.length}>
{uniqueGenes.map(gene => (
<Link key={gene.curie} to={`/gene/${gene.curie}`}>
<GeneSymbolCuration gene={gene} /> ({shortSpeciesName(gene.taxon.curie)})
</Link>
))}
{uniqueGenes.map(gene => <GeneLink gene={gene} /> )}
</CollapsibleList>
);
};
Expand Down
4 changes: 2 additions & 2 deletions src/containers/layout/ReleaseBanner.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ const ReleaseBanner = () => {
isError,
} = useRelease();

const { releaseVersion, releaseDate } = releaseInfo || {};
const { releaseVersion, snapShotDate } = releaseInfo || {};

return isLoading ? <LoadingSpinner /> :
(
<small className="text-secondary">
Version: {isError ? 'Unknown' : releaseVersion}<br />
Date: { isError ? 'Unknown' : new Date(releaseDate).toDateString()}
Date: { isError ? 'Unknown' : new Date(snapShotDate).toDateString()}
</small>
);
};
Expand Down

0 comments on commit f632691

Please sign in to comment.