Skip to content
This repository has been archived by the owner on May 15, 2024. It is now read-only.

Commit

Permalink
Merge pull request #222 from navikt/Slo-av-personalia-til-tps
Browse files Browse the repository at this point in the history
la og slå av feature toggle til personalia som henter data fra tps
  • Loading branch information
sneha-d-desai authored Sep 29, 2021
2 parents 472616e + fbd4b87 commit 1b51af4
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
5 changes: 3 additions & 2 deletions src/components/paneler/innhold/personaliaV2/barn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<div className="overinformasjon underinformasjon">
Expand All @@ -33,15 +34,15 @@ function EnkeltBarn(props: { barn: PersonsBarn }) {
: gradering !== Gradering.UGRADERT && !harVeilederTilgang ?
<div>
<UndertekstBold>Barn</UndertekstBold>
<Normaltekst>{graderingBeskrivelse(gradering)}</Normaltekst>
{graderingTekst && <Normaltekst>{graderingTekst}</Normaltekst>}
</div>
:
<div>
<UndertekstBold>{`Barn (${alder})`}</UndertekstBold>
<Normaltekst>{formateStringInUpperAndLowerCase(fornavn)}</Normaltekst>
<Normaltekst>{formateLocalDate(fodselsdato)}</Normaltekst>
<BorSammen barn={props.barn} />
<Normaltekst>{graderingBeskrivelse(gradering)}</Normaltekst>
{graderingTekst && <Normaltekst>{graderingTekst}</Normaltekst>}
</div>
}
</div>
Expand Down
12 changes: 7 additions & 5 deletions src/components/paneler/paneler.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -47,12 +47,14 @@ export const Paneler = () => {
<TilretteleggingsbehovSpa fnr={fnr} viewType={TilretteleggingsbehovViewType.VIS_TILRETTELEGGINGSBEHOV} />
</Panel>

<Panel name="personalia" tittel="Personalia">
<PersonaliaPanelInnhold />
</Panel>
<Show if={(hasData(features) && features.data[PERSONALIA_DATA_FRA_TPS])}>
<Panel name="personalia" tittel="Personalia">
<PersonaliaPanelInnhold />
</Panel>
</Show>

<Show if={(hasData(features) && features.data[PERSONALIA_DATA_FRA_PDL])}>
<Panel name="personaliaFraPdl" tittel="PersonaliaV2">
<Panel name="personaliaFraPdl" tittel="Personalia">
<PersonaliaV2PanelInnhold />
</Panel>
</Show>
Expand Down
3 changes: 2 additions & 1 deletion src/mock/api/veilarbpersonflatefs.ts
Original file line number Diff line number Diff line change
@@ -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
};

Expand Down
3 changes: 3 additions & 0 deletions src/rest/datatyper/feature.ts
Original file line number Diff line number Diff line change
@@ -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;
}

0 comments on commit 1b51af4

Please sign in to comment.