From fbd4b87296b22652fddf0c0373c6e7b8694e43f7 Mon Sep 17 00:00:00 2001 From: Sneha Desai Date: Wed, 29 Sep 2021 15:50:45 +0200 Subject: [PATCH] =?UTF-8?q?la=20og=20sl=C3=A5=20av=20feature=20toggle=20ti?= =?UTF-8?q?l=20personalia=20som=20henter=20data=20fra=20tps?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/paneler/innhold/personaliaV2/barn.tsx | 5 +++-- src/components/paneler/paneler.tsx | 12 +++++++----- src/mock/api/veilarbpersonflatefs.ts | 3 ++- src/rest/datatyper/feature.ts | 3 +++ 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/src/components/paneler/innhold/personaliaV2/barn.tsx b/src/components/paneler/innhold/personaliaV2/barn.tsx index 1920dfb3..31641f2d 100644 --- a/src/components/paneler/innhold/personaliaV2/barn.tsx +++ b/src/components/paneler/innhold/personaliaV2/barn.tsx @@ -22,6 +22,7 @@ function BorSammen(props: { barn: PersonsBarn }) { function EnkeltBarn(props: { barn: PersonsBarn }) { const { fornavn, fodselsdato, gradering, erEgenAnsatt, harVeilederTilgang } = props.barn; const alder = finnAlder(props.barn); + const graderingTekst = graderingBeskrivelse(gradering); return (
@@ -33,7 +34,7 @@ function EnkeltBarn(props: { barn: PersonsBarn }) { : gradering !== Gradering.UGRADERT && !harVeilederTilgang ?
Barn - {graderingBeskrivelse(gradering)} + {graderingTekst && {graderingTekst}}
:
@@ -41,7 +42,7 @@ function EnkeltBarn(props: { barn: PersonsBarn }) { {formateStringInUpperAndLowerCase(fornavn)} {formateLocalDate(fodselsdato)} - {graderingBeskrivelse(gradering)} + {graderingTekst && {graderingTekst}}
}
diff --git a/src/components/paneler/paneler.tsx b/src/components/paneler/paneler.tsx index 35ea6e36..15ac63c3 100644 --- a/src/components/paneler/paneler.tsx +++ b/src/components/paneler/paneler.tsx @@ -16,7 +16,7 @@ import { hasHashParam, hasQueryParam } from '../../utils'; import { TilretteleggingsbehovSpa, TilretteleggingsbehovViewType } from '../tilretteleggingsbehov-spa'; import './paneler.less'; import Show from '../felles/show'; -import { PERSONALIA_DATA_FRA_PDL } from '../../rest/datatyper/feature'; +import { PERSONALIA_DATA_FRA_PDL, PERSONALIA_DATA_FRA_TPS } from '../../rest/datatyper/feature'; export const Paneler = () => { const { fnr } = useAppStore(); @@ -47,12 +47,14 @@ export const Paneler = () => { - - - + + + + + - + diff --git a/src/mock/api/veilarbpersonflatefs.ts b/src/mock/api/veilarbpersonflatefs.ts index c6c6e62d..9bad7f80 100644 --- a/src/mock/api/veilarbpersonflatefs.ts +++ b/src/mock/api/veilarbpersonflatefs.ts @@ -1,9 +1,10 @@ import { rest } from 'msw'; import { RequestHandlersList } from 'msw/lib/types/setupWorker/glossary'; -import {Features, PERSONALIA_DATA_FRA_PDL, SPOR_OM_TILBAKEMELDING} from "../../rest/datatyper/feature"; +import {Features, PERSONALIA_DATA_FRA_PDL, PERSONALIA_DATA_FRA_TPS, SPOR_OM_TILBAKEMELDING} from "../../rest/datatyper/feature"; const features: Features = { [PERSONALIA_DATA_FRA_PDL]: true, + [PERSONALIA_DATA_FRA_TPS]: false, [SPOR_OM_TILBAKEMELDING]: true }; diff --git a/src/rest/datatyper/feature.ts b/src/rest/datatyper/feature.ts index f7df52ed..2b8435f6 100644 --- a/src/rest/datatyper/feature.ts +++ b/src/rest/datatyper/feature.ts @@ -1,12 +1,15 @@ export const PERSONALIA_DATA_FRA_PDL = 'veilarbmaofs.personalia.pdl.persondata'; +export const PERSONALIA_DATA_FRA_TPS = 'veilarbmaofs.personalia.tps.persondata'; export const SPOR_OM_TILBAKEMELDING = 'veilarbmaofs.spor.om.tilbakemelding'; export const TOGGLES = [ PERSONALIA_DATA_FRA_PDL, + PERSONALIA_DATA_FRA_TPS, SPOR_OM_TILBAKEMELDING ]; export interface Features { [PERSONALIA_DATA_FRA_PDL]: boolean; + [PERSONALIA_DATA_FRA_TPS]: boolean; [SPOR_OM_TILBAKEMELDING]: boolean; }