File tree 5 files changed +186
-142
lines changed
5 files changed +186
-142
lines changed Original file line number Diff line number Diff line change @@ -457,7 +457,7 @@ export const SamværBarn = ({ gjelderBarn }: { gjelderBarn: string }) => {
457
457
< span > { DateToDDMMYYYYString ( dateOrNull ( ) ) } </ span >
458
458
</ BodyShort >
459
459
</ div >
460
- { valideringsfeil ?. harPeriodiseringsfeil && (
460
+ { ! lesemodus && valideringsfeil ?. harPeriodiseringsfeil && (
461
461
< div className = "mb-4" >
462
462
< BehandlingAlert variant = "warning" >
463
463
< Heading size = "xsmall" level = "6" >
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import StatefulAlert from "@common/components/StatefulAlert";
4
4
import text from "@common/constants/texts" ;
5
5
import { useBehandlingProvider } from "@common/context/BehandlingContext" ;
6
6
import { PlusIcon } from "@navikt/aksel-icons" ;
7
- import { Button , Heading } from "@navikt/ds-react" ;
7
+ import { BodyShort , Button , Heading } from "@navikt/ds-react" ;
8
8
import { calculateAge } from "@utils/date-utils" ;
9
9
import React , { useState } from "react" ;
10
10
import { useFieldArray , useFormContext , useWatch } from "react-hook-form" ;
@@ -109,6 +109,7 @@ export const AndreBarn = () => {
109
109
</ Button >
110
110
) }
111
111
{ openForm && < AddBarnForm setOpenAddBarnForm = { setOpenForm } onSave = { onCreateBarn } /> }
112
+ { andreBarnFieldArray . length < 1 && < BodyShort > { text . description . ingenBarn } </ BodyShort > }
112
113
{ andreBarnFieldArray . map ( ( underhold , index ) => {
113
114
const underholdFieldName = `underholdskostnaderAndreBarn.${ index } ` as const ;
114
115
return (
Original file line number Diff line number Diff line change @@ -210,7 +210,7 @@ export const RolleInfoBox = ({
210
210
} ;
211
211
212
212
export const Barnetilsyn = ( { index } : { index : number } ) => {
213
- const { setSaveErrorState } = useBehandlingProvider ( ) ;
213
+ const { setSaveErrorState, lesemodus } = useBehandlingProvider ( ) ;
214
214
const { aktiveOpplysninger } = useGetOpplysningerBarnetilsyn ( ) ;
215
215
const { underholdskostnader, erBisysVedtak } = useGetBehandlingV2 ( ) ;
216
216
const underholdFieldName = `underholdskostnaderMedIBehandling.${ index } ` as const ;
@@ -269,7 +269,7 @@ export const Barnetilsyn = ({ index }: { index: number }) => {
269
269
checked = { underhold . harTilsynsordning || hasAtLeastOnePeriodOrActiveOpplysninger }
270
270
onChange = { onToggle }
271
271
size = "small"
272
- readOnly = { hasAtLeastOnePeriodOrActiveOpplysninger }
272
+ readOnly = { lesemodus || hasAtLeastOnePeriodOrActiveOpplysninger }
273
273
>
274
274
{ text . label . barnHarTilsysnsordning }
275
275
</ Switch >
You can’t perform that action at this time.
0 commit comments