diff --git a/web/src/data/api.ts b/web/src/data/api.ts index d14573bf..00fbd916 100644 --- a/web/src/data/api.ts +++ b/web/src/data/api.ts @@ -117,17 +117,23 @@ interface PrincipalInvestigator { orcid?: string; } +export interface DOI { + type: string, + id:string, +} + export interface StudySearchResults extends BaseSearchResult { principal_investigator_websites: string[]; principal_investigator_name: string; principal_investigator_image_url: string; image_url: string; principal_investigator: PrincipalInvestigator; - doi: string; + award_dois: DOI[]; + dataset_dois: DOI[], doi_map: Record, - publication_dois: string[]; + publication_dois: DOI[]; omics_counts: { type: string; count: number; diff --git a/web/src/views/IndividualResults/StudyPage.vue b/web/src/views/IndividualResults/StudyPage.vue index 4d27fe3a..ace35504 100644 --- a/web/src/views/IndividualResults/StudyPage.vue +++ b/web/src/views/IndividualResults/StudyPage.vue @@ -9,7 +9,7 @@ import Cite from 'citation-js'; import { typeWithCardinality, valueCardinality, fieldDisplayName, } from '@/util'; -import { api, StudySearchResults } from '@/data/api'; +import { api, StudySearchResults, DOI } from '@/data/api'; import { setUniqueCondition, setConditions } from '@/store'; import { useRouter } from '@/use/useRouter'; import AttributeItem from '@/components/Presentation/AttributeItem.vue'; @@ -43,8 +43,9 @@ export default defineComponent({ setup(props) { const data = reactive({ - doiCitation: '' as string | null, - publications: [] as any[], + awardDois: [] as DOI[], + publicationDois: [] as DOI[], + datasetDois: [] as DOI[], }); const item = ref(null as StudySearchResults | null); @@ -137,12 +138,15 @@ export default defineComponent({ watch(item, async (_item) => { const doiMap = _item?.doi_map; if (doiMap) { - data.doiCitation = null; - data.publications = []; - data.doiCitation = CitationOverrides[_item.doi] || formatAPA(new Cite(_item.doi)); - data.publications = _item.publication_dois - .filter((doi) => doi in doiMap) - .map((doi) => formatAPA(new Cite(doiMap[doi]))); + data.awardDois = []; + data.publicationDois = []; + data.datasetDois = []; + data.awardDois = _item.award_dois + .filter((doi) => doi.id in doiMap) + .map((doi) => CitationOverrides[doi.id] || formatAPA(new Cite(doi.id))); + data.publicationDois = _item.publication_dois + .filter((doi) => doi.id in doiMap) + .map((doi) => formatAPA(new Cite(doiMap[doi.id]))); } }); @@ -211,10 +215,6 @@ export default defineComponent({ Study Details - -
- - Dataset Citation - - + +