Skip to content

Commit

Permalink
sort contacts for journal pdf and remove reviewers
Browse files Browse the repository at this point in the history
  • Loading branch information
kamicut committed Oct 13, 2023
1 parent d5c62f8 commit 9532aee
Showing 1 changed file with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import {
sortReferences
} from '../../../utils/references';
import { formatDocumentTableCaptions } from '../../../utils/format-table-captions';
import { sortContacts } from '../../../utils/sort-contacts';

const ReferencesList = styled.ol`
&& {
Expand Down Expand Up @@ -422,8 +423,13 @@ function JournalPdfPreview() {

// create contacts list component with superscripts
let contacts = [];
contacts_link?.forEach(
({ contact, affiliations: contactAffiliations }, i) => {
let authors = contacts_link?.filter(
(c) => !c.roles?.includes('Document Reviewer')
); // Remove any reviewer from the authors list

authors
?.sort(sortContacts)
.forEach(({ contact, affiliations: contactAffiliations }, i) => {
const hasAffiliation =
contactAffiliations && contactAffiliations.length > 0;

Expand All @@ -444,18 +450,17 @@ function JournalPdfPreview() {
</>
);
})}
{i < contacts_link.length - 1 && <span>, </span>}
{i === contacts_link.length - 2 && <span>and </span>}
{i < authors.length - 1 && <span>, </span>}
{i === authors.length - 2 && <span>and </span>}
</strong>
</span>
);
contacts.push(item);
}
);
});

// create corresponding authors list component
const correspondingAuthors =
contacts_link
authors
?.filter((c) =>
c.roles?.find((r) => r.toLowerCase() === 'corresponding author')
)
Expand Down

0 comments on commit 9532aee

Please sign in to comment.