Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(service-portal): Use full name instead of display name #16497

Merged
merged 4 commits into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
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 @@ -3,7 +3,6 @@ import { defineMessage } from 'react-intl'
import { checkDelegation } from '@island.is/shared/utils'
import { info } from 'kennitala'
import { Problem } from '@island.is/react-spa/shared'
import { Box, Divider, Stack } from '@island.is/island-ui/core'
import { useLocale, useNamespaces } from '@island.is/localization'
import {
FootNote,
Expand Down Expand Up @@ -39,7 +38,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 +59,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
}
thordurhhh marked this conversation as resolved.
Show resolved Hide resolved
spouse {
nationalId
fullName
Expand Down
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
Loading