From 1f1aa9002fc624bb9070e6123c99ae4a66191d3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vebj=C3=B8rn=20Nordby?= Date: Fri, 8 Nov 2024 13:08:33 +0100 Subject: [PATCH] Reapply opptjening og legg paa toggle (#6800) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Revert "denne skulle vært togglet :D:D reverter for å legge på toggle (#6799)" This reverts commit 80665a1817b6b3e23f97e23cdc5dff9877198ff5. * feature toggle * fikse test --- _mocks/featureToggles.ts | 4 ++ deploy/dev-fss-k9saksbehandling.yml | 2 + deploy/prod-fss-k9saksbehandling.yml | 2 + envDir/.env.development | 3 +- feature-toggles.json | 4 ++ package.json | 2 +- .../components/OpptjeningFaktaForm.spec.tsx | 1 + .../OpptjeningVilkarProsessIndex.stories.tsx | 1 + .../OpptjeningVilkarAksjonspunktPanel.tsx | 16 ++++---- .../components/OpptjeningVilkarForm.spec.tsx | 16 +++++++- .../src/components/OpptjeningVilkarForm.tsx | 40 +++++++++++-------- .../src/components/VilkarField.tsx | 37 +++++++++++------ .../src/opptjening/fastsattOpptjening.ts | 1 + 13 files changed, 89 insertions(+), 40 deletions(-) diff --git a/_mocks/featureToggles.ts b/_mocks/featureToggles.ts index 678cf00729..292c0360d8 100644 --- a/_mocks/featureToggles.ts +++ b/_mocks/featureToggles.ts @@ -93,4 +93,8 @@ export const featureTogglesFactory = () => [ key: 'BRUK_V2_SAK_DOKUMENTER', value: process.env.VITE_BRUK_V2_SAK_DOKUMENTER, }, + { + key: 'OPPTJENING_READ_ONLY_PERIODER', + value: process.env.VITE_OPPTJENING_READ_ONLY_PERIODER, + }, ]; diff --git a/deploy/dev-fss-k9saksbehandling.yml b/deploy/dev-fss-k9saksbehandling.yml index 1ad34e3c9a..903d8583ad 100644 --- a/deploy/dev-fss-k9saksbehandling.yml +++ b/deploy/dev-fss-k9saksbehandling.yml @@ -115,3 +115,5 @@ spec: value: "true" - name: BRUK_V2_SAK_DOKUMENTER value: "true" + - name: OPPTJENING_READ_ONLY_PERIODER + value: "true" diff --git a/deploy/prod-fss-k9saksbehandling.yml b/deploy/prod-fss-k9saksbehandling.yml index 3628998e81..93e754bf15 100644 --- a/deploy/prod-fss-k9saksbehandling.yml +++ b/deploy/prod-fss-k9saksbehandling.yml @@ -112,3 +112,5 @@ spec: value: "false" - name: "BRUK_V2_SAK_DOKUMENTER" value: "false" + - name: OPPTJENING_READ_ONLY_PERIODER + value: "false" diff --git a/envDir/.env.development b/envDir/.env.development index c117a4f35a..da7109eb1b 100644 --- a/envDir/.env.development +++ b/envDir/.env.development @@ -19,4 +19,5 @@ VITE_PROSESS_VILKAR_SOKNADSFRIST=true VITE_SKILL_UT_PRIVATPERSON=true VITE_AUTOMATISK_VURDERT_MEDLEMSKAP=true VITE_DELVIS_REVURDERING=true -VITE_BRUK_V2_SAK_DOKUMENTER=true \ No newline at end of file +VITE_BRUK_V2_SAK_DOKUMENTER=true +VITE_OPPTJENING_READ_ONLY_PERIODER=true \ No newline at end of file diff --git a/feature-toggles.json b/feature-toggles.json index cfd8c96be6..f3bd9a8515 100644 --- a/feature-toggles.json +++ b/feature-toggles.json @@ -98,5 +98,9 @@ { "key": "BRUK_V2_SAK_DOKUMENTER", "value": "${BRUK_V2_SAK_DOKUMENTER}" + }, + { + "key": "OPPTJENING_READ_ONLY_PERIODER", + "value": "${OPPTJENING_READ_ONLY_PERIODER}" } ] diff --git a/package.json b/package.json index 6deb8bf008..445de06383 100644 --- a/package.json +++ b/package.json @@ -140,4 +140,4 @@ ] }, "packageManager": "yarn@3.4.1" -} +} \ No newline at end of file diff --git a/packages/fakta-opptjening-oms/src/components/OpptjeningFaktaForm.spec.tsx b/packages/fakta-opptjening-oms/src/components/OpptjeningFaktaForm.spec.tsx index c5214f7316..31481493f3 100644 --- a/packages/fakta-opptjening-oms/src/components/OpptjeningFaktaForm.spec.tsx +++ b/packages/fakta-opptjening-oms/src/components/OpptjeningFaktaForm.spec.tsx @@ -76,6 +76,7 @@ describe('', () => { opptjeningTom: '2017-08-31', opptjeningperiode: { dager: 16, måneder: 0 }, fastsattOpptjeningAktivitetList: [], + vurderesIAksjonspunkt: true, }, }, ]; diff --git a/packages/prosess-vilkar-opptjening-oms/src/OpptjeningVilkarProsessIndex.stories.tsx b/packages/prosess-vilkar-opptjening-oms/src/OpptjeningVilkarProsessIndex.stories.tsx index ffd90536ce..1d1d7cf082 100644 --- a/packages/prosess-vilkar-opptjening-oms/src/OpptjeningVilkarProsessIndex.stories.tsx +++ b/packages/prosess-vilkar-opptjening-oms/src/OpptjeningVilkarProsessIndex.stories.tsx @@ -14,6 +14,7 @@ const opptjening = { måneder: 2, dager: 3, }, + vurderesIAksjonspunkt: true, fastsattOpptjeningAktivitetList: [ { id: 1, diff --git a/packages/prosess-vilkar-opptjening-oms/src/components/OpptjeningVilkarAksjonspunktPanel.tsx b/packages/prosess-vilkar-opptjening-oms/src/components/OpptjeningVilkarAksjonspunktPanel.tsx index fa104d89af..15905044a9 100644 --- a/packages/prosess-vilkar-opptjening-oms/src/components/OpptjeningVilkarAksjonspunktPanel.tsx +++ b/packages/prosess-vilkar-opptjening-oms/src/components/OpptjeningVilkarAksjonspunktPanel.tsx @@ -1,7 +1,7 @@ import { behandlingForm, behandlingFormValueSelector } from '@fpsak-frontend/form'; import FagsakYtelseType from '@fpsak-frontend/kodeverk/src/fagsakYtelseType'; import { ProsessStegBegrunnelseTextField } from '@k9-sak-web/prosess-felles'; -import { Aksjonspunkt, Opptjening, SubmitCallback, Vilkarperiode } from '@k9-sak-web/types'; +import { Aksjonspunkt, FeatureToggles, Opptjening, SubmitCallback, Vilkarperiode } from '@k9-sak-web/types'; import { HelpText, Label } from '@navikt/ds-react'; import { useMemo } from 'react'; import { FormattedMessage, useIntl } from 'react-intl'; @@ -35,6 +35,7 @@ interface OpptjeningVilkarAksjonspunktPanelImplProps { vilkårPerioder: Vilkarperiode[]; opptjeninger: Opptjening[]; vilkarFields: VilkårFieldType[]; + featureToggles: FeatureToggles; } interface StateProps { @@ -79,7 +80,7 @@ export const OpptjeningVilkarAksjonspunktPanelImpl = ({ ? !vilkarFields.some( vilkarField => vilkarField.vurderesIBehandlingen && - !vilkarField.periodeHar28DagerOgTrengerIkkeVurderesManuelt && + vilkarField.vurderesIAksjonspunkt && (!vilkarField.begrunnelse || !vilkarField.kode), ) : false; @@ -136,7 +137,7 @@ export const OpptjeningVilkarAksjonspunktPanelImpl = ({ behandlingId={behandlingId} behandlingVersjon={behandlingVersjon} isPeriodisertFormComplete={allePerioderHarVurdering()} - skjulAksjonspunktVisning={vilkarField?.periodeHar28DagerOgTrengerIkkeVurderesManuelt} + skjulAksjonspunktVisning={!vilkarField?.vurderesIAksjonspunkt} >