From ac763b7e75d1162b89a6ff7b290c619931490109 Mon Sep 17 00:00:00 2001 From: Betsy Carina Traran Date: Tue, 30 Apr 2024 13:26:58 +0200 Subject: [PATCH 01/10] Endre slett foerste utkast m kontaktadresse --- .../fagsystem/pdl/visning/PdlVisning.tsx | 10 ++++++-- .../partials/adresser/PdlKontaktadresse.tsx | 25 +++++++++++++++++-- .../pdlf/visning/partials/Kontaktadresse.tsx | 3 ++- .../ui/historikk/ArrayHistorikk.tsx | 24 ++++++++++++++++-- .../PersonMiljoeinfo/PdlDataTyper.tsx | 1 + 5 files changed, 56 insertions(+), 7 deletions(-) diff --git a/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdl/visning/PdlVisning.tsx b/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdl/visning/PdlVisning.tsx index 4fec63ab673..ba099b84b5e 100644 --- a/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdl/visning/PdlVisning.tsx +++ b/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdl/visning/PdlVisning.tsx @@ -45,7 +45,7 @@ export const PdlVisning = ({ return null } - const { hentPerson, hentIdenter, hentGeografiskTilknytning } = pdlData + const { hentPerson, hentIdenter, hentGeografiskTilknytning, ident } = pdlData const { foedsel, telefonnummer, @@ -67,6 +67,8 @@ export const PdlVisning = ({ const bankkontoData = getBankkontoData(fagsystemData) + const pdlfPerson = fagsystemData?.pdlforvalter?.person + return (
@@ -93,7 +95,11 @@ export const PdlVisning = ({ - + diff --git a/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdl/visning/partials/adresser/PdlKontaktadresse.tsx b/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdl/visning/partials/adresser/PdlKontaktadresse.tsx index 346b50bfc54..5521dab9ace 100644 --- a/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdl/visning/partials/adresser/PdlKontaktadresse.tsx +++ b/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdl/visning/partials/adresser/PdlKontaktadresse.tsx @@ -1,10 +1,14 @@ import SubOverskrift from '@/components/ui/subOverskrift/SubOverskrift' -import { Adresse } from '@/components/fagsystem/pdlf/visning/partials/Kontaktadresse' +import { + Adresse, + KontaktadresseVisning, +} from '@/components/fagsystem/pdlf/visning/partials/Kontaktadresse' import { KontaktadresseData } from '@/pages/gruppe/PersonVisning/PersonMiljoeinfo/PdlDataTyper' import { ArrayHistorikk } from '@/components/ui/historikk/ArrayHistorikk' type PdlKontaktadresseProps = { data: Array + ident: string } type AdresseProps = { @@ -20,7 +24,21 @@ const AdresseVisning = ({ data, idx }: AdresseProps) => { ) } -export const PdlKontaktadresse = ({ data }: PdlKontaktadresseProps) => { +const AdresseVisningRedigerbar = ({ data, idx, alleData, ident }: AdresseProps) => { + return ( +
+ +
+ ) +} + +export const PdlKontaktadresse = ({ data, pdlfData, ident }: PdlKontaktadresseProps) => { if (!data || data.length === 0) { return null } @@ -35,8 +53,11 @@ export const PdlKontaktadresse = ({ data }: PdlKontaktadresseProps) => { diff --git a/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdlf/visning/partials/Kontaktadresse.tsx b/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdlf/visning/partials/Kontaktadresse.tsx index 95e33ae68b0..26f672e162b 100644 --- a/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdlf/visning/partials/Kontaktadresse.tsx +++ b/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdlf/visning/partials/Kontaktadresse.tsx @@ -55,6 +55,7 @@ export const Adresse = ({ kontaktadresseData, idx }: AdresseTypes) => { return null } + //TODO: Vis master? return ( <> {kontaktadresseData.vegadresse && } @@ -163,7 +164,7 @@ export const Adresse = ({ kontaktadresseData, idx }: AdresseTypes) => { ) } -const KontaktadresseVisning = ({ +export const KontaktadresseVisning = ({ kontaktadresseData, idx, data, diff --git a/apps/dolly-frontend/src/main/js/src/components/ui/historikk/ArrayHistorikk.tsx b/apps/dolly-frontend/src/main/js/src/components/ui/historikk/ArrayHistorikk.tsx index 02836d9110d..ed1a0cc2d87 100644 --- a/apps/dolly-frontend/src/main/js/src/components/ui/historikk/ArrayHistorikk.tsx +++ b/apps/dolly-frontend/src/main/js/src/components/ui/historikk/ArrayHistorikk.tsx @@ -3,8 +3,17 @@ import { ErrorBoundary } from '@/components/ui/appError/ErrorBoundary' import Panel from '@/components/ui/panel/Panel' import './historikk.less' -export const ArrayHistorikk = ({ component, data, historiskData, header }) => { +export const ArrayHistorikk = ({ + component, + componentRedigerbar, + data, + pdlfData, + historiskData, + ident, + header, +}) => { const Main = component + const MainRedigerbar = componentRedigerbar const historikkHeader = header !== '' ? header + ' historikk' : 'Historikk' return ( @@ -12,10 +21,21 @@ export const ArrayHistorikk = ({ component, data, historiskData, header }) => { {data?.length > 0 && ( - {(element, idx) =>
} + {(element, idx) => { + const pdlfElement = pdlfData?.find( + (item) => item.hendelseId === element.metadata.opplysningsId, + ) + if (element.metadata.master === 'PDL' && pdlfElement) { + return ( + + ) + } + return
+ }} )} + {/*TODO: Hva gjør vi med historiske data?*/} {historiskData?.length > 0 && ( diff --git a/apps/dolly-frontend/src/main/js/src/pages/gruppe/PersonVisning/PersonMiljoeinfo/PdlDataTyper.tsx b/apps/dolly-frontend/src/main/js/src/pages/gruppe/PersonVisning/PersonMiljoeinfo/PdlDataTyper.tsx index 1ee4089fe22..ff1772e925b 100644 --- a/apps/dolly-frontend/src/main/js/src/pages/gruppe/PersonVisning/PersonMiljoeinfo/PdlDataTyper.tsx +++ b/apps/dolly-frontend/src/main/js/src/pages/gruppe/PersonVisning/PersonMiljoeinfo/PdlDataTyper.tsx @@ -27,6 +27,7 @@ export type PdlData = { hentIdenter: { identer: [Ident] } hentPerson: HentPerson hentGeografiskTilknytning: object + ident?: string } export type PdlError = { From 1fd19b7c1b534eaac925d49fc631b0238ac55d1b Mon Sep 17 00:00:00 2001 From: Betsy Carina Traran Date: Tue, 30 Apr 2024 15:30:32 +0200 Subject: [PATCH 02/10] Endre og slett funker paa kontaktadresse --- .../fagsystem/pdl/visning/PdlVisning.tsx | 4 +++ .../pdl/visning/PdlVisningConnector.tsx | 10 +++++++ .../partials/adresser/PdlKontaktadresse.tsx | 28 +++++++++++++++++-- .../ui/historikk/ArrayHistorikk.tsx | 11 +++++++- .../gruppe/PersonVisning/PersonVisning.tsx | 3 +- 5 files changed, 51 insertions(+), 5 deletions(-) create mode 100644 apps/dolly-frontend/src/main/js/src/components/fagsystem/pdl/visning/PdlVisningConnector.tsx diff --git a/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdl/visning/PdlVisning.tsx b/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdl/visning/PdlVisning.tsx index ba099b84b5e..73c6d1476d8 100644 --- a/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdl/visning/PdlVisning.tsx +++ b/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdl/visning/PdlVisning.tsx @@ -34,6 +34,7 @@ type PdlVisningProps = { export const PdlVisning = ({ pdlData, + tmpPersoner, fagsystemData = {}, loading = {}, miljoeVisning = false, @@ -69,6 +70,8 @@ export const PdlVisning = ({ const pdlfPerson = fagsystemData?.pdlforvalter?.person + const tmpPdlforvalter = tmpPersoner?.pdlforvalter + return (
@@ -98,6 +101,7 @@ export const PdlVisning = ({ diff --git a/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdl/visning/PdlVisningConnector.tsx b/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdl/visning/PdlVisningConnector.tsx new file mode 100644 index 00000000000..07243d59501 --- /dev/null +++ b/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdl/visning/PdlVisningConnector.tsx @@ -0,0 +1,10 @@ +import { PdlVisning } from '@/components/fagsystem/pdl/visning/PdlVisning' +import { connect } from 'react-redux' + +const mapStateToProps = (state: any) => { + return { + tmpPersoner: state?.redigertePersoner, + } +} + +export default connect(mapStateToProps)(PdlVisning) diff --git a/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdl/visning/partials/adresser/PdlKontaktadresse.tsx b/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdl/visning/partials/adresser/PdlKontaktadresse.tsx index 5521dab9ace..f787e081751 100644 --- a/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdl/visning/partials/adresser/PdlKontaktadresse.tsx +++ b/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdl/visning/partials/adresser/PdlKontaktadresse.tsx @@ -5,6 +5,7 @@ import { } from '@/components/fagsystem/pdlf/visning/partials/Kontaktadresse' import { KontaktadresseData } from '@/pages/gruppe/PersonVisning/PersonMiljoeinfo/PdlDataTyper' import { ArrayHistorikk } from '@/components/ui/historikk/ArrayHistorikk' +import _ from 'lodash' type PdlKontaktadresseProps = { data: Array @@ -24,13 +25,22 @@ const AdresseVisning = ({ data, idx }: AdresseProps) => { ) } -const AdresseVisningRedigerbar = ({ data, idx, alleData, ident }: AdresseProps) => { +const AdresseVisningRedigerbar = ({ + data, + idx, + alleData, + tmpData, + tmpPersoner, + ident, +}: AdresseProps) => { return (
@@ -38,8 +48,18 @@ const AdresseVisningRedigerbar = ({ data, idx, alleData, ident }: AdresseProps) ) } -export const PdlKontaktadresse = ({ data, pdlfData, ident }: PdlKontaktadresseProps) => { - if (!data || data.length === 0) { +export const PdlKontaktadresse = ({ + data, + pdlfData, + tmpPersoner, + ident, +}: PdlKontaktadresseProps) => { + if ((!data || data.length === 0) && (!tmpPersoner || Object.keys(tmpPersoner).length < 1)) { + return null + } + + const tmpData = _.get(tmpPersoner, `${ident}.person.kontaktadresse`) + if ((!data || data.length === 0) && (!tmpData || tmpData.length < 1)) { return null } @@ -57,6 +77,8 @@ export const PdlKontaktadresse = ({ data, pdlfData, ident }: PdlKontaktadressePr data={gyldigeAdresser} pdlfData={pdlfData} historiskData={historiskeAdresser} + tmpData={tmpData} + tmpPersoner={tmpPersoner} ident={ident} header={''} /> diff --git a/apps/dolly-frontend/src/main/js/src/components/ui/historikk/ArrayHistorikk.tsx b/apps/dolly-frontend/src/main/js/src/components/ui/historikk/ArrayHistorikk.tsx index ed1a0cc2d87..3914f680b33 100644 --- a/apps/dolly-frontend/src/main/js/src/components/ui/historikk/ArrayHistorikk.tsx +++ b/apps/dolly-frontend/src/main/js/src/components/ui/historikk/ArrayHistorikk.tsx @@ -9,6 +9,8 @@ export const ArrayHistorikk = ({ data, pdlfData, historiskData, + tmpData, + tmpPersoner, ident, header, }) => { @@ -27,7 +29,14 @@ export const ArrayHistorikk = ({ ) if (element.metadata.master === 'PDL' && pdlfElement) { return ( - + ) } return
diff --git a/apps/dolly-frontend/src/main/js/src/pages/gruppe/PersonVisning/PersonVisning.tsx b/apps/dolly-frontend/src/main/js/src/pages/gruppe/PersonVisning/PersonVisning.tsx index 3ec10eeb204..dd49d9fffd9 100644 --- a/apps/dolly-frontend/src/main/js/src/pages/gruppe/PersonVisning/PersonVisning.tsx +++ b/apps/dolly-frontend/src/main/js/src/pages/gruppe/PersonVisning/PersonVisning.tsx @@ -90,6 +90,7 @@ import useBoolean from '@/utils/hooks/useBoolean' import { MalModal, malTyper } from '@/pages/minSide/maler/MalModal' import { useTenorOversikt } from '@/utils/hooks/useTenorSoek' import { SkatteetatenVisning } from '@/components/fagsystem/skatteetaten/visning/SkatteetatenVisning' +import PdlVisningConnector from '@/components/fagsystem/pdl/visning/PdlVisningConnector' const getIdenttype = (ident) => { if (parseInt(ident.charAt(0)) > 3) { @@ -432,7 +433,7 @@ export default ({ )} {ident.master === 'PDLF' && } {ident.master === 'PDL' && ( - + )} {visArbeidsforhold && ( Date: Thu, 2 May 2024 11:51:12 +0200 Subject: [PATCH 03/10] Div fix kontaktadresse --- .../fagsystem/pdl/visning/PdlVisning.tsx | 4 +++- .../partials/adresser/PdlKontaktadresse.tsx | 16 ++++++++++++++-- .../components/ui/historikk/ArrayHistorikk.tsx | 2 ++ 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdl/visning/PdlVisning.tsx b/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdl/visning/PdlVisning.tsx index 73c6d1476d8..460d89a3eaf 100644 --- a/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdl/visning/PdlVisning.tsx +++ b/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdl/visning/PdlVisning.tsx @@ -27,6 +27,7 @@ import { getBankkontoData } from '@/components/fagsystem/pdlf/visning/PdlfVisnin type PdlVisningProps = { pdlData: PdlData + tmpPersoner: any fagsystemData?: any loading?: any miljoeVisning?: boolean @@ -69,7 +70,7 @@ export const PdlVisning = ({ const bankkontoData = getBankkontoData(fagsystemData) const pdlfPerson = fagsystemData?.pdlforvalter?.person - + const identtype = pdlfPerson?.identtype const tmpPdlforvalter = tmpPersoner?.pdlforvalter return ( @@ -103,6 +104,7 @@ export const PdlVisning = ({ pdlfData={pdlfPerson?.kontaktadresse} tmpPersoner={tmpPdlforvalter} ident={ident} + identtype={identtype} /> diff --git a/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdl/visning/partials/adresser/PdlKontaktadresse.tsx b/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdl/visning/partials/adresser/PdlKontaktadresse.tsx index f787e081751..01f3b592ea1 100644 --- a/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdl/visning/partials/adresser/PdlKontaktadresse.tsx +++ b/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdl/visning/partials/adresser/PdlKontaktadresse.tsx @@ -9,12 +9,20 @@ import _ from 'lodash' type PdlKontaktadresseProps = { data: Array - ident: string + pdlfData?: Array + tmpPersoner?: any + ident?: string + identtype?: string } type AdresseProps = { data: KontaktadresseData - idx?: number + idx: number + alleData?: Array + tmpData?: any + tmpPersoner?: any + ident?: string + identtype?: string } const AdresseVisning = ({ data, idx }: AdresseProps) => { @@ -32,6 +40,7 @@ const AdresseVisningRedigerbar = ({ tmpData, tmpPersoner, ident, + identtype, }: AdresseProps) => { return (
@@ -42,6 +51,7 @@ const AdresseVisningRedigerbar = ({ tmpData={tmpData} tmpPersoner={tmpPersoner} ident={ident} + identtype={identtype} erPdlVisning={false} />
@@ -53,6 +63,7 @@ export const PdlKontaktadresse = ({ pdlfData, tmpPersoner, ident, + identtype, }: PdlKontaktadresseProps) => { if ((!data || data.length === 0) && (!tmpPersoner || Object.keys(tmpPersoner).length < 1)) { return null @@ -80,6 +91,7 @@ export const PdlKontaktadresse = ({ tmpData={tmpData} tmpPersoner={tmpPersoner} ident={ident} + identtype={identtype} header={''} /> diff --git a/apps/dolly-frontend/src/main/js/src/components/ui/historikk/ArrayHistorikk.tsx b/apps/dolly-frontend/src/main/js/src/components/ui/historikk/ArrayHistorikk.tsx index 3914f680b33..12a602a436f 100644 --- a/apps/dolly-frontend/src/main/js/src/components/ui/historikk/ArrayHistorikk.tsx +++ b/apps/dolly-frontend/src/main/js/src/components/ui/historikk/ArrayHistorikk.tsx @@ -12,6 +12,7 @@ export const ArrayHistorikk = ({ tmpData, tmpPersoner, ident, + identtype, header, }) => { const Main = component @@ -36,6 +37,7 @@ export const ArrayHistorikk = ({ tmpData={tmpData} tmpPersoner={tmpPersoner} ident={ident} + identtype={identtype} /> ) } From 589b34ca68508a776e6014c7f2e1bb455ffa1e6d Mon Sep 17 00:00:00 2001 From: Betsy Carina Traran Date: Thu, 2 May 2024 12:26:05 +0200 Subject: [PATCH 04/10] Endre slett boadresse --- .../fagsystem/pdl/visning/PdlVisning.tsx | 10 +++- .../partials/adresser/PdlBoadresse.tsx | 49 +++++++++++++++++-- .../pdlf/visning/partials/Boadresse.tsx | 4 +- 3 files changed, 57 insertions(+), 6 deletions(-) diff --git a/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdl/visning/PdlVisning.tsx b/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdl/visning/PdlVisning.tsx index 460d89a3eaf..f4bc1f5367e 100644 --- a/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdl/visning/PdlVisning.tsx +++ b/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdl/visning/PdlVisning.tsx @@ -72,7 +72,7 @@ export const PdlVisning = ({ const pdlfPerson = fagsystemData?.pdlforvalter?.person const identtype = pdlfPerson?.identtype const tmpPdlforvalter = tmpPersoner?.pdlforvalter - + console.log('pdlfPerson: ', pdlfPerson) //TODO - SLETT MEG return (
@@ -95,7 +95,13 @@ export const PdlVisning = ({ data={bankkontoData} loading={loading?.tpsMessaging || loading?.kontoregister} /> - + diff --git a/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdl/visning/partials/adresser/PdlBoadresse.tsx b/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdl/visning/partials/adresser/PdlBoadresse.tsx index 4cb5f3a69d5..1cd65e486c0 100644 --- a/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdl/visning/partials/adresser/PdlBoadresse.tsx +++ b/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdl/visning/partials/adresser/PdlBoadresse.tsx @@ -1,15 +1,23 @@ import SubOverskrift from '@/components/ui/subOverskrift/SubOverskrift' import { BostedData } from '@/pages/gruppe/PersonVisning/PersonMiljoeinfo/PdlDataTyper' import { ArrayHistorikk } from '@/components/ui/historikk/ArrayHistorikk' -import { Adresse } from '@/components/fagsystem/pdlf/visning/partials/Boadresse' +import { Adresse, BoadresseVisning } from '@/components/fagsystem/pdlf/visning/partials/Boadresse' type PdlBoadresseProps = { data: Array + pdlfData?: Array + tmpPersoner?: any + ident?: string + identtype?: string } type AdresseProps = { data: BostedData idx?: number + alleData?: Array + tmpPersoner?: any + ident?: string + identtype?: string } const AdresseVisning = ({ data, idx }: AdresseProps) => { @@ -20,10 +28,40 @@ const AdresseVisning = ({ data, idx }: AdresseProps) => { ) } -export const PdlBoadresse = ({ data }: PdlBoadresseProps) => { - if (!data || data.length === 0) { +const AdresseVisningRedigerbar = ({ + data, + idx, + alleData, + tmpPersoner, + ident, + identtype, +}: AdresseProps) => { + return ( +
+ +
+ ) +} + +export const PdlBoadresse = ({ + data, + pdlfData, + tmpPersoner, + ident, + identtype, +}: PdlBoadresseProps) => { + if ((!data || data.length === 0) && (!tmpPersoner || Object.keys(tmpPersoner).length < 1)) { return null } + const gyldigeAdresser = data.filter((adresse: BostedData) => !adresse.metadata?.historisk) const historiskeAdresser = data.filter((adresse: BostedData) => adresse.metadata?.historisk) @@ -32,8 +70,13 @@ export const PdlBoadresse = ({ data }: PdlBoadresseProps) => { diff --git a/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdlf/visning/partials/Boadresse.tsx b/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdlf/visning/partials/Boadresse.tsx index 440d9bbcd11..d1e84427ad9 100644 --- a/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdlf/visning/partials/Boadresse.tsx +++ b/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdlf/visning/partials/Boadresse.tsx @@ -40,6 +40,8 @@ export const Adresse = ({ boadresseData, idx }: AdresseTypes) => { if (!boadresseData) { return null } + + //TODO: Vis master? return ( <> {boadresseData.vegadresse && } @@ -50,7 +52,7 @@ export const Adresse = ({ boadresseData, idx }: AdresseTypes) => { ) } -const BoadresseVisning = ({ +export const BoadresseVisning = ({ boadresseData, idx, data, From cb5a8efe2794a15808c85d71c40cce71f0cc3b81 Mon Sep 17 00:00:00 2001 From: Betsy Carina Traran Date: Thu, 2 May 2024 14:41:22 +0200 Subject: [PATCH 05/10] Tilpass historiske data --- .../ui/historikk/ArrayHistorikk.tsx | 41 ++++++++++--------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/apps/dolly-frontend/src/main/js/src/components/ui/historikk/ArrayHistorikk.tsx b/apps/dolly-frontend/src/main/js/src/components/ui/historikk/ArrayHistorikk.tsx index 12a602a436f..c66a9c4bcbc 100644 --- a/apps/dolly-frontend/src/main/js/src/components/ui/historikk/ArrayHistorikk.tsx +++ b/apps/dolly-frontend/src/main/js/src/components/ui/historikk/ArrayHistorikk.tsx @@ -19,39 +19,42 @@ export const ArrayHistorikk = ({ const MainRedigerbar = componentRedigerbar const historikkHeader = header !== '' ? header + ' historikk' : 'Historikk' + const getComponent = (element, idx) => { + const pdlfElement = pdlfData?.find((item) => item.hendelseId === element.metadata.opplysningsId) + if (element.metadata.master === 'PDL' && pdlfElement) { + return ( + + ) + } + return
+ } + return (
{data?.length > 0 && ( {(element, idx) => { - const pdlfElement = pdlfData?.find( - (item) => item.hendelseId === element.metadata.opplysningsId, - ) - if (element.metadata.master === 'PDL' && pdlfElement) { - return ( - - ) - } - return
+ return getComponent(element, idx) }} )} - {/*TODO: Hva gjør vi med historiske data?*/} {historiskData?.length > 0 && ( - {(element, idx) =>
} + {(element, idx) => { + return getComponent(element, idx) + }} From 64cdc2460f73622e5615a09c6916c8484e72967b Mon Sep 17 00:00:00 2001 From: Betsy Carina Traran Date: Fri, 3 May 2024 11:10:57 +0200 Subject: [PATCH 06/10] Endre slett oppholdsadresse --- .../fagsystem/pdl/visning/PdlVisning.tsx | 8 ++- .../partials/adresser/PdlOppholdsadresse.tsx | 51 +++++++++++++++++-- .../pdlf/visning/partials/Oppholdsadresse.tsx | 3 +- 3 files changed, 57 insertions(+), 5 deletions(-) diff --git a/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdl/visning/PdlVisning.tsx b/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdl/visning/PdlVisning.tsx index f4bc1f5367e..31a65530f2b 100644 --- a/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdl/visning/PdlVisning.tsx +++ b/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdl/visning/PdlVisning.tsx @@ -103,7 +103,13 @@ export const PdlVisning = ({ identtype={identtype} /> - + + pdlfData?: Array + tmpPersoner?: any + ident?: string + identtype?: string } type AdresseProps = { data: OppholdsadresseData idx?: number + alleData?: Array + tmpPersoner?: any + ident?: string + identtype?: string } const AdresseVisning = ({ data, idx }: AdresseProps) => { @@ -20,8 +31,37 @@ const AdresseVisning = ({ data, idx }: AdresseProps) => { ) } -export const PdlOppholdsadresse = ({ data }: PdlOppholdsadresseProps) => { - if (!data || data.length === 0) { +const AdresseVisningRedigerbar = ({ + data, + idx, + alleData, + tmpPersoner, + ident, + identtype, +}: AdresseProps) => { + return ( +
+ +
+ ) +} + +export const PdlOppholdsadresse = ({ + data, + pdlfData, + tmpPersoner, + ident, + identtype, +}: PdlOppholdsadresseProps) => { + if ((!data || data.length === 0) && (!tmpPersoner || Object.keys(tmpPersoner).length < 1)) { return null } @@ -37,8 +77,13 @@ export const PdlOppholdsadresse = ({ data }: PdlOppholdsadresseProps) => { diff --git a/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdlf/visning/partials/Oppholdsadresse.tsx b/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdlf/visning/partials/Oppholdsadresse.tsx index 40d2ede34ec..08075465da7 100644 --- a/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdlf/visning/partials/Oppholdsadresse.tsx +++ b/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdlf/visning/partials/Oppholdsadresse.tsx @@ -40,6 +40,7 @@ export const Adresse = ({ oppholdsadresseData, idx }: AdresseTypes) => { return null } + // TODO: Vis master? return ( <> {oppholdsadresseData.vegadresse && } @@ -53,7 +54,7 @@ export const Adresse = ({ oppholdsadresseData, idx }: AdresseTypes) => { ) } -const OppholdsadresseVisning = ({ +export const OppholdsadresseVisning = ({ oppholdsadresseData, idx, data, From 80775d8c96d271e9772de2d87308037734bc3aa8 Mon Sep 17 00:00:00 2001 From: Betsy Carina Traran Date: Fri, 3 May 2024 16:35:47 +0200 Subject: [PATCH 07/10] Endre slett adressebeskyttelse + send master til alle attr --- .../fagsystem/pdl/visning/PdlVisning.tsx | 9 ++++- .../partials/adresser/PdlBoadresse.tsx | 3 ++ .../partials/adresser/PdlKontaktadresse.tsx | 3 ++ .../partials/adresser/PdlOppholdsadresse.tsx | 3 ++ .../visning/partials/Adressebeskyttelse.tsx | 40 ++++++++++++------- .../pdlf/visning/partials/Boadresse.tsx | 3 ++ .../pdlf/visning/partials/Kontaktadresse.tsx | 3 ++ .../pdlf/visning/partials/Oppholdsadresse.tsx | 3 ++ .../visningRedigerbar/VisningRedigerbar.tsx | 30 ++++++++++++-- .../ui/historikk/ArrayHistorikk.tsx | 1 + 10 files changed, 79 insertions(+), 19 deletions(-) diff --git a/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdl/visning/PdlVisning.tsx b/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdl/visning/PdlVisning.tsx index 31a65530f2b..40a6d4939e6 100644 --- a/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdl/visning/PdlVisning.tsx +++ b/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdl/visning/PdlVisning.tsx @@ -118,7 +118,14 @@ export const PdlVisning = ({ ident={ident} identtype={identtype} /> - + diff --git a/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdl/visning/partials/adresser/PdlBoadresse.tsx b/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdl/visning/partials/adresser/PdlBoadresse.tsx index 1cd65e486c0..cc604eb39e0 100644 --- a/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdl/visning/partials/adresser/PdlBoadresse.tsx +++ b/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdl/visning/partials/adresser/PdlBoadresse.tsx @@ -18,6 +18,7 @@ type AdresseProps = { tmpPersoner?: any ident?: string identtype?: string + master?: string } const AdresseVisning = ({ data, idx }: AdresseProps) => { @@ -35,6 +36,7 @@ const AdresseVisningRedigerbar = ({ tmpPersoner, ident, identtype, + master, }: AdresseProps) => { return (
@@ -46,6 +48,7 @@ const AdresseVisningRedigerbar = ({ ident={ident} identtype={identtype} erPdlVisning={false} + master={master} />
) diff --git a/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdl/visning/partials/adresser/PdlKontaktadresse.tsx b/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdl/visning/partials/adresser/PdlKontaktadresse.tsx index 01f3b592ea1..e39d9dbff90 100644 --- a/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdl/visning/partials/adresser/PdlKontaktadresse.tsx +++ b/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdl/visning/partials/adresser/PdlKontaktadresse.tsx @@ -23,6 +23,7 @@ type AdresseProps = { tmpPersoner?: any ident?: string identtype?: string + master?: string } const AdresseVisning = ({ data, idx }: AdresseProps) => { @@ -41,6 +42,7 @@ const AdresseVisningRedigerbar = ({ tmpPersoner, ident, identtype, + master, }: AdresseProps) => { return (
@@ -53,6 +55,7 @@ const AdresseVisningRedigerbar = ({ ident={ident} identtype={identtype} erPdlVisning={false} + master={master} />
) diff --git a/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdl/visning/partials/adresser/PdlOppholdsadresse.tsx b/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdl/visning/partials/adresser/PdlOppholdsadresse.tsx index 6d87dc9263e..73672e9db6c 100644 --- a/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdl/visning/partials/adresser/PdlOppholdsadresse.tsx +++ b/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdl/visning/partials/adresser/PdlOppholdsadresse.tsx @@ -21,6 +21,7 @@ type AdresseProps = { tmpPersoner?: any ident?: string identtype?: string + master?: string } const AdresseVisning = ({ data, idx }: AdresseProps) => { @@ -38,6 +39,7 @@ const AdresseVisningRedigerbar = ({ tmpPersoner, ident, identtype, + master, }: AdresseProps) => { return (
@@ -49,6 +51,7 @@ const AdresseVisningRedigerbar = ({ ident={ident} erPdlVisning={false} identtype={identtype} + master={master} />
) diff --git a/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdlf/visning/partials/Adressebeskyttelse.tsx b/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdlf/visning/partials/Adressebeskyttelse.tsx index ae7e9b792e6..ac3f37897c3 100644 --- a/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdlf/visning/partials/Adressebeskyttelse.tsx +++ b/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdlf/visning/partials/Adressebeskyttelse.tsx @@ -27,6 +27,7 @@ type AdressebeskyttelseVisningTypes = { ident?: string identtype?: string erPdlVisning?: boolean + master?: string } type AdressebeskyttelseLesTypes = { @@ -42,7 +43,7 @@ const AdressebeskyttelseLes = ({ adressebeskyttelse, idx }: AdressebeskyttelseLe title="Gradering" value={showLabel('gradering', adressebeskyttelse.gradering)} /> - +
) @@ -56,6 +57,7 @@ const AdressebeskyttelseVisning = ({ ident, identtype, erPdlVisning, + master, }: AdressebeskyttelseVisningTypes) => { const initAdressebeskyttelse = Object.assign( _.cloneDeep(getInitialAdressebeskyttelse()), @@ -97,12 +99,14 @@ const AdressebeskyttelseVisning = ({ path="adressebeskyttelse" ident={ident} identtype={identtype} + master={master} /> ) } export const Adressebeskyttelse = ({ data, + pdlfData, tmpPersoner, ident, identtype, @@ -119,21 +123,27 @@ export const Adressebeskyttelse = ({
- {(adressebeskyttelse: AdressebeskyttelseData, idx: number) => - erRedigerbar ? ( - - ) : ( - + {(adressebeskyttelse: AdressebeskyttelseData, idx: number) => { + const master = adressebeskyttelse?.metadata?.master + const pdlfElement = pdlfData?.find( + (item) => item.hendelseId === adressebeskyttelse?.metadata?.opplysningsId, ) - } + if (erRedigerbar) { + return ( + + ) + } + return + }}
diff --git a/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdlf/visning/partials/Boadresse.tsx b/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdlf/visning/partials/Boadresse.tsx index d1e84427ad9..c2ad8cb0fd6 100644 --- a/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdlf/visning/partials/Boadresse.tsx +++ b/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdlf/visning/partials/Boadresse.tsx @@ -29,6 +29,7 @@ type BoadresseVisningTypes = { ident?: string identtype?: string erPdlVisning?: boolean + master?: string } type AdresseTypes = { @@ -60,6 +61,7 @@ export const BoadresseVisning = ({ ident, identtype, erPdlVisning, + master, }: BoadresseVisningTypes) => { const initBoadresse = Object.assign(_.cloneDeep(getInitialBostedsadresse()), data[idx]) const initialValues = { bostedsadresse: initBoadresse } @@ -102,6 +104,7 @@ export const BoadresseVisning = ({ ident={ident} identtype={identtype} personFoerLeggTil={personFoerLeggTil} + master={master} /> ) } diff --git a/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdlf/visning/partials/Kontaktadresse.tsx b/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdlf/visning/partials/Kontaktadresse.tsx index 26f672e162b..e1e935775f2 100644 --- a/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdlf/visning/partials/Kontaktadresse.tsx +++ b/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdlf/visning/partials/Kontaktadresse.tsx @@ -36,6 +36,7 @@ type KontaktadresseVisningTypes = { ident: number erPdlVisning: boolean identtype?: string + master?: string } type AdresseTypes = { @@ -173,6 +174,7 @@ export const KontaktadresseVisning = ({ ident, erPdlVisning, identtype, + master, }: KontaktadresseVisningTypes) => { const initKontaktadresse = Object.assign( _.cloneDeep(getInitialKontaktadresse()), @@ -210,6 +212,7 @@ export const KontaktadresseVisning = ({ path="kontaktadresse" ident={ident} identtype={identtype} + master={master} /> ) } diff --git a/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdlf/visning/partials/Oppholdsadresse.tsx b/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdlf/visning/partials/Oppholdsadresse.tsx index 08075465da7..660b2119f47 100644 --- a/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdlf/visning/partials/Oppholdsadresse.tsx +++ b/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdlf/visning/partials/Oppholdsadresse.tsx @@ -33,6 +33,7 @@ type OppholdsadresseVisningTypes = { ident: string erPdlVisning: boolean identtype?: string + master?: string } export const Adresse = ({ oppholdsadresseData, idx }: AdresseTypes) => { @@ -62,6 +63,7 @@ export const OppholdsadresseVisning = ({ ident, erPdlVisning, identtype, + master, }: OppholdsadresseVisningTypes) => { const initOppholdsadresse = Object.assign(_.cloneDeep(getInitialOppholdsadresse()), data[idx]) const initialValues = { oppholdsadresse: initOppholdsadresse } @@ -95,6 +97,7 @@ export const OppholdsadresseVisning = ({ path="oppholdsadresse" ident={ident} identtype={identtype} + master={master} /> ) } diff --git a/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdlf/visning/visningRedigerbar/VisningRedigerbar.tsx b/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdlf/visning/visningRedigerbar/VisningRedigerbar.tsx index 39d34782fc3..4a459a0087a 100644 --- a/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdlf/visning/visningRedigerbar/VisningRedigerbar.tsx +++ b/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdlf/visning/visningRedigerbar/VisningRedigerbar.tsx @@ -54,6 +54,7 @@ type VisningTypes = { personValues: any relasjoner: any relatertPersonInfo: any + master: any } enum Attributt { @@ -120,6 +121,7 @@ export const VisningRedigerbar = ({ personValues = null, relasjoner = null, relatertPersonInfo = null, + master = null, }: VisningTypes) => { const [visningModus, setVisningModus] = useState(Modus.Les) const [errorMessagePdlf, setErrorMessagePdlf] = useState(null) @@ -267,17 +269,39 @@ export const VisningRedigerbar = ({ /> ) case Attributt.Boadresse: - return + return ( + + ) case Attributt.Oppholdsadresse: - return + return ( + + ) case Attributt.Kontaktadresse: - return + return ( + + ) case Attributt.Adressebeskyttelse: return ( ) case Attributt.DeltBosted: diff --git a/apps/dolly-frontend/src/main/js/src/components/ui/historikk/ArrayHistorikk.tsx b/apps/dolly-frontend/src/main/js/src/components/ui/historikk/ArrayHistorikk.tsx index c66a9c4bcbc..28113731d96 100644 --- a/apps/dolly-frontend/src/main/js/src/components/ui/historikk/ArrayHistorikk.tsx +++ b/apps/dolly-frontend/src/main/js/src/components/ui/historikk/ArrayHistorikk.tsx @@ -31,6 +31,7 @@ export const ArrayHistorikk = ({ tmpPersoner={tmpPersoner} ident={ident} identtype={identtype} + master="PDL" /> ) } From 2a7b9173b5916732666669ee9972b50cee081e48 Mon Sep 17 00:00:00 2001 From: Betsy Carina Traran Date: Mon, 6 May 2024 12:04:31 +0200 Subject: [PATCH 08/10] Visning av master --- .../js/src/components/fagsystem/pdlf/PdlTypes.tsx | 2 ++ .../pdlf/visning/partials/Adressebeskyttelse.tsx | 5 ++++- .../fagsystem/pdlf/visning/partials/Boadresse.tsx | 1 - .../pdlf/visning/partials/Kontaktadresse.tsx | 14 ++++++++++++-- .../pdlf/visning/partials/Matrikkeladresse.tsx | 3 ++- .../pdlf/visning/partials/Oppholdsadresse.tsx | 1 - .../pdlf/visning/partials/UkjentBosted.tsx | 4 +++- .../pdlf/visning/partials/UtenlandskAdresse.tsx | 3 ++- .../fagsystem/pdlf/visning/partials/Vegadresse.tsx | 3 ++- 9 files changed, 27 insertions(+), 9 deletions(-) diff --git a/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdlf/PdlTypes.tsx b/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdlf/PdlTypes.tsx index f9ef9378de6..a4f7364e2de 100644 --- a/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdlf/PdlTypes.tsx +++ b/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdlf/PdlTypes.tsx @@ -85,6 +85,8 @@ export type Utflytting = { export type AdressebeskyttelseData = { gradering: string id?: number + master?: string + metadata?: any } export type SivilstandData = { diff --git a/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdlf/visning/partials/Adressebeskyttelse.tsx b/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdlf/visning/partials/Adressebeskyttelse.tsx index ac3f37897c3..712334287a0 100644 --- a/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdlf/visning/partials/Adressebeskyttelse.tsx +++ b/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdlf/visning/partials/Adressebeskyttelse.tsx @@ -43,7 +43,10 @@ const AdressebeskyttelseLes = ({ adressebeskyttelse, idx }: AdressebeskyttelseLe title="Gradering" value={showLabel('gradering', adressebeskyttelse.gradering)} /> - +
) diff --git a/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdlf/visning/partials/Boadresse.tsx b/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdlf/visning/partials/Boadresse.tsx index c2ad8cb0fd6..dd5ef205155 100644 --- a/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdlf/visning/partials/Boadresse.tsx +++ b/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdlf/visning/partials/Boadresse.tsx @@ -42,7 +42,6 @@ export const Adresse = ({ boadresseData, idx }: AdresseTypes) => { return null } - //TODO: Vis master? return ( <> {boadresseData.vegadresse && } diff --git a/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdlf/visning/partials/Kontaktadresse.tsx b/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdlf/visning/partials/Kontaktadresse.tsx index e1e935775f2..5052b471f24 100644 --- a/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdlf/visning/partials/Kontaktadresse.tsx +++ b/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdlf/visning/partials/Kontaktadresse.tsx @@ -56,7 +56,6 @@ export const Adresse = ({ kontaktadresseData, idx }: AdresseTypes) => { return null } - //TODO: Vis master? return ( <> {kontaktadresseData.vegadresse && } @@ -88,7 +87,10 @@ export const Adresse = ({ kontaktadresseData, idx }: AdresseTypes) => { - +
)} @@ -124,6 +126,10 @@ export const Adresse = ({ kontaktadresseData, idx }: AdresseTypes) => { )} +
)} @@ -158,6 +164,10 @@ export const Adresse = ({ kontaktadresseData, idx }: AdresseTypes) => { kodeverk={AdresseKodeverk.StatsborgerskapLand} /> +
)} diff --git a/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdlf/visning/partials/Matrikkeladresse.tsx b/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdlf/visning/partials/Matrikkeladresse.tsx index 0078dbae450..f4d7618f6cd 100644 --- a/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdlf/visning/partials/Matrikkeladresse.tsx +++ b/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdlf/visning/partials/Matrikkeladresse.tsx @@ -18,6 +18,7 @@ interface MatrikkeladresseValues { oppholdAnnetSted?: string coAdressenavn?: string metadata: any + master?: string } idx: number } @@ -36,7 +37,7 @@ export const Matrikkeladresse = ({ adresse, idx }: MatrikkeladresseValues) => { metadata, } = adresse - const master = metadata?.master + const master = adresse.master || metadata?.master return ( <> diff --git a/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdlf/visning/partials/Oppholdsadresse.tsx b/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdlf/visning/partials/Oppholdsadresse.tsx index 660b2119f47..4e603648d1e 100644 --- a/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdlf/visning/partials/Oppholdsadresse.tsx +++ b/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdlf/visning/partials/Oppholdsadresse.tsx @@ -41,7 +41,6 @@ export const Adresse = ({ oppholdsadresseData, idx }: AdresseTypes) => { return null } - // TODO: Vis master? return ( <> {oppholdsadresseData.vegadresse && } diff --git a/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdlf/visning/partials/UkjentBosted.tsx b/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdlf/visning/partials/UkjentBosted.tsx index d4dd6b6e818..f19cb7d1822 100644 --- a/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdlf/visning/partials/UkjentBosted.tsx +++ b/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdlf/visning/partials/UkjentBosted.tsx @@ -13,6 +13,8 @@ type AdresseData = { bostedskommune?: string } coAdressenavn?: string + master?: string + metadata?: any } idx: number } @@ -28,7 +30,7 @@ export const UkjentBosted = ({ adresse, idx }: AdresseData) => { metadata, } = adresse - const master = metadata?.master + const master = adresse.master || metadata?.master return ( <> diff --git a/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdlf/visning/partials/UtenlandskAdresse.tsx b/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdlf/visning/partials/UtenlandskAdresse.tsx index c670c725bed..8a824f50b50 100644 --- a/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdlf/visning/partials/UtenlandskAdresse.tsx +++ b/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdlf/visning/partials/UtenlandskAdresse.tsx @@ -23,6 +23,7 @@ type AdresseData = { oppholdAnnetSted?: string coAdressenavn?: string metadata: any + master?: string } idx: number } @@ -46,7 +47,7 @@ export const UtenlandskAdresse = ({ adresse, idx }: AdresseData) => { metadata, } = adresse - const master = metadata?.master + const master = adresse.master || metadata?.master return ( <> diff --git a/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdlf/visning/partials/Vegadresse.tsx b/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdlf/visning/partials/Vegadresse.tsx index 80b9dd16803..eb2a79d1ede 100644 --- a/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdlf/visning/partials/Vegadresse.tsx +++ b/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdlf/visning/partials/Vegadresse.tsx @@ -18,6 +18,7 @@ interface VegadresseValues { oppholdAnnetSted?: string coAdressenavn?: string metadata: any + master?: string } idx: number } @@ -43,7 +44,7 @@ export const Vegadresse = ({ adresse, idx }: VegadresseValues) => { coAdressenavn, metadata, } = adresse - const master = metadata?.master + const master = adresse.master || metadata?.master return ( <> From be2d049cc2980a8b63c4c95a88582f66e18b54d1 Mon Sep 17 00:00:00 2001 From: Betsy Carina Traran Date: Mon, 6 May 2024 17:13:36 +0200 Subject: [PATCH 09/10] Fix visning adressebeskyttelse --- .../src/components/fagsystem/pdl/visning/PdlVisning.tsx | 2 +- .../src/components/fagsystem/pdlf/visning/PdlfVisning.tsx | 3 ++- .../pdlf/visning/partials/Adressebeskyttelse.tsx | 8 +++++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdl/visning/PdlVisning.tsx b/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdl/visning/PdlVisning.tsx index 40a6d4939e6..88cca27c40f 100644 --- a/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdl/visning/PdlVisning.tsx +++ b/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdl/visning/PdlVisning.tsx @@ -124,7 +124,7 @@ export const PdlVisning = ({ tmpPersoner={tmpPdlforvalter} ident={ident} identtype={identtype} - erPdlVisning + erPdlVisning={miljoeVisning} /> diff --git a/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdlf/visning/PdlfVisning.tsx b/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdlf/visning/PdlfVisning.tsx index 91c87146b6b..7c61a585444 100644 --- a/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdlf/visning/PdlfVisning.tsx +++ b/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdlf/visning/PdlfVisning.tsx @@ -105,7 +105,7 @@ export const PdlfVisning = ({ fagsystemData, loading, tmpPersoner, erRedigerbar ) From be9ea2484846bcc50b87aaaab5cb81741492b6d7 Mon Sep 17 00:00:00 2001 From: Betsy Carina Traran Date: Mon, 6 May 2024 18:51:28 +0200 Subject: [PATCH 10/10] Fikset oppholdsadresse --- .../fagsystem/pdl/visning/PdlVisning.tsx | 2 +- .../partials/adresser/PdlOppholdsadresse.tsx | 10 ++++++++++ .../pdlf/visning/partials/Oppholdsadresse.tsx | 17 ++++++++++++++--- 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdl/visning/PdlVisning.tsx b/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdl/visning/PdlVisning.tsx index 88cca27c40f..355d9e5c8a2 100644 --- a/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdl/visning/PdlVisning.tsx +++ b/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdl/visning/PdlVisning.tsx @@ -72,7 +72,7 @@ export const PdlVisning = ({ const pdlfPerson = fagsystemData?.pdlforvalter?.person const identtype = pdlfPerson?.identtype const tmpPdlforvalter = tmpPersoner?.pdlforvalter - console.log('pdlfPerson: ', pdlfPerson) //TODO - SLETT MEG + return (
diff --git a/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdl/visning/partials/adresser/PdlOppholdsadresse.tsx b/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdl/visning/partials/adresser/PdlOppholdsadresse.tsx index 73672e9db6c..0b31e4335e4 100644 --- a/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdl/visning/partials/adresser/PdlOppholdsadresse.tsx +++ b/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdl/visning/partials/adresser/PdlOppholdsadresse.tsx @@ -5,6 +5,7 @@ import { } from '@/components/fagsystem/pdlf/visning/partials/Oppholdsadresse' import { OppholdsadresseData } from '@/pages/gruppe/PersonVisning/PersonMiljoeinfo/PdlDataTyper' import { ArrayHistorikk } from '@/components/ui/historikk/ArrayHistorikk' +import _ from 'lodash' type PdlOppholdsadresseProps = { data: Array @@ -18,6 +19,7 @@ type AdresseProps = { data: OppholdsadresseData idx?: number alleData?: Array + tmpData?: any tmpPersoner?: any ident?: string identtype?: string @@ -36,6 +38,7 @@ const AdresseVisningRedigerbar = ({ data, idx, alleData, + tmpData, tmpPersoner, ident, identtype, @@ -47,6 +50,7 @@ const AdresseVisningRedigerbar = ({ oppholdsadresseData={data} idx={idx} data={alleData} + tmpData={tmpData} tmpPersoner={tmpPersoner} ident={ident} erPdlVisning={false} @@ -68,6 +72,11 @@ export const PdlOppholdsadresse = ({ return null } + const tmpData = _.get(tmpPersoner, `${ident}.person.oppholdsadresse`) + if ((!data || data.length === 0) && (!tmpData || tmpData.length < 1)) { + return null + } + const gyldigeAdresser = data.filter( (adresse: OppholdsadresseData) => !adresse.metadata?.historisk, ) @@ -84,6 +93,7 @@ export const PdlOppholdsadresse = ({ data={gyldigeAdresser} pdlfData={pdlfData} historiskData={historiskeAdresser} + tmpData={tmpData} tmpPersoner={tmpPersoner} ident={ident} identtype={identtype} diff --git a/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdlf/visning/partials/Oppholdsadresse.tsx b/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdlf/visning/partials/Oppholdsadresse.tsx index 4e603648d1e..d150e52ae79 100644 --- a/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdlf/visning/partials/Oppholdsadresse.tsx +++ b/apps/dolly-frontend/src/main/js/src/components/fagsystem/pdlf/visning/partials/Oppholdsadresse.tsx @@ -29,6 +29,7 @@ type OppholdsadresseVisningTypes = { oppholdsadresseData: any idx: number data: Array + tmpData: any tmpPersoner: Array ident: string erPdlVisning: boolean @@ -58,13 +59,17 @@ export const OppholdsadresseVisning = ({ oppholdsadresseData, idx, data, + tmpData, tmpPersoner, ident, erPdlVisning, identtype, master, }: OppholdsadresseVisningTypes) => { - const initOppholdsadresse = Object.assign(_.cloneDeep(getInitialOppholdsadresse()), data[idx]) + const initOppholdsadresse = Object.assign( + _.cloneDeep(getInitialOppholdsadresse()), + data[idx] || tmpData?.[idx], + ) const initialValues = { oppholdsadresse: initOppholdsadresse } const redigertOppholdsadressePdlf = _.get(tmpPersoner, `${ident}.person.oppholdsadresse`)?.find( @@ -109,7 +114,12 @@ export const Oppholdsadresse = ({ identtype, erRedigerbar = true, }: OppholdsadresseTypes) => { - if (!data || data.length === 0) { + if ((!data || data.length === 0) && (!tmpPersoner || Object.keys(tmpPersoner).length < 1)) { + return null + } + + const tmpData = _.get(tmpPersoner, `${ident}.person.oppholdsadresse`) + if ((!data || data.length === 0) && (!tmpData || tmpData.length < 1)) { return null } @@ -118,13 +128,14 @@ export const Oppholdsadresse = ({
- + {(adresse: any, idx: number) => erRedigerbar ? (