From 6d30b1e1f91da76ff424a74ce1938124ad879757 Mon Sep 17 00:00:00 2001 From: candicecz Date: Wed, 6 Dec 2023 09:16:19 -0500 Subject: [PATCH] chore: fix merge bugs --- .env.dev | 1 - src/components/metadata/helpers.ts | 12 ++++++++---- .../components/is-part-of/index.tsx | 4 ---- .../components/input-output.tsx | 19 +++++++++++++++++-- .../card/metadata-accordion/index.tsx | 3 +-- src/components/search-results-page/index.tsx | 7 +++++++ 6 files changed, 33 insertions(+), 13 deletions(-) diff --git a/.env.dev b/.env.dev index 2151b9bb..8d03ad77 100644 --- a/.env.dev +++ b/.env.dev @@ -1,4 +1,3 @@ BASE_URL=https://d3d1vy3voytpzm.cloudfront.net/ NEXT_PUBLIC_API_URL=https://api.nde-dev.biothings.io/v1 -NEXT_PUBLIC_GOOGLE_ANALYTICS=GTM-K8WGDTD NEXT_PUBLIC_STRAPI_API_URL=https://d3d1vy3voytpzm.cloudfront.net/strapi diff --git a/src/components/metadata/helpers.ts b/src/components/metadata/helpers.ts index 8ff5a768..5d9a91a9 100644 --- a/src/components/metadata/helpers.ts +++ b/src/components/metadata/helpers.ts @@ -160,15 +160,19 @@ const createFundingContent = ( isDisabled: !fundingDetails || fundingDetails.length === 0, items: fundingDetails?.map((funding, idx) => { - const value = funding?.funder?.name; + const name = Array.isArray(funding.funder) + ? funding.funder.filter(funder => !!funder.name).join(', ') + : funding?.funder?.name; return { key: `${property}-${id}-${idx}`, - name: value || '', + name: name || '', scientificName: '', searchProps: { - ['aria-label']: `Search for results with funding "${value}"`, + ['aria-label']: `Search for results with funding "${name}"`, property: 'funding.funder.name', - value, + value: Array.isArray(funding.funder) + ? funding.funder.filter(funder => !!funder.name).join('" OR "') + : funding?.funder?.name, }, tags: funding?.identifier || funding?.url diff --git a/src/components/resource-sections/components/is-part-of/index.tsx b/src/components/resource-sections/components/is-part-of/index.tsx index 2abc1cf5..f1da0ced 100644 --- a/src/components/resource-sections/components/is-part-of/index.tsx +++ b/src/components/resource-sections/components/is-part-of/index.tsx @@ -1,15 +1,11 @@ import { FormattedResource } from 'src/utils/api/types'; import { - Box, Flex, Link, ListItem, Skeleton, - Text, UnorderedList, } from 'nde-design-system'; -import { shouldAppendPunctuation } from 'src/utils/helpers'; -import { getCitationComponents } from './helpers'; import { MetadataLabel, MetadataTooltip, diff --git a/src/components/resource-sections/components/software-information/components/input-output.tsx b/src/components/resource-sections/components/software-information/components/input-output.tsx index 5e6f9ba9..2bf2f50c 100644 --- a/src/components/resource-sections/components/software-information/components/input-output.tsx +++ b/src/components/resource-sections/components/software-information/components/input-output.tsx @@ -1,8 +1,7 @@ import React from 'react'; -import { Box, Flex, Icon } from 'nde-design-system'; +import { Box, Flex, Icon, Text, TextProps } from 'nde-design-system'; import { InputProperties, OutputProperties } from 'src/utils/api/types'; import { IconType } from 'react-icons'; -import { StyledText } from '../../based-on'; interface InputOutputProps extends InputProperties, OutputProperties { icon: IconType; @@ -34,4 +33,20 @@ const InputOutput: React.FC = ({ ); }; +interface StyledText extends TextProps { + title?: string; +} +const StyledText = ({ title, children, ...props }: StyledText) => { + return ( + + {title && ( + + {title} + + )}{' '} + {children || '-'} + + ); +}; + export default InputOutput; diff --git a/src/components/search-results-page/components/card/metadata-accordion/index.tsx b/src/components/search-results-page/components/card/metadata-accordion/index.tsx index c7532d4f..9b066fc2 100644 --- a/src/components/search-results-page/components/card/metadata-accordion/index.tsx +++ b/src/components/search-results-page/components/card/metadata-accordion/index.tsx @@ -4,10 +4,8 @@ import { AccordionItem, AccordionPanel, AccordionButton, - Box, Flex, Icon, - Image, Tag, TagLabel, Text, @@ -40,6 +38,7 @@ const MetadataAccordion: React.FC = ({ data }) => { id: data?.id, healthCondition: data?.healthCondition, infectiousAgent: data?.infectiousAgent, + funding: data?.funding, license: data?.license, measurementTechnique: data?.measurementTechnique, species: data?.species, diff --git a/src/components/search-results-page/index.tsx b/src/components/search-results-page/index.tsx index b3ad4b56..b6cbead4 100644 --- a/src/components/search-results-page/index.tsx +++ b/src/components/search-results-page/index.tsx @@ -10,11 +10,16 @@ import { import { Box, Button, + Circle, Collapse, Flex, + FormControl, + FormLabel, + Icon, Link, ListItem, Stack, + Switch, Text, UnorderedList, } from 'nde-design-system'; @@ -38,6 +43,8 @@ import { encodeString } from 'src/utils/querystring-helpers'; import { SelectedFilterType } from '../filters/types'; // import { AdvancedSearchWithModal } from '../advanced-search/AdvancedSearchWithModal'; import { getQueryStatusError } from '../error/utils'; +import Tooltip from '../tooltip'; +import { FaInfo } from 'react-icons/fa'; /* [COMPONENT INFO]: Search results pages displays the list of records returned by a search.