Skip to content

Commit

Permalink
Merge branch 'main-with-updates' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
candicecz committed Dec 6, 2023
2 parents 5382106 + 6d30b1e commit 7fb7381
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 11 deletions.
1 change: 0 additions & 1 deletion .env.dev
Original file line number Diff line number Diff line change
@@ -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
12 changes: 8 additions & 4 deletions src/components/metadata/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -34,4 +33,20 @@ const InputOutput: React.FC<InputOutputProps> = ({
);
};

interface StyledText extends TextProps {
title?: string;
}
const StyledText = ({ title, children, ...props }: StyledText) => {
return (
<Text fontSize='sm' lineHeight='short' wordBreak='break-all' {...props}>
{title && (
<Text as='span' fontSize='xs' fontWeight='semibold' color='gray.700'>
{title}
</Text>
)}{' '}
{children || '-'}
</Text>
);
};

export default InputOutput;
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ const MetadataAccordion: React.FC<MetadataAccordionProps> = ({ data }) => {
id: data?.id,
healthCondition: data?.healthCondition,
infectiousAgent: data?.infectiousAgent,
funding: data?.funding,
license: data?.license,
measurementTechnique: data?.measurementTechnique,
species: data?.species,
Expand Down
7 changes: 7 additions & 0 deletions src/components/search-results-page/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,16 @@ import {
import {
Box,
Button,
Circle,
Collapse,
Flex,
FormControl,
FormLabel,
Icon,
Link,
ListItem,
Stack,
Switch,
Text,
UnorderedList,
} from 'nde-design-system';
Expand All @@ -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.
Expand Down

0 comments on commit 7fb7381

Please sign in to comment.