Skip to content

Commit

Permalink
Use full name instead of display name
Browse files Browse the repository at this point in the history
  • Loading branch information
thordurhhh committed Oct 21, 2024
1 parent 61171c2 commit 00e066e
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
query UserInfoDashboardName($useFakeData: Boolean) {
nationalRegistryPerson(useFakeData: $useFakeData) {
name {
fullName
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,7 @@ export class Name {

@Field(() => String, { nullable: true })
fullName?: string | null

@Field(() => String, { nullable: true })
displayName?: string | null
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ export class PersonBase {
@Field(() => ID)
nationalId!: string

@Field(() => String, { nullable: true })
@Field(() => String, {
nullable: true,
deprecationReason:
'This might return the display name instead of true full name. Use name object instead.',
})
fullName!: string | null

@Field(() => String, {
Expand Down
7 changes: 7 additions & 0 deletions libs/api/domains/national-registry/src/lib/v3/mapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,13 @@ export const formatPerson = async (
individual.kennitala && {
baseId: maskedNationalId,
}),
name: {
firstName: individual.fulltNafn?.eiginNafn ?? null,
middleName: individual.fulltNafn?.milliNafn ?? null,
lastName: individual.fulltNafn?.kenniNafn ?? null,
fullName: individual.fulltNafn?.fulltNafn ?? individual.nafn,
displayName: individual.nafn,
},

//DEPRECATION LINE -- below shall be removed
legalResidence: formatLegalResidence(individual.heimilisfang),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
query NationalRegistryPerson($useFakeData: Boolean) {
nationalRegistryPerson(useFakeData: $useFakeData) {
nationalId
fullName
gender
exceptionFromDirectMarketing
religion
name {
firstName
middleName
lastName
fullName
}
maritalStatus
citizenship {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const SubjectInfo = () => {
return (
<>
<IntroHeader
title={userInfo.profile.name}
title={nationalRegistryPerson?.name?.fullName || ''}
intro={spmm.userInfoDesc}
serviceProviderSlug={THJODSKRA_SLUG}
serviceProviderTooltip={formatMessage(m.tjodskraTooltip)}
Expand All @@ -60,7 +60,7 @@ const SubjectInfo = () => {
<InfoLine
label={m.fullName}
loading={loading}
content={nationalRegistryPerson?.fullName ?? ''}
content={nationalRegistryPerson?.name?.fullName ?? ''}
translate="no"
tooltip={formatNameBreaks(
nationalRegistryPerson?.name ?? undefined,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
query UserInfoOverview($useFakeData: Boolean) {
nationalRegistryPerson(useFakeData: $useFakeData) {
nationalId
fullName
name {
fullName
}
spouse {
nationalId
fullName
Expand All @@ -16,3 +18,11 @@ query UserInfoOverview($useFakeData: Boolean) {
}
}
}

query UserInfoOverviewName($useFakeData: Boolean) {
nationalRegistryPerson(useFakeData: $useFakeData) {
name {
fullName
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ const UserInfoOverview = () => {
{!error && !loading && data?.nationalRegistryPerson && (
<Stack space={2}>
<FamilyMemberCard
title={data.nationalRegistryPerson?.fullName || ''}
title={data.nationalRegistryPerson?.name?.fullName || ''}
nationalId={data.nationalRegistryPerson?.nationalId}
currentUser
/>
Expand Down

0 comments on commit 00e066e

Please sign in to comment.