diff --git a/web/src/components/DLP/OverviewTab.vue b/web/src/components/DLP/OverviewTab.vue index 3f48f1314..18540aaba 100644 --- a/web/src/components/DLP/OverviewTab.vue +++ b/web/src/components/DLP/OverviewTab.vue @@ -15,7 +15,7 @@ :key="i" variant="outlined" > - {{ contributor.name }} + {{ formatContributorName(contributor) }} !!(contributor.includeInCitation), ), ); + +function formatContributorName(contributor: { name?: string; schemaKey?: string }): string { + const name = contributor.name ?? ''; + if (contributor.schemaKey !== 'Person') { + return name; + } + const commaIndex = name.indexOf(','); + if (commaIndex === -1) { + return name; + } + const family = name.slice(0, commaIndex).trim(); + const given = name.slice(commaIndex + 1).trim(); + return [given, family].filter(Boolean).join(' '); +} + const fundingInformation = computed( () => props.meta.contributor?.filter( (contributor) => !!(contributor.schemaKey === 'Organization')