Skip to content

Commit

Permalink
[Platform]: fix the evidence page and publication across UI (#587)
Browse files Browse the repository at this point in the history
* fix: evidence page

* fix: publication issues
  • Loading branch information
carcruz authored Dec 2, 2024
1 parent d4d36a6 commit dbc942b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
15 changes: 8 additions & 7 deletions packages/sections/src/evidence/GWASCredibleSets/Body.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { dataTypesMap } from "../../dataTypes";
import GWAS_CREDIBLE_SETS_QUERY from "./sectionQuery.gql";
import { mantissaExponentComparator } from "../../utils/comparators";

function getColumns() {
function getColumns(targetSymbol) {
return [
{
id: "credibleSet",
Expand Down Expand Up @@ -51,9 +51,7 @@ function getColumns() {
id: "study",
label: "Study",
renderCell: ({ credibleSet }) => {
return (
<Link to={`/study/${credibleSet?.study.id}`}>{credibleSet?.study.id}</Link>
);
return <Link to={`/study/${credibleSet?.study.id}`}>{credibleSet?.study.id}</Link>;
},
},
{
Expand Down Expand Up @@ -104,7 +102,8 @@ function getColumns() {
id: "confidence",
label: "Fine-mapping confidence",
sortable: true,
tooltip: "Fine-mapping confidence based on the quality of the linkage-desequilibrium information available and fine-mapping method",
tooltip:
"Fine-mapping confidence based on the quality of the linkage-desequilibrium information available and fine-mapping method",
renderCell: ({ credibleSet }) => {
if (!credibleSet?.confidence) return naLabel;
return (
Expand Down Expand Up @@ -148,11 +147,13 @@ function getColumns() {
{
id: "publication",
label: "Publication",
renderCell: ({ credibleSet }) => {
renderCell: ({ credibleSet, disease }) => {
const { publicationFirstAuthor, publicationDate, pubmedId } = credibleSet?.study ?? {};
if (!publicationFirstAuthor) return naLabel;
return (
<PublicationsDrawer
name={disease.name}
symbol={targetSymbol}
entries={[{ name: pubmedId }]}
customLabel={`${publicationFirstAuthor} et al. (${new Date(
publicationDate
Expand All @@ -170,7 +171,7 @@ function Body({ id, label, entity }) {
const { ensgId, efoId } = id;
const variables = { ensemblId: ensgId, efoId, size: sectionsBaseSizeQuery };

const columns = getColumns();
const columns = getColumns(label.symbol);

const request = useQuery(GWAS_CREDIBLE_SETS_QUERY, {
variables,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function Summary() {
}

Summary.fragments = {
GWASCredibleSetsSummaryFragment: GWAS_CREDIBLE_SETS_SUMMARY_FRAGMENT,
EvidenceGWASCredibleSetsSummaryFragment: GWAS_CREDIBLE_SETS_SUMMARY_FRAGMENT,
};

export default Summary;
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ function PublicationWrapper({
</Box>
)}

{fullTextOpen && isOpenAccess && urlAiApi && (
{symbol && name && fullTextOpen && isOpenAccess && urlAiApi && (
<PublicationSummary name={name} symbol={symbol} pmcId={pmcId} />
)}
</Box>
Expand Down

0 comments on commit dbc942b

Please sign in to comment.