From 6495ea90c034f19b61273c82214872755c3cfa13 Mon Sep 17 00:00:00 2001 From: maxsibilla Date: Tue, 22 Oct 2024 15:15:50 -0400 Subject: [PATCH] Updating citation to use AMA format. Passing correct property for datasets --- src/components/custom/entities/sample/Description.jsx | 3 +-- src/components/custom/js/functions.js | 2 +- src/context/AppContext.jsx | 1 - src/pages/dataset.jsx | 2 +- 4 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/components/custom/entities/sample/Description.jsx b/src/components/custom/entities/sample/Description.jsx index 00006aa3..9757f629 100644 --- a/src/components/custom/entities/sample/Description.jsx +++ b/src/components/custom/entities/sample/Description.jsx @@ -8,7 +8,6 @@ import SenNetPopover, {SenPopoverOptions} from "../../../SenNetPopover"; export default function Description({data, citationData, labId, primaryDateTitle, primaryDate, secondaryDateTitle, secondaryDate, title, showAuthors=false, showDatasetTypes=false, showOrgans=false}) { - console.log(citationData) const {isLoggedIn, cache} = useContext(AppContext) const buildContacts = () => { @@ -79,7 +78,7 @@ export default function Description({data, citationData, labId, primaryDateTitle {data && (data?.doi_url || data?.publication_doi) && citationData && - Citation Citation is provided in APA format.} trigger={SenPopoverOptions.triggers.hover} className={`popover-citation`}> + Citation Citation is provided in AMA format.} trigger={SenPopoverOptions.triggers.hover} className={`popover-citation`}> diff --git a/src/components/custom/js/functions.js b/src/components/custom/js/functions.js index 50311c40..88b2c2be 100644 --- a/src/components/custom/js/functions.js +++ b/src/components/custom/js/functions.js @@ -51,7 +51,7 @@ export function getProtocolId(protocolUrl) { export async function fetchDataCite(protocolUrl) { if (!protocolUrl) return null let headers = new Headers() - headers.append("Accept", "text/x-bibliography; style=apa") + headers.append("Accept", "text/x-bibliography; style=american-medical-association") let requestOptions = { method: 'GET', headers: headers diff --git a/src/context/AppContext.jsx b/src/context/AppContext.jsx index 0cb508c1..9c68bdee 100644 --- a/src/context/AppContext.jsx +++ b/src/context/AppContext.jsx @@ -268,7 +268,6 @@ export const AppProvider = ({ cache, banners, children }) => { } const isPreview = (data, error) => { - log.debug('isPreview', data, error, authorized) if (error && hasPublicAccess(data)) return false return ((isUnauthorized(data) || isAuthorizing()) || !data) } diff --git a/src/pages/dataset.jsx b/src/pages/dataset.jsx index c11c63d0..f973ed7a 100644 --- a/src/pages/dataset.jsx +++ b/src/pages/dataset.jsx @@ -103,7 +103,7 @@ function ViewDataset() { Object.assign(_data, ancestry) setData(_data) - const citation = await fetchDataCite(_data.publication_url) + const citation = await fetchDataCite(_data.doi_url) setCitationData(citation) for (const ancestor of ancestry.ancestors) {