Skip to content
Snippets Groups Projects

Feature/search chemicals details

Merged Mateusz Bolewski requested to merge feature/search-chemicals-details into development
9 unresolved threads

Details and pins for chemicals on search

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
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') {
  • 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 }
  • 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 });
  • 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;
  • Overall LGTM

    RFC: Please add tests for currently not covered cases

  • Adrian Orłów approved this merge request

    approved this merge request

  • 20 20 return (
    21 21 render(
    22 22 <Wrapper>
    23 <AccordionsDetails pinsList={PINS_LIST} />
    23 <AccordionsDetails pinsList={PINS_LIST} type="drugs" />
  • 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;
  • 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) {
  • LGTM but code quality improvements are RFC from my side

  • 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

    Compare with previous version

  • added 1 commit

    • 1783e125 - Revert "feat(search): bio entities list of pins and details"

    Compare with previous version

  • added 1 commit

    • f8d02096 - feat(search): added missing tests and fixes after code review

    Compare with previous version

  • Mateusz Bolewski mentioned in commit c33dca6f

    mentioned in commit c33dca6f

  • Please register or sign in to reply
    Loading