Skip to content

Commit

Permalink
Fikser bugs i radioknapper og datovelger
Browse files Browse the repository at this point in the history
  • Loading branch information
hallvardastark committed Aug 26, 2024
1 parent ece590c commit 0bdb58e
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 48 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,6 @@ const OmsorgspengerProsess = ({
[behandling.versjon],
),
alleKodeverk,
featureToggles,
arbeidsgiverOpplysningerPerId,
lagreDokumentdata,
...data,
Expand Down
2 changes: 1 addition & 1 deletion packages/prosess-vilkar-soknadsfrist/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"@fpsak-frontend/utils": "1.0.0",
"@k9-sak-web/sak-app": "1.0.0",
"@k9-sak-web/types": "1.0.0",
"@navikt/ft-form-hooks": "4.4.19",
"@navikt/ft-form-hooks": "5.0.0",
"@navikt/ft-form-validators": "2.3.17",
"@navikt/ft-plattform-komponenter": "3.0.4",
"classnames": "2.5.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import advarselIcon from '@fpsak-frontend/assets/images/advarsel.svg';
import aksjonspunktCodes from '@fpsak-frontend/kodeverk/src/aksjonspunktCodes';
import aksjonspunktStatus from '@fpsak-frontend/kodeverk/src/aksjonspunktStatus';
import vilkarUtfallType from '@fpsak-frontend/kodeverk/src/vilkarUtfallType';
import { Image } from '@fpsak-frontend/shared-components';
import { Image, useFeatureToggles } from '@fpsak-frontend/shared-components';
import { dateFormat, initializeDate } from '@fpsak-frontend/utils';
import { Aksjonspunkt, Behandling, DokumentStatus, FeatureToggles, SubmitCallback, Vilkar } from '@k9-sak-web/types';
import { Aksjonspunkt, Behandling, DokumentStatus, SubmitCallback, Vilkar } from '@k9-sak-web/types';
import { SideMenu } from '@navikt/ft-plattform-komponenter';

import hentAktivePerioderFraVilkar from '@fpsak-frontend/utils/src/hentAktivePerioderFraVilkar';
Expand Down Expand Up @@ -50,7 +50,6 @@ interface SoknadsfristVilkarProsessIndexProps {
vilkar: Vilkar[];
visAllePerioder: boolean;
soknadsfristStatus: { dokumentStatus: DokumentStatus[] };
featureToggles: FeatureToggles;
}

// Finner ut om Statusperiode gjelder for vilkårsperiode
Expand Down Expand Up @@ -80,8 +79,8 @@ const SoknadsfristVilkarProsessIndex = ({
vilkar,
visAllePerioder,
soknadsfristStatus,
featureToggles,
}: SoknadsfristVilkarProsessIndexProps) => {
const [featureToggles] = useFeatureToggles();
const [activeTab, setActiveTab] = useState(0);
const [activeVilkår] = vilkar;
const perioder = hentAktivePerioderFraVilkar(vilkar, visAllePerioder);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,12 @@ export const SoknadsfristVilkarDokument = ({
label="Oppgi dato søknadsfristvilkåret er oppfylt fra"
validate={[required, hasValidDate, isAtleastDate, isAtmostDate]}
isReadOnly={readOnly}
disabledDays={{
fromDate: initializeDate(minDate).toDate(),
toDate: initializeDate(maxDate).toDate(),
}}
disabledDays={[
{
before: initializeDate(minDate).toDate(),
after: initializeDate(maxDate).toDate(),
},
]}
/>
</div>
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const buildInitialValues = (

const erDelvisOppfylt =
status !== vilkarUtfallType.OPPFYLT && fraDato && plusEnDag(fraDato) !== innsendtSoknadsfrist;
const erVilkarOk = erDelvisOppfylt ? DELVIS_OPPFYLT : status === vilkarUtfallType.OPPFYLT;
const erVilkarOk = erDelvisOppfylt ? DELVIS_OPPFYLT : status === vilkarUtfallType.OPPFYLT ? 'true' : 'false';
return {
erVilkarOk: erAvklartEllerOverstyrt ? erVilkarOk : null,
begrunnelse: decodeHtmlEntity(
Expand Down Expand Up @@ -84,7 +84,7 @@ const transformValues = (
begrunnelse: values.avklarteKrav.map(krav => krav.begrunnelse).join('\n'),
avklarteKrav: values.avklarteKrav.map(krav => {
const dokumentStatus = alleDokumenter.find(d => d.journalpostId === krav.journalpostId);
const erVilkarOk = krav.erVilkarOk === 'true' || krav.erVilkarOk === DELVIS_OPPFYLT;
const erVilkarOk = `${krav.erVilkarOk}` === 'true' || krav.erVilkarOk === DELVIS_OPPFYLT;

const fraDato = (() => {
switch (krav.erVilkarOk) {
Expand Down
39 changes: 3 additions & 36 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4294,7 +4294,7 @@ __metadata:
"@fpsak-frontend/utils-test": 1.0.0
"@k9-sak-web/sak-app": 1.0.0
"@k9-sak-web/types": 1.0.0
"@navikt/ft-form-hooks": 4.4.19
"@navikt/ft-form-hooks": 5.0.0
"@navikt/ft-form-validators": 2.3.17
"@navikt/ft-plattform-komponenter": 3.0.4
classnames: 2.5.1
Expand Down Expand Up @@ -4710,39 +4710,6 @@ __metadata:
languageName: node
linkType: hard

"@navikt/ft-form-hooks@npm:4.4.19":
version: 4.4.19
resolution: "@navikt/ft-form-hooks@npm:4.4.19::__archiveUrl=https%3A%2F%2Fnpm.pkg.github.com%2Fdownload%2F%40navikt%2Fft-form-hooks%2F4.4.19%2Ffde683c315a0fba9912777a9baf612d61e8f0c00"
dependencies:
"@navikt/aksel-icons": 6.13.0
"@navikt/ds-css": 6.13.0
"@navikt/ds-react": 6.13.0
"@navikt/ft-form-validators": ^2.3.17
"@navikt/ft-types": ^2.4.15
"@navikt/ft-ui-komponenter": ^2.3.18
"@navikt/ft-utils": ^2.3.17
classnames: 2.5.1
dayjs: 1.11.12
lodash.throttle: 4.1.1
react: 18.3.1
react-hook-form: 7.52.2
peerDependencies:
"@navikt/aksel-icons": 6.12.0
"@navikt/ds-css": 6.12.0
"@navikt/ds-react": 6.12.0
"@navikt/ft-form-validators": 2.x
"@navikt/ft-types": 2.x
"@navikt/ft-ui-komponenter": 2.x
"@navikt/ft-utils": 2.x
classnames: 2.5.1
dayjs: 1.11.11
lodash.throttle: 4.1.1
react: 18.3.1
react-hook-form: 7.52.0
checksum: 33bc1222b07b63d51b5d2ba7ef5f703783c8964ed4b3247e675f363ce2e45f892604fe7ac44d216ecb894379423facd65691f0373cc0d138a6f38bdf13ffe57b
languageName: node
linkType: hard

"@navikt/ft-form-hooks@npm:5.0.0":
version: 5.0.0
resolution: "@navikt/ft-form-hooks@npm:5.0.0::__archiveUrl=https%3A%2F%2Fnpm.pkg.github.com%2Fdownload%2F%40navikt%2Fft-form-hooks%2F5.0.0%2F428d791811c515fc80f6513ae47b82fc0937b148"
Expand Down Expand Up @@ -4822,7 +4789,7 @@ __metadata:
languageName: node
linkType: hard

"@navikt/ft-form-validators@npm:2.3.18, @navikt/ft-form-validators@npm:^2.3.17, @navikt/ft-form-validators@npm:^2.3.18":
"@navikt/ft-form-validators@npm:2.3.18, @navikt/ft-form-validators@npm:^2.3.18":
version: 2.3.18
resolution: "@navikt/ft-form-validators@npm:2.3.18::__archiveUrl=https%3A%2F%2Fnpm.pkg.github.com%2Fdownload%2F%40navikt%2Fft-form-validators%2F2.3.18%2F70e95788d7698d2320bd6bfa01eb0f94b3d21047"
dependencies:
Expand Down Expand Up @@ -4960,7 +4927,7 @@ __metadata:
languageName: node
linkType: hard

"@navikt/ft-ui-komponenter@npm:2.3.19, @navikt/ft-ui-komponenter@npm:^2.3.18, @navikt/ft-ui-komponenter@npm:^2.3.19":
"@navikt/ft-ui-komponenter@npm:2.3.19, @navikt/ft-ui-komponenter@npm:^2.3.19":
version: 2.3.19
resolution: "@navikt/ft-ui-komponenter@npm:2.3.19::__archiveUrl=https%3A%2F%2Fnpm.pkg.github.com%2Fdownload%2F%40navikt%2Fft-ui-komponenter%2F2.3.19%2F55c8382de9237b3f6be6e8be1880c0c8de699c38"
dependencies:
Expand Down

0 comments on commit 0bdb58e

Please sign in to comment.