Skip to content

Commit

Permalink
Revert "Revert "TSFF-804 & TSFF-486 (#6558)" (#6628)" (#6631)
Browse files Browse the repository at this point in the history
This reverts commit fa9a2e0.
  • Loading branch information
hallvardastark authored Sep 25, 2024
1 parent d812e47 commit 181bc0c
Show file tree
Hide file tree
Showing 13 changed files with 186 additions and 155 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ const InngangsvilkarPanel = ({
</Tabs.List>
</Tabs>
<VerticalSpacer thirtyTwoPx />
<HGrid gap="4" columns={{ xs: '6fr 6fr' }}>
<HGrid gap="4" columns={filteredPanels.length > 2 ? { xs: '6fr 6fr' } : { xs: '8fr 4fr' }}>
<div>
{filteredPanels
.filter((_panel, index) => index < 2)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ const GrunnlagForAutomatiskVurdering = ({
foreldre.push(createParent(false, personopplysninger.annenPart));
}

console.log('valgtPeriode', valgtPeriode);

return (
<>
<Table>
Expand Down
5 changes: 0 additions & 5 deletions packages/prosess-felles/i18n/nb_NO.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
{
"ProsessPanelTemplate.ErOppfylt": "Vilkåret er oppfylt",
"ProsessPanelTemplate.ErIkkeOppfylt": "Vilkåret er avslått",
"ProsessPanelTemplate.IkkeBehandlet": "Ikke behandlet",

"ProsessPanelTemplate.DelvisOppfylt": "Vilkåret er delvis oppfylt",
"ProsessPanelTemplate.DelvisIkkeOppfylt": "Vilkåret er <b>delvis ikke</b> oppfylt",

"VilkarResultPicker.Arsak": "Avslagsårsak",
"VilkarResultPicker.SelectArsak": "Velg årsak",

Expand Down
1 change: 0 additions & 1 deletion packages/prosess-felles/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
export { default as ProsessStegBegrunnelseTextField } from './src/ProsessStegBegrunnelseTextField';
export { default as ProsessStegSubmitButton } from './src/ProsessStegSubmitButton';
export type { default as StandardProsessFormProps } from './src/standardProsessFormPropsTsType';
export { default as ProsessPanelTemplate } from './src/vilkar/ProsessPanelTemplate';
export { default as VilkarResultPicker } from './src/vilkar/VilkarResultPicker';
export { default as VilkarResultPickerPeriodisert } from './src/vilkar/VilkarResultPickerPeriodisert';
export { default as VilkarResultPickerPeriodisertRHF } from './src/vilkar/VilkarResultPickerPeriodisertRHF';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,10 @@ const VilkarResultPicker: FunctionComponent<OwnProps> & StaticFunctions = ({
: vilkarUtfallPeriodisert.DELVIS_OPPFYLT,
label: periodeVilkarStatus
? intl.formatMessage(
{ id: 'ProsessPanelTemplate.DelvisIkkeOppfylt' },
{ id: 'OpptjeningPanel.DelvisIkkeOppfylt' },
{ b: chunks => <b>{chunks}</b> },
)
: intl.formatMessage({ id: 'ProsessPanelTemplate.DelvisOppfylt' }),
: intl.formatMessage({ id: 'OpptjeningPanel.DelvisOppfylt' }),
},
]
: []),
Expand Down
4 changes: 4 additions & 0 deletions packages/prosess-vilkar-opptjening-oms/i18n/nb_NO.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
"OpptjeningVilkarView.MonthsAndDays": "{months} måneder og {days} dager aktivitet i opptjeningsperioden",
"OpptjeningVilkarView.DetailsForSelectedPeriod": "Detaljer for valgt periode",

"OpptjeningPanel.ErIkkeOppfylt": "Vilkåret er avslått",
"OpptjeningPanel.IkkeBehandlet": "Ikke behandlet",


"OpptjeningVilkarAksjonspunktPanel.SokerHarVurdertOpptjentRettTilPleiepenger": "Opptjent rett til pleiepenger",
"OpptjeningVilkarAksjonspunktPanel.SokerHarVurdertOpptjentRettTilOmsorgspenger": "Opptjent rett til omsorgspenger",
"OpptjeningVilkarAksjonspunktPanel.OmsorgspengerVurderLabel": "Vurder om bruker oppfyller opptjening jf § 9-2 eller § 8-47 bokstav B",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ const opptjeningUten847B = {
],
fastsattOpptjening: {
opptjeningperiode: {
måneder: 4,
dager: 6,
måneder: 0,
dager: 10,
},
fastsattOpptjeningAktivitetList: [
{
Expand Down Expand Up @@ -102,8 +102,8 @@ const opptjeningMed847B = {
],
fastsattOpptjening: {
opptjeningperiode: {
måneder: 4,
dager: 6,
måneder: 0,
dager: 10,
},
fastsattOpptjeningAktivitetList: [
{
Expand Down Expand Up @@ -274,6 +274,10 @@ export const visPanelForPSBÅpentAksjonspunktUten847B = args => (
perioder: [
{
avslagKode: null,
merknad: {
kode: '7847A',
kodeverk: 'VILKAR_UTFALL_MERKNAD',
},
merknadParametere: {
antattGodkjentArbeid: 'P10D',
antattOpptjeningAktivitetTidslinje:
Expand All @@ -299,6 +303,7 @@ export const visPanelForPSBÅpentAksjonspunktUten847B = args => (
definisjon: {
kode: aksjonspunktCodes.VURDER_OPPTJENINGSVILKARET,
},
erAktivt: true,
status: {
kode: aksjonspunktStatus.OPPRETTET,
},
Expand Down Expand Up @@ -346,6 +351,9 @@ export const visPanelForPSBÅpentAksjonspunktMed847B = args => (
antattOpptjeningAktivitetTidslinje:
'LocalDateTimeline<2020-04-17, 2020-04-26 [1]> = [[2020-04-17, 2020-04-26]]',
},
merknad: {
kode: '-',
},
vilkarStatus: {
kode: 'OPPFYLT',
kodeverk: 'VILKAR_UTFALL_TYPE',
Expand Down Expand Up @@ -430,7 +438,7 @@ export const visPanelForNårEnIkkeHarAksjonspunkt = args => (
begrunnelse: null,
vurderesIBehandlingen: true,
merknad: {
kode: '1035',
kode: '-',
kodeverk: 'VILKAR_UTFALL_MERKNAD',
},
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { renderWithIntlAndReduxForm } from '@fpsak-frontend/utils-test/test-utils';
import { screen } from '@testing-library/react';
import React from 'react';
import messages from '../../i18n/nb_NO.json';
import ProsessPanelTemplate from './ProsessPanelTemplate';
import messages from '@k9-sak-web/prosess-felles/i18n/nb_NO.json';
import OpptjeningPanel from './OpptjeningPanel';

describe('<ProsessPanelTemplate>', () => {
describe('<OpptjeningPanel>', () => {
it('skal ikke vise lovreferanse når dette ikke finnes', () => {
const { container } = renderWithIntlAndReduxForm(
<ProsessPanelTemplate
<OpptjeningPanel
handleSubmit={vi.fn()}
title="Fødsel"
isAksjonspunktOpen
Expand All @@ -19,7 +19,7 @@ describe('<ProsessPanelTemplate>', () => {
behandlingVersjon={1}
>
<div>test</div>
</ProsessPanelTemplate>,
</OpptjeningPanel>,
{ messages },
);

Expand All @@ -28,7 +28,7 @@ describe('<ProsessPanelTemplate>', () => {

it('skal vise lovreferanse når dette finnes', () => {
renderWithIntlAndReduxForm(
<ProsessPanelTemplate
<OpptjeningPanel
handleSubmit={vi.fn()}
lovReferanse="test lovReferanse"
title="Fødsel"
Expand All @@ -41,7 +41,7 @@ describe('<ProsessPanelTemplate>', () => {
behandlingVersjon={1}
>
<div>test</div>
</ProsessPanelTemplate>,
</OpptjeningPanel>,
{ messages },
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ import {
VerticalSpacer,
} from '@fpsak-frontend/shared-components';
import { BodyShort, Detail, Heading, Label } from '@navikt/ds-react';
import React, { ReactNode } from 'react';
import getPackageIntl from '../../i18n/getPackageIntl';
import ProsessStegSubmitButton from '../ProsessStegSubmitButton';
import styles from './prosessPanelTemplate.module.css';
import { ReactNode } from 'react';
import ProsessStegSubmitButton from '@k9-sak-web/prosess-felles/src/ProsessStegSubmitButton';
import styles from './opptjeningPanel.module.css';
import { Lovreferanse } from '@k9-sak-web/gui/shared/lovreferanse/Lovreferanse.js';
import { useIntl } from 'react-intl';

interface OwnProps {
title: string;
Expand All @@ -31,14 +31,16 @@ interface OwnProps {
isDirty?: boolean;
children: ReactNode | ReactNode[];
isPeriodisertFormComplete?: boolean;
skjulAksjonspunktVisning?: boolean;
aksjonspunktErLøst?: boolean;
}

/*
* ProsessPanelTemplate
* OpptjeningPanel
*
* Presentasjonskomponent.
*/
const ProsessPanelTemplate = ({
const OpptjeningPanel = ({
behandlingId,
behandlingVersjon,
lovReferanse,
Expand All @@ -53,13 +55,15 @@ const ProsessPanelTemplate = ({
isDirty,
children,
isPeriodisertFormComplete,
skjulAksjonspunktVisning,
aksjonspunktErLøst,
}: OwnProps) => {
const intl = getPackageIntl();
const intl = useIntl();
return (
<form onSubmit={handleSubmit}>
<FlexContainer>
<FlexRow>
{originalErVilkarOk !== undefined && (
{aksjonspunktErLøst && (
<FlexColumn>
<Image className={styles.status} src={originalErVilkarOk ? innvilgetImage : avslattImage} />
</FlexColumn>
Expand All @@ -80,47 +84,56 @@ const ProsessPanelTemplate = ({

<FlexRow>
<FlexColumn>
{originalErVilkarOk && (
{aksjonspunktErLøst && (
<>
<VerticalSpacer eightPx />
<Label size="small" as="p">
{intl.formatMessage({ id: 'ProsessPanelTemplate.ErOppfylt' })}
</Label>
</>
)}
{originalErVilkarOk === false && (
<>
<VerticalSpacer eightPx />
<Label size="small" as="p">
{intl.formatMessage({ id: 'ProsessPanelTemplate.ErIkkeOppfylt' })}
</Label>
{originalErVilkarOk && (
<>
<VerticalSpacer eightPx />
<Label size="small" as="p">
{intl.formatMessage({ id: 'OpptjeningVilkarView.Oppfylt' })}
</Label>
</>
)}
{originalErVilkarOk === false && (
<>
<VerticalSpacer eightPx />
<Label size="small" as="p">
{intl.formatMessage({ id: 'OpptjeningPanel.ErIkkeOppfylt' })}
</Label>
</>
)}
</>
)}
{!isAksjonspunktOpen && originalErVilkarOk === undefined && (
<>
<VerticalSpacer eightPx />
<BodyShort size="small">{intl.formatMessage({ id: 'ProsessPanelTemplate.IkkeBehandlet' })}</BodyShort>
<BodyShort size="small">{intl.formatMessage({ id: 'OpptjeningPanel.IkkeBehandlet' })}</BodyShort>
</>
)}
</FlexColumn>
</FlexRow>
</FlexContainer>
{isAksjonspunktOpen && <VerticalSpacer eightPx />}
<AksjonspunktBox className={styles.aksjonspunktMargin} erAksjonspunktApent={isAksjonspunktOpen}>
<AksjonspunktBox
className={styles.aksjonspunktMargin}
erAksjonspunktApent={isAksjonspunktOpen && !skjulAksjonspunktVisning}
>
{children}
{!readOnly && <VerticalSpacer sixteenPx />}
<ProsessStegSubmitButton
formName={formName}
behandlingId={behandlingId}
behandlingVersjon={behandlingVersjon}
isReadOnly={readOnly}
isSubmittable={!readOnlySubmitButton}
isDirty={isDirty}
isBehandlingFormSubmitting={isBehandlingFormSubmitting}
isBehandlingFormDirty={isBehandlingFormDirty}
hasBehandlingFormErrorsOfType={hasBehandlingFormErrorsOfType}
isPeriodisertFormComplete={isPeriodisertFormComplete}
/>
{!skjulAksjonspunktVisning && (
<ProsessStegSubmitButton
formName={formName}
behandlingId={behandlingId}
behandlingVersjon={behandlingVersjon}
isReadOnly={readOnly}
isSubmittable={!readOnlySubmitButton}
isDirty={isDirty}
isBehandlingFormSubmitting={isBehandlingFormSubmitting}
isBehandlingFormDirty={isBehandlingFormDirty}
hasBehandlingFormErrorsOfType={hasBehandlingFormErrorsOfType}
isPeriodisertFormComplete={isPeriodisertFormComplete}
/>
)}
</AksjonspunktBox>
{rendreFakta && (
<>
Expand All @@ -132,4 +145,4 @@ const ProsessPanelTemplate = ({
);
};

export default ProsessPanelTemplate;
export default OpptjeningPanel;
Loading

0 comments on commit 181bc0c

Please sign in to comment.