Skip to content

Commit

Permalink
Bestillingsvisning skjerming
Browse files Browse the repository at this point in the history
  • Loading branch information
betsytraran committed Jan 5, 2024
1 parent 38e7ce9 commit 6397b09
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { Utvandring } from '@/components/fagsystem/pdlf/bestilling/partials/Utva
import { Kjoenn } from '@/components/fagsystem/pdlf/bestilling/partials/Kjoenn'
import { Navn } from '@/components/fagsystem/pdlf/bestilling/partials/Navn'
import { Spraak } from '@/components/fagsystem/pdlf/bestilling/partials/Spraak'
import { Skjerming } from '@/components/fagsystem/pdlf/bestilling/partials/Skjerming'

export const BestillingTitle = styled.h4`
margin: 10px 0;
Expand All @@ -33,6 +34,16 @@ export const Bestillingsdata = ({ bestilling }: any) => {
<Kjoenn kjoennListe={bestilling.pdldata?.person?.kjoenn} />
<Navn navnListe={bestilling.pdldata?.person?.navn} />
<Spraak spraakKode={bestilling.tpsMessaging?.spraakKode} />
<Skjerming
skjerming={
bestilling.tpsMessaging?.egenAnsattDatoFom
? {
egenAnsattDatoFom: bestilling.tpsMessaging?.egenAnsattDatoFom,
egenAnsattDatoTom: bestilling.tpsMessaging?.egenAnsattDatoTom,
}
: bestilling.skjerming
}
/>
</>
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ const mapFoedsel = (foedsel, data) => {
obj('Fødested', item.foedested),
obj('Fødekommune', item.foedekommune, AdresseKodeverk.Kommunenummer),
obj('Fødeland', item.foedeland, AdresseKodeverk.InnvandretUtvandretLand),
]
]
}),
}
data.push(foedselData)
Expand Down Expand Up @@ -830,7 +830,7 @@ const mapNyIdent = (nyident, data) => {
obj('Født før', formatDate(item.foedtFoer)),
obj('Alder', item.alder),
obj('Har mellomnavn', item.nyttNavn?.hasMellomnavn && 'JA'),
]
]
}),
}
data.push(nyidentData)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { ErrorBoundary } from '@/components/ui/appError/ErrorBoundary'
import { BestillingTitle } from '@/components/bestilling/sammendrag/Bestillingsdata'
import React from 'react'
import { TitleValue } from '@/components/ui/titleValue/TitleValue'
import { formatDate } from '@/utils/DataFormatter'

type SkjermingTypes = {
skjerming: {
egenAnsattDatoFom: string
egenAnsattDatoTom?: string
}
}
export const Skjerming = ({ skjerming }: SkjermingTypes) => {
if (!skjerming) {
return null
}

return (
<div className="person-visning">
<ErrorBoundary>
<BestillingTitle>Skjerming</BestillingTitle>
<div className="flexbox--flex-wrap" style={{ marginBottom: '10px' }}>
<TitleValue title="Skjerming fra" value={formatDate(skjerming.egenAnsattDatoFom)} />
<TitleValue title="Skjerming til" value={formatDate(skjerming.egenAnsattDatoTom)} />
</div>
</ErrorBoundary>
</div>
)
}

0 comments on commit 6397b09

Please sign in to comment.