Skip to content

Commit efcb7f1

Browse files
committed
PD-5744 when the credit name is provided, use the family name in the other names list
1 parent e173e4b commit efcb7f1

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/assets/print-view/fetch-orcid.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,7 @@ function renderIdentityFromJson(recordJson) {
277277
const fullName = [given, family].filter(Boolean).join(' ')
278278
const chosenName = credit || fullName || STRINGS.unnamedProfile
279279

280+
// Set the page title
280281
setTitle(recordJson, chosenName)
281282

282283
const container = document.createElement('article')
@@ -291,6 +292,11 @@ function renderIdentityFromJson(recordJson) {
291292
const otherNames = jsonList(person?.['other-names']?.['other-name'])
292293
.map((n) => jsonText(n?.content))
293294
.filter(Boolean)
295+
296+
if (credit && fullName) {
297+
otherNames.unshift(fullName)
298+
}
299+
294300
if (otherNames.length) {
295301
const namesLine = document.createElement('p')
296302
namesLine.className = 'other-names'

0 commit comments

Comments
 (0)