Skip to content

Commit

Permalink
Merge pull request #3633 from navikt/bugfix/udistub-visning-feil
Browse files Browse the repository at this point in the history
Fix UDI-visning og infotekst
  • Loading branch information
betsytraran authored Sep 24, 2024
2 parents 237ef46 + 6d31212 commit 3ccda99
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ import { udiAttributt } from '@/components/fagsystem/udistub/form/Form'
export const UdiPanel = ({ stateModifier, testnorgeIdent, formValues }) => {
const sm = stateModifier(UdiPanel.initialValues)

const infoTekst =
'All informasjon blir lagt i UDI-stub. Oppholdsstatus går i tillegg til PDL dersom miljø Q2 velges i siste steg.'
const infoTekst = 'All informasjon blir lagt i UDI-stub. Oppholdsstatus går i tillegg til PDL.'

return (
<Panel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ import { Annet } from './partials/Annet'
import { ErrorBoundary } from '@/components/ui/appError/ErrorBoundary'
import { hasProperty } from 'dot-prop'
import { Alert } from '@navikt/ds-react'
import { filtrerKeysMedKunNullVerdier } from '@/components/fagsystem/utils'
import { isEmpty } from '@/components/fagsystem/pdlf/form/partials/utils'

const kunTommeObjekter = (udiData) => {
const { oppholdStatus, arbeidsadgang, aliaser } = udiData
const formatertOppholdStatus = filtrerKeysMedKunNullVerdier(oppholdStatus)
return (
(_.isEmpty(formatertOppholdStatus) || Object.keys(oppholdStatus)?.length < 1) &&
(isEmpty(oppholdStatus) || Object.keys(oppholdStatus)?.length < 1) &&
(_.isEmpty(arbeidsadgang) || Object.keys(arbeidsadgang)?.length < 1) &&
(_.isEmpty(aliaser) || (Array.isArray(aliaser) && aliaser.length < 1)) &&
!udiData?.flyktning &&
!hasProperty(udiData, 'soeknadOmBeskyttelseUnderBehandling')
)
}

export const sjekkManglerUdiData = (udiData) => {
return kunTommeObjekter(udiData) && !udiData?.harOppholdsTillatelse
}
Expand Down
13 changes: 0 additions & 13 deletions apps/dolly-frontend/src/main/js/src/components/fagsystem/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,6 @@ export const testDatoTom = (val, fomPath, feilmelding = 'Dato må være etter fr
})
}

export const filtrerKeysMedKunNullVerdier = (data) => {
if (!data) {
return null
}
JSON.stringify(
data,
(_key, value) => {
return value === null || value === '' ? undefined : value
},
4,
)
}

export const getEksisterendeNyPerson = (
relasjoner: Array<Relasjon>,
ident: String,
Expand Down

0 comments on commit 3ccda99

Please sign in to comment.