Skip to content

Commit

Permalink
Merge pull request #1702 from sennetconsortium/maxsibilla/issue-1700
Browse files Browse the repository at this point in the history
Updating citation to use AMA format. Passing correct property for dat…
  • Loading branch information
maxsibilla authored Oct 22, 2024
2 parents 4cc90b0 + 6495ea9 commit d028bf8
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 5 deletions.
3 changes: 1 addition & 2 deletions src/components/custom/entities/sample/Description.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 = () => {
Expand Down Expand Up @@ -79,7 +78,7 @@ export default function Description({data, citationData, labId, primaryDateTitle
{data && (data?.doi_url || data?.publication_doi) && citationData &&
<Card border={'0'} className={'pb-3'}>
<Card.Body>
<Card.Subtitle>Citation <SenNetPopover text={<span>Citation is provided in APA format.</span>} trigger={SenPopoverOptions.triggers.hover} className={`popover-citation`}>
<Card.Subtitle>Citation <SenNetPopover text={<span>Citation is provided in AMA format.</span>} trigger={SenPopoverOptions.triggers.hover} className={`popover-citation`}>
<i className="bi bi-question-circle-fill"></i>
</SenNetPopover></Card.Subtitle>
<Card.Text dangerouslySetInnerHTML={{__html: citationData}}></Card.Text>
Expand Down
2 changes: 1 addition & 1 deletion src/components/custom/js/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion src/context/AppContext.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/dataset.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit d028bf8

Please sign in to comment.