diff --git a/libs/api/domains/national-registry/src/lib/shared/models/name.model.ts b/libs/api/domains/national-registry/src/lib/shared/models/name.model.ts index 2e4dba245f28..6b085b9d0110 100644 --- a/libs/api/domains/national-registry/src/lib/shared/models/name.model.ts +++ b/libs/api/domains/national-registry/src/lib/shared/models/name.model.ts @@ -13,4 +13,7 @@ export class Name { @Field(() => String, { nullable: true }) fullName?: string | null + + @Field(() => String, { nullable: true }) + displayName?: string | null } diff --git a/libs/api/domains/national-registry/src/lib/shared/models/personBase.model.ts b/libs/api/domains/national-registry/src/lib/shared/models/personBase.model.ts index b9fd77ce4077..a9185ce6241f 100644 --- a/libs/api/domains/national-registry/src/lib/shared/models/personBase.model.ts +++ b/libs/api/domains/national-registry/src/lib/shared/models/personBase.model.ts @@ -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, { diff --git a/libs/api/domains/national-registry/src/lib/v3/mapper.ts b/libs/api/domains/national-registry/src/lib/v3/mapper.ts index f11fc3922bd3..20b097a8a8ad 100644 --- a/libs/api/domains/national-registry/src/lib/v3/mapper.ts +++ b/libs/api/domains/national-registry/src/lib/v3/mapper.ts @@ -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), diff --git a/libs/service-portal/information/src/screens/UserInfo/UserInfo.graphql b/libs/service-portal/information/src/screens/UserInfo/UserInfo.graphql index 7df730d19577..94bc8a3da14a 100644 --- a/libs/service-portal/information/src/screens/UserInfo/UserInfo.graphql +++ b/libs/service-portal/information/src/screens/UserInfo/UserInfo.graphql @@ -1,7 +1,6 @@ query NationalRegistryPerson($useFakeData: Boolean) { nationalRegistryPerson(useFakeData: $useFakeData) { nationalId - fullName gender exceptionFromDirectMarketing religion @@ -9,6 +8,7 @@ query NationalRegistryPerson($useFakeData: Boolean) { firstName middleName lastName + fullName } maritalStatus citizenship { diff --git a/libs/service-portal/information/src/screens/UserInfo/UserInfo.tsx b/libs/service-portal/information/src/screens/UserInfo/UserInfo.tsx index 467fcb1bdf32..25876221db72 100644 --- a/libs/service-portal/information/src/screens/UserInfo/UserInfo.tsx +++ b/libs/service-portal/information/src/screens/UserInfo/UserInfo.tsx @@ -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, @@ -39,7 +38,7 @@ const SubjectInfo = () => { return ( <> { { {!error && !loading && data?.nationalRegistryPerson && (