Skip to content

Commit

Permalink
SCRUM-3604: render Add Impl Genes and Str Backrground only in Allele …
Browse files Browse the repository at this point in the history
…page
  • Loading branch information
abecerra committed Jan 11, 2024
1 parent 77ac5e3 commit bf5035f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
9 changes: 8 additions & 1 deletion src/components/dataTable/AnnotatedEntitiesPopupCuration.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ import ProviderCellCuration from './ProviderCellCuration';
import GeneticSex from './GeneticSex';
import AnnotationType from './AnnotationType';
import AssociationCellCuration from './AssociationCellCuration';
import AssertedGenes from './AssertedGenes';
import GeneticModifiersCellCuration from './GeneticModifiersCellCuration';
import { buildProviderWithUrl } from './utils';
import StrainBackground from './StrainBackground';

function renderLink(entity) {
const url = getResourceUrl(entity.subject.curie, entity.subject.type, entity.subject.subtype)
Expand All @@ -41,7 +43,7 @@ function renderLink(entity) {
}

function AnnotatedEntitiesPopupCuration(props) {
const {children, entities } = props;
const {children, entities, parentPage, mainRowCurie } = props;

if (!entities || !entities.length) {
return null;
Expand All @@ -66,9 +68,11 @@ function AnnotatedEntitiesPopupCuration(props) {
<th>Name</th>
<th>Type</th>
<th className={style.associationCell}>Association</th>
{ parentPage === 'allele' ? <th>Additional implicated genes</th> : <></> }
<th>Experimental condition</th>
<th></th>
<th>Genetic Modifiers</th>
{ parentPage === 'allele' ? <th>Strain Background</th> : <></> }
<th>Genetic Sex</th>
<th className={style.relatedNotes}>Notes</th>
<th>Annotation type</th>
Expand All @@ -86,9 +90,11 @@ function AnnotatedEntitiesPopupCuration(props) {
<td>{renderLink(entity)}</td>
<td><TypeCellCuration subject={entity.subject}/></td>
<td><AssociationCellCuration association={entity.relation?.name}/></td>
{ parentPage === 'allele' ? <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 === 'allele' ? <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 All @@ -110,6 +116,7 @@ function AnnotatedEntitiesPopupCuration(props) {
AnnotatedEntitiesPopupCuration.propTypes = {
children: PropTypes.node,
entities: PropTypes.array,
parentPage: PropTypes.string
};

export default AnnotatedEntitiesPopupCuration;
2 changes: 1 addition & 1 deletion src/components/disease/diseaseAnnotationTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const DiseaseAnnotationTable = ({
<React.Fragment>
<div>{GeneCellCuration(row.subject)}</div>
<small>
<AnnotatedEntitiesPopupCuration entities={row.primaryAnnotations} mainRowCurie={row.subject.curie}>
<AnnotatedEntitiesPopupCuration parentPage='gene' entities={row.primaryAnnotations} mainRowCurie={row.subject.curie}>
Annotation details
</AnnotatedEntitiesPopupCuration>
</small>
Expand Down
2 changes: 1 addition & 1 deletion src/containers/allelePage/AlleleToDiseaseTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const AlleleToDiseaseTable = ({alleleId}) => {
{
dataField: 'primaryAnnotations',
text: 'Annotation details',
formatter: entities => <AnnotatedEntitiesPopupCuration entities={entities}/>,
formatter: entities => <AnnotatedEntitiesPopupCuration parentPage='allele' entities={entities}/>,
headerStyle: {width: '90px'},
},
{
Expand Down

0 comments on commit bf5035f

Please sign in to comment.