-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Austenem/CAT-975 Remove N/A ORCID link (#3612)
* add check for invalid orcid ids * switch to orcid check function * make orcid function more strict * update corresponding authors list * account for X edge case * fix tests * restructure validation function * update names
- Loading branch information
Showing
6 changed files
with
74 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
- Remove invalid ORCID IDs from Attribution tables. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 0 additions & 21 deletions
21
...p/static/js/components/publications/CorrespondingAuthorsList/CorrespondingAuthorsList.jsx
This file was deleted.
Oops, something went wrong.
28 changes: 28 additions & 0 deletions
28
...p/static/js/components/publications/CorrespondingAuthorsList/CorrespondingAuthorsList.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import React from 'react'; | ||
import { ContactAPIResponse, normalizeContact } from 'js/components/detailPage/ContributorsTable/utils'; | ||
import { validateAndFormatOrcidId } from 'js/helpers/functions'; | ||
import OutboundIconLink from 'js/shared-styles/Links/iconLinks/OutboundIconLink'; | ||
import BulletedList from 'js/shared-styles/lists/bulleted-lists/BulletedList'; | ||
import BulletedListItem from 'js/shared-styles/lists/bulleted-lists/BulletedListItem'; | ||
|
||
function CorrespondingAuthorsList({ contacts }: { contacts: ContactAPIResponse[] }) { | ||
const normalizedContacts = contacts.map((contact) => normalizeContact(contact)); | ||
return ( | ||
<BulletedList> | ||
{normalizedContacts.map(({ name, orcid }) => { | ||
const validatedOrcidId = validateAndFormatOrcidId(orcid); | ||
return ( | ||
<BulletedListItem key={name}> | ||
{name} | ||
| ||
{validatedOrcidId && ( | ||
<OutboundIconLink href={`https://orcid.org/${validatedOrcidId}`}>{validatedOrcidId}</OutboundIconLink> | ||
)} | ||
</BulletedListItem> | ||
); | ||
})} | ||
</BulletedList> | ||
); | ||
} | ||
|
||
export default CorrespondingAuthorsList; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters