diff --git a/apps/platform/src/components/Search/SearchQuery.gql b/apps/platform/src/components/Search/SearchQuery.gql index 69b73f992..33688f6d4 100644 --- a/apps/platform/src/components/Search/SearchQuery.gql +++ b/apps/platform/src/components/Search/SearchQuery.gql @@ -21,8 +21,12 @@ query SearchQuery($queryString: String!) { id hasSumstats traitFromSource + nSamples + publicationDate + publicationFirstAuthor + # studyType credibleSets { - count + credibleSetsCount: count } } @@ -80,6 +84,7 @@ query SearchQuery($queryString: String!) { id hasSumstats traitFromSource + nSamples credibleSets { credibleSetsCount: count } diff --git a/apps/platform/src/pages/SearchPage/SearchPageQuery.gql b/apps/platform/src/pages/SearchPage/SearchPageQuery.gql index d3c05cad2..cd59e350f 100644 --- a/apps/platform/src/pages/SearchPage/SearchPageQuery.gql +++ b/apps/platform/src/pages/SearchPage/SearchPageQuery.gql @@ -23,6 +23,10 @@ query SearchPageQuery($queryString: String!, $index: Int!, $entityNames: [String id hasSumstats traitFromSource + nSamples + publicationDate + publicationFirstAuthor + studyType credibleSets { credibleSetsCount: count } diff --git a/apps/platform/src/pages/SearchPage/StudyResult.jsx b/apps/platform/src/pages/SearchPage/StudyResult.jsx index 3eb01d5f8..21b52f91c 100644 --- a/apps/platform/src/pages/SearchPage/StudyResult.jsx +++ b/apps/platform/src/pages/SearchPage/StudyResult.jsx @@ -2,7 +2,7 @@ import { makeStyles, useTheme } from "@mui/styles"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faChartBar } from "@fortawesome/free-solid-svg-icons"; import { Highlights, Link } from "ui"; -import { Typography } from "@mui/material"; +import { Box, Typography } from "@mui/material"; const useStyles = makeStyles(theme => ({ container: { @@ -24,11 +24,25 @@ function StudyResult({ data, highlights }) { return (
- <>{data.id} + <>{data.traitFromSource} {data.credibleSets.credibleSetsCount > -1 && ( - <>Credible sets count: {data.credibleSets.credibleSetsCount} + + +
Credible sets count: {data.credibleSets.credibleSetsCount}
+
• N Study: {data.nSamples}
+
+ +
+ {" "} + {data.publicationFirstAuthor && + `Publication author: ${data.publicationFirstAuthor}`} +
+
{data.publicationDate && ` • Publication date: ${data.publicationDate}`}
+
+
Study Type: {data.studyType}
+
)}
diff --git a/apps/platform/src/pages/StudyPage/Profile.tsx b/apps/platform/src/pages/StudyPage/Profile.tsx index c5fce3d54..5b7685e61 100644 --- a/apps/platform/src/pages/StudyPage/Profile.tsx +++ b/apps/platform/src/pages/StudyPage/Profile.tsx @@ -26,7 +26,7 @@ const summaries = [GWASCredidbleSetsSummary, QTLCredibleSetsSummary]; const STUDY = "study"; const STUDY_PROFILE_SUMMARY_FRAGMENT = summaryUtils.createSummaryFragment( summaries, - "Gwas", + "Study", "StudyProfileSummaryFragment" ); const STUDY_PROFILE_QUERY = gql` diff --git a/apps/platform/src/pages/StudyPage/StudyProfileHeader.gql b/apps/platform/src/pages/StudyPage/StudyProfileHeader.gql index aebef59f1..07ccae663 100644 --- a/apps/platform/src/pages/StudyPage/StudyProfileHeader.gql +++ b/apps/platform/src/pages/StudyPage/StudyProfileHeader.gql @@ -1,4 +1,4 @@ -fragment StudyProfileHeaderFragment on Gwas { +fragment StudyProfileHeaderFragment on Study { studyType publicationFirstAuthor publicationDate diff --git a/packages/sections/src/study/GWASCredibleSets/GWASCredibleSetsSummaryFragment.gql b/packages/sections/src/study/GWASCredibleSets/GWASCredibleSetsSummaryFragment.gql index ccdf91807..337c683b0 100644 --- a/packages/sections/src/study/GWASCredibleSets/GWASCredibleSetsSummaryFragment.gql +++ b/packages/sections/src/study/GWASCredibleSets/GWASCredibleSetsSummaryFragment.gql @@ -1,4 +1,4 @@ -fragment StudyGWASCredibleSetsSummaryFragment on Gwas { +fragment StudyGWASCredibleSetsSummaryFragment on Study { gwasCredibleSets: credibleSets(page: { size: 1, index: 0 }) { count } diff --git a/packages/sections/src/study/QTLCredibleSets/QTLCredibleSetsSummaryFragment.gql b/packages/sections/src/study/QTLCredibleSets/QTLCredibleSetsSummaryFragment.gql index c3edd5dca..1e623ec02 100644 --- a/packages/sections/src/study/QTLCredibleSets/QTLCredibleSetsSummaryFragment.gql +++ b/packages/sections/src/study/QTLCredibleSets/QTLCredibleSetsSummaryFragment.gql @@ -1,4 +1,4 @@ -fragment StudyQTLCredibleSetsSummaryFragment on Gwas { +fragment StudyQTLCredibleSetsSummaryFragment on Study { qtlCredibleSets: credibleSets(page: { size: 1, index: 0 }) { count } diff --git a/packages/ui/src/components/GlobalSearch/GlobalSearchListHeader.jsx b/packages/ui/src/components/GlobalSearch/GlobalSearchListHeader.jsx index c23a31a74..7516335b8 100644 --- a/packages/ui/src/components/GlobalSearch/GlobalSearchListHeader.jsx +++ b/packages/ui/src/components/GlobalSearch/GlobalSearchListHeader.jsx @@ -94,12 +94,21 @@ function GlobalSearchListHeader({ listHeader, children }) { } } + function getListHeader() { + switch (listHeader) { + case "studies": + return "GWAS studies"; + default: + return listHeader; + } + } + return (
{getIcon()} - {listHeader} + {getListHeader()}
{getIconTag()}
diff --git a/packages/ui/src/components/GlobalSearch/GlobalSearchListItem.jsx b/packages/ui/src/components/GlobalSearch/GlobalSearchListItem.jsx index 72925d4a2..2172da1e2 100644 --- a/packages/ui/src/components/GlobalSearch/GlobalSearchListItem.jsx +++ b/packages/ui/src/components/GlobalSearch/GlobalSearchListItem.jsx @@ -4,7 +4,7 @@ import { Typography, Chip, Box } from "@mui/material"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faXmark, faClockRotateLeft, faArrowTrendUp } from "@fortawesome/free-solid-svg-icons"; -import { clearRecentItem, commaSeparate } from "./utils/searchUtils"; +import { clearRecentItem } from "./utils/searchUtils"; import DisplayVariantId from "../DisplayVariantId"; const ListItem = styled("li")(({ theme }) => ({ @@ -35,7 +35,6 @@ const ListItemDisplayName = styled("span")(({ theme }) => ({ const ItemId = styled("span")({ padding: "0.3rem 0 0 1rem ", fontStyle: "italic", - overflowWrap: "break-word", }); const FlexSpan = styled("span")({ @@ -173,7 +172,14 @@ function TopHitListItem({ item, onItemClick }) { - + {!!item.id && ( {item.entity === "variant" ? ( @@ -211,11 +217,33 @@ function TopHitListItem({ item, onItemClick }) { {item.symbol && item.name} - - - {item.description && `${item.description.substring(0, 180)}...`} - - + + + + {item.description && `${item.description.substring(0, 180)}...`} + + + {item.credibleSetsCount > -1 && ( + <>Credible sets count: {item.credibleSetsCount} + )} + {item.nSamples && <> • N Study: {item.nSamples}} + + + {item.publicationFirstAuthor && <>{item.publicationFirstAuthor}} + {item.publicationDate && <>({item.publicationDate})} + + + {item.hasSumstats && ( + + )} + )} @@ -266,8 +294,19 @@ function GlobalSearchListItem({ item, isTopHit = false, onItemClick }) { }} > - {getSymbolHeader()} - + + {getSymbolHeader()} + + {!!item.id && ( {item.entity === "variant" ? ( @@ -311,10 +350,11 @@ function GlobalSearchListItem({ item, isTopHit = false, onItemClick }) { {item.credibleSetsCount > -1 && <>Credible sets count: {item.credibleSetsCount}} + {item.nSamples && <> • N Study: {item.nSamples}} {getVariantRsIds()} - {item.hasSumstats && ( + {/* {item.hasSumstats && ( - )} + )} */} {/* {item.nInitial && N Study: {item.nInitial}} */}