Skip to content

Commit

Permalink
FIX: show concept and variable search buttons even when there are no …
Browse files Browse the repository at this point in the history
…concepts
  • Loading branch information
Hina Shah committed May 21, 2024
1 parent 998a214 commit 4d9fcdc
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 26 deletions.
4 changes: 2 additions & 2 deletions src/components/search/form/form.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ export const SearchForm = ({ type=undefined, ...props }) => {
)
}
</Form.Item>
{ totalConcepts ? (
{
<Form.Item>
<Tooltip title="Change search type">
<Radio.Group
Expand Down Expand Up @@ -283,7 +283,7 @@ export const SearchForm = ({ type=undefined, ...props }) => {
/>
</Tooltip>
</Form.Item>
) : null }
}
</Form>
)
}
24 changes: 12 additions & 12 deletions src/components/search/results/results-header/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,19 @@ export const ResultsHeader = ({ variables=false, type=FULL, ...props }) => {
<div className="results-header" {...props}>
{type === FULL && (
<Fragment>
<Text>
{ variables ? (
`${ variableStudyResultCount } studies and ${ totalVariableResults } variables`
) : (
`${ totalConcepts } concepts`
<Text>
{ variables ? (
`${ variableStudyResultCount } studies and ${ totalVariableResults } variables`
) : (
`${ totalConcepts } concepts`
) }
</Text>
{ !variables && (
<Tooltip title="Shareable link" placement="top">
{/* Just want anchor styling */}
<Link onClick={NotifyLinkCopied} style={{ marginLeft: '16px', marginRight: '16px' }}><LinkIcon /></Link>
</Tooltip>
) }
</Text>
{ !variables && (
<Tooltip title="Shareable link" placement="top">
{/* Just want anchor styling */}
<Link onClick={NotifyLinkCopied} style={{ marginLeft: '16px', marginRight: '16px' }}><LinkIcon /></Link>
</Tooltip>
) }
</Fragment>
)}
<div
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,20 @@ export const VariableViewLayout = () => {
{ isLoadingVariableResults ? (
<Spin style={{ display: "block", margin: "32px" }} />
) : (
<Fragment>
{ error.message ? (
<span style={{ marginTop: -144, padding: "0 6px" }}>{ error.message }</span>
) : query && totalVariableResults === 0 ? (
<Empty style={{ marginTop: -24 }} description={
<Text type="secondary">No results were found for &quot;{ query }&quot;</Text>
} />
// <span style={{ marginTop: -144, padding: "0 6px" }}>No results found</span>
) : null }
{totalVariableResults > 0 && <ResultsHeader variables={ true } />}
<VariableSearchResults />
</Fragment>
query && (
<Fragment>
{ error.message ? (
<span style={{ marginTop: -144, padding: "0 6px" }}>{ error.message }</span>
) : !isLoadingVariableResults && totalVariableResults === 0 ? (
<Empty style={{ marginTop: -24 }} description={
<Text type="secondary">No results were found for &quot;{ query }&quot;</Text>
} />
// <span style={{ marginTop: -144, padding: "0 6px" }}>No results found</span>
) : null }
{totalVariableResults > 0 && <ResultsHeader variables={ true } />}
<VariableSearchResults />
</Fragment>
)
) }
</Fragment>
)
Expand Down

0 comments on commit 4d9fcdc

Please sign in to comment.