Feature/search chemicals details
9 unresolved threads
9 unresolved threads
Details and pins for chemicals on search
Merge request reports
Activity
Filter activity
assigned to @MateuszBolewski
37 export const getAdditionalInfo = (pinsList: PinItem[]): string => { 37 export const getAdditionalInfo = (pinsList: PinItem[], type: PinType): string => { 38 38 let additionalDetails = ''; 39 39 40 pinsList.forEach(element => { 41 if ('bloodBrainBarrier' in element.data) { 42 additionalDetails += element.data.bloodBrainBarrier; 43 } 44 }); 40 if (type === 'drugs') { 41 pinsList.forEach(element => { 42 if ('bloodBrainBarrier' in element.data) { 43 additionalDetails += element.data.bloodBrainBarrier; 44 } 45 }); 46 } else if (type === 'chemicals') { changed this line in version 4 of the diff
35 35 }; 36 36 37 export const getAdditionalInfo = (pinsList: PinItem[]): string => { 37 export const getAdditionalInfo = (pinsList: PinItem[], type: PinType): string => { 38 38 let additionalDetails = ''; 39 39 40 pinsList.forEach(element => { 41 if ('bloodBrainBarrier' in element.data) { 42 additionalDetails += element.data.bloodBrainBarrier; 43 } 44 }); 40 if (type === 'drugs') { 41 pinsList.forEach(element => { 42 if ('bloodBrainBarrier' in element.data) { 43 additionalDetails += element.data.bloodBrainBarrier; 44 } - Comment on lines +41 to +44
changed this line in version 4 of the diff
40 if (type === 'drugs') { 41 pinsList.forEach(element => { 42 if ('bloodBrainBarrier' in element.data) { 43 additionalDetails += element.data.bloodBrainBarrier; 44 } 45 }); 46 } else if (type === 'chemicals') { 47 pinsList.forEach(element => { 48 if ('directEvidence' in element.data) { 49 if (element.data.directEvidence) { 50 additionalDetails += element.data.directEvidence; 51 } else { 52 additionalDetails += 'No annotations'; 53 } 54 } 55 }); changed this line in version 4 of the diff
26 26 case 'bioEntity': 27 27 return <div />; 28 28 case 'chemicals': 29 return <div />; 29 return ( 30 <div className="h-[calc(100vh-198px)] overflow-auto"> 31 <AccordionsDetails pinsList={pinsList} type={type} /> 32 <ul className="px-6 py-2"> 33 {pinsList.map(result => { 34 return result.data.targets.map(pin => ( 35 <MirnaPinsListItem key={pin.name} name={pin.name} type={type} pin={pin} /> 11 11 12 export const numberOfChemicalsSelector = createSelector(chemicalsSelector, state => 13 state.data ? state.data.length : SIZE_OF_EMPTY_ARRAY, 14 ); 12 export const numberOfChemicalsSelector = createSelector(chemicalsSelector, state => { 13 if (!state.data) { 14 return SIZE_OF_EMPTY_ARRAY; 15 } 16 17 let numberOfChemicals = 0; 18 19 state.data.forEach(element => { 20 numberOfChemicals += element.targets.length; 21 }); 22 23 return numberOfChemicals; changed this line in version 4 of the diff
20 20 return ( 21 21 render( 22 22 <Wrapper> 23 <AccordionsDetails pinsList={PINS_LIST} /> 23 <AccordionsDetails pinsList={PINS_LIST} type="drugs" /> changed this line in version 4 of the diff
34 34 return synonyms; 35 35 }; 36 36 37 export const getAdditionalInfo = (pinsList: PinItem[]): string => { 37 export const getAdditionalInfo = (pinsList: PinItem[], type: PinType): string => { 38 38 let additionalDetails = ''; 39 39 40 pinsList.forEach(element => { 41 if ('bloodBrainBarrier' in element.data) { 42 additionalDetails += element.data.bloodBrainBarrier; 43 } 44 }); 40 if (type === 'drugs') { 41 pinsList.forEach(element => { 42 if ('bloodBrainBarrier' in element.data) { 43 additionalDetails += element.data.bloodBrainBarrier; changed this line in version 4 of the diff
39 39 40 pinsList.forEach(element => { 41 if ('bloodBrainBarrier' in element.data) { 42 additionalDetails += element.data.bloodBrainBarrier; 43 } 44 }); 40 if (type === 'drugs') { 41 pinsList.forEach(element => { 42 if ('bloodBrainBarrier' in element.data) { 43 additionalDetails += element.data.bloodBrainBarrier; 44 } 45 }); 46 } else if (type === 'chemicals') { 47 pinsList.forEach(element => { 48 if ('directEvidence' in element.data) { 49 if (element.data.directEvidence) { changed this line in version 4 of the diff
15 15 16 16 interface AccordionsDetailsProps { 17 17 pinsList: PinItem[]; 18 type: PinType; 18 19 } 19 20 20 export const AccordionsDetails = ({ pinsList }: AccordionsDetailsProps): JSX.Element => { 21 export const AccordionsDetails = ({ pinsList, type }: AccordionsDetailsProps): JSX.Element => { added 1 commit
- 3426bb5e - feat(search): bio entities list of pins and details
added 1 commit
- 1783e125 - Revert "feat(search): bio entities list of pins and details"
added 1 commit
- f8d02096 - feat(search): added missing tests and fixes after code review
mentioned in commit c33dca6f
Please register or sign in to reply