diff --git a/app/assets/scripts/components/documents/journal-pdf-preview/index.js b/app/assets/scripts/components/documents/journal-pdf-preview/index.js index 48a27100..7d29259e 100644 --- a/app/assets/scripts/components/documents/journal-pdf-preview/index.js +++ b/app/assets/scripts/components/documents/journal-pdf-preview/index.js @@ -26,7 +26,6 @@ import { import { applyNumberCaptionsToDocument } from '../../../utils/apply-number-captions-to-document'; import { VariableItem } from '../single-view/document-body'; import { variableNodeType } from '../../../types'; -import { sortContacts } from '../../../utils/sort-contacts'; const ReferencesList = styled.ol` && { @@ -451,36 +450,34 @@ function JournalPdfPreview() { (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; - - const item = ( - - - {getContactName(contact, { full: true })} - {hasAffiliation && - contactAffiliations.map((affiliation, j) => { - return ( - <> - - {Array.from(affiliations).indexOf(affiliation) + 1} - - - {j < contactAffiliations.length - 1 && , } - - - ); - })} - {i < authors.length - 1 && , } - {i === authors.length - 2 && and } - - - ); - contacts.push(item); - }); + authors?.forEach(({ contact, affiliations: contactAffiliations }, i) => { + const hasAffiliation = + contactAffiliations && contactAffiliations.length > 0; + + const item = ( + + + {getContactName(contact, { full: true })} + {hasAffiliation && + contactAffiliations.map((affiliation, j) => { + return ( + <> + + {Array.from(affiliations).indexOf(affiliation) + 1} + + + {j < contactAffiliations.length - 1 && , } + + + ); + })} + {i < authors.length - 1 && , } + {i === authors.length - 2 && and } + + + ); + contacts.push(item); + }); // create corresponding authors list component const correspondingAuthors = diff --git a/app/assets/scripts/components/documents/single-view/document-body.js b/app/assets/scripts/components/documents/single-view/document-body.js index 3a158a1e..19a84c60 100644 --- a/app/assets/scripts/components/documents/single-view/document-body.js +++ b/app/assets/scripts/components/documents/single-view/document-body.js @@ -27,7 +27,6 @@ import { useCommentCenter } from '../../../context/comment-center'; import { isJournalPublicationIntended } from '../status'; import serializeSlateToString from '../../slate/serialize-to-string'; import { useContextualAbility } from '../../../a11n'; -import { sortContacts } from '../../../utils/sort-contacts'; const PDFPreview = styled.iframe` width: 100%; @@ -1056,7 +1055,6 @@ const htmlAtbdContentSections = [ // Remove reviewers that have the role 'Document Reviewer' !roles.includes('Document Reviewer') ) - .sort(sortContacts) .map(({ contact, roles, affiliations }, idx) => ({ label: getContactName(contact), id: `contacts_${idx + 1}`, @@ -1117,7 +1115,6 @@ const htmlAtbdContentSections = [ // Include reviewers that have the role 'Document Reviewer' roles.includes('Document Reviewer') ) - .sort(sortContacts) .map(({ contact, roles, affiliations }, idx) => ({ label: getContactName(contact), id: `contacts_${idx + 1}`,