Skip to content
Draft
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/components/GrampsjsEvent.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,10 @@ export class GrampsjsEvent extends GrampsjsObject {
if (obj === undefined) {
return ''
}
return `${obj?.name_given || '…'} ${obj?.name_surname || '…'}`
Comment thread
DavidMStraub marked this conversation as resolved.
if (!obj?.name_display) {
return `${obj?.name_given || '…'} ${obj?.name_surname || '…'}`
Comment thread
DavidMStraub marked this conversation as resolved.
Outdated
}
return `${obj?.name_display}`
}

// eslint-disable-next-line class-methods-use-this
Expand Down
4 changes: 4 additions & 0 deletions src/components/GrampsjsPerson.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ export class GrampsjsPerson extends GrampsjsObject {
if (!this.data.profile) {
return ''
}
const nameDisplay = this.data.profile?.name_display
if (nameDisplay) {
return html`${nameDisplay}`
}
const surname = this.data.profile.name_surname || '…'
const suffix = this.data.profile.name_suffix || ''
const call = this.data?.primary_name?.call
Expand Down
3 changes: 3 additions & 0 deletions src/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ export function translate(strings, s) {
}

export function personTitleFromProfile(personProfile) {
if (personProfile.name_display) {
return `${personProfile.name_display}`.trim()
}
return `${personProfile.name_given || '…'} ${
personProfile.name_surname || '…'
} ${personProfile.name_suffix || ''}`.trim()
Comment thread
DavidMStraub marked this conversation as resolved.
Expand Down
Loading