-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3495 from navikt/feature/tenor-soek-ny-funksjonal…
…itet Feature/tenor soek ny funksjonalitet
- Loading branch information
Showing
21 changed files
with
459 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
...y-frontend/src/main/js/src/components/fagsystem/skatteetaten/visning/BrregErFrVisning.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import Panel from '@/components/ui/panel/Panel' | ||
import { TitleValue } from '@/components/ui/titleValue/TitleValue' | ||
import React from 'react' | ||
|
||
export const BrregErFrVisning = ({ harDagligLederRolle }: any) => { | ||
if (!harDagligLederRolle) { | ||
return null | ||
} | ||
|
||
return ( | ||
<Panel heading="Enhetsregisteret og Foretaksregisteret"> | ||
<div className="person-visning_content"> | ||
<TitleValue title="Roller" value="Daglig leder" /> | ||
</div> | ||
</Panel> | ||
) | ||
} |
47 changes: 47 additions & 0 deletions
47
...lly-frontend/src/main/js/src/components/fagsystem/skatteetaten/visning/InntektVisning.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import Panel from '@/components/ui/panel/Panel' | ||
import { TitleValue } from '@/components/ui/titleValue/TitleValue' | ||
import React from 'react' | ||
import { DollyFieldArray } from '@/components/ui/form/fieldArray/DollyFieldArray' | ||
import { arrayToString, codeToNorskLabel, oversettBoolean } from '@/utils/DataFormatter' | ||
|
||
export const Inntekt = ({ inntekt }: any) => { | ||
return ( | ||
<> | ||
<TitleValue title="Periode" value={inntekt.periode} /> | ||
<TitleValue title="Opplysningspliktig" value={inntekt.opplysningspliktig} /> | ||
<TitleValue | ||
title="Inntektstype" | ||
value={arrayToString(inntekt.inntektstype?.map((type: string) => codeToNorskLabel(type)))} | ||
/> | ||
<TitleValue | ||
title="Beskrivelse" | ||
value={arrayToString(inntekt.beskrivelse?.map((beskr: string) => codeToNorskLabel(beskr)))} | ||
/> | ||
<TitleValue | ||
title="Forskuddstrekk" | ||
value={arrayToString( | ||
inntekt.forskuddstrekk?.map((trekk: string) => codeToNorskLabel(trekk)), | ||
)} | ||
/> | ||
<TitleValue title="Har historikk" value={oversettBoolean(inntekt.harHistorikk)} /> | ||
</> | ||
) | ||
} | ||
|
||
export const InntektVisning = ({ inntektListe }: any) => { | ||
if (!inntektListe || inntektListe.length < 1) { | ||
return null | ||
} | ||
|
||
return ( | ||
<Panel heading="Inntekt A-ordningen"> | ||
<div className="person-visning_content"> | ||
<DollyFieldArray data={inntektListe} nested> | ||
{(inntekt: any) => { | ||
return <Inntekt inntekt={inntekt} /> | ||
}} | ||
</DollyFieldArray> | ||
</div> | ||
</Panel> | ||
) | ||
} |
38 changes: 28 additions & 10 deletions
38
...rontend/src/main/js/src/components/fagsystem/skatteetaten/visning/SkatteetatenVisning.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,55 @@ | ||
import React from 'react' | ||
import Loading from '@/components/ui/loading/Loading' | ||
import Icon from '@/components/ui/icon/Icon' | ||
import { TitleValue } from '@/components/ui/titleValue/TitleValue' | ||
import _get from 'lodash/get' | ||
import { BrregErFrVisning } from '@/components/fagsystem/skatteetaten/visning/BrregErFrVisning' | ||
import { InntektVisning } from '@/components/fagsystem/skatteetaten/visning/InntektVisning' | ||
import { TjenestepensjonsavtaleVisning } from '@/components/fagsystem/skatteetaten/visning/TjenestepensjonsavtaleVisning' | ||
import { SkattemeldingVisning } from '@/components/fagsystem/skatteetaten/visning/SkattemeldingVisning' | ||
|
||
type SkatteetatenVisningProps = { | ||
data: { | ||
tenorRelasjoner: string[] | ||
tenorRelasjoner: any | ||
} | ||
loading: boolean | ||
} | ||
|
||
// Midlertidig visning av daglig leder-rolle fra Tenor. Skrives om naar det er behov for aa vise flere Tenor-data. | ||
// Midlertidig visning av data fra Tenor. Skrives kanskje om naar det er behov for aa vise flere Tenor-data. | ||
export const SkatteetatenVisning = ({ data, loading }: SkatteetatenVisningProps) => { | ||
if (loading) { | ||
return <Loading label="Laster Tenor-data ..." /> | ||
} | ||
|
||
const harDagligLederRolle = data?.tenorRelasjoner?.includes('BrregErFr') | ||
const tenorRelasjoner = data?.tenorRelasjoner | ||
if (!data || !tenorRelasjoner) { | ||
return null | ||
} | ||
|
||
if (!data || !harDagligLederRolle) { | ||
const tjenestepensjonavtaleListe = tenorRelasjoner.tjenestepensjonavtale | ||
const harDagligLederRolle = _get(tenorRelasjoner, 'brreg-er-fr')?.length > 0 | ||
const skattemeldingListe = tenorRelasjoner.skattemelding | ||
const inntektListe = tenorRelasjoner.inntekt | ||
|
||
if ( | ||
!data && | ||
(!tjenestepensjonavtaleListe || tjenestepensjonavtaleListe.length < 1) && | ||
!harDagligLederRolle && | ||
(!skattemeldingListe || skattemeldingListe.length < 1) && | ||
(!inntektListe || inntektListe.length < 1) | ||
) { | ||
return null | ||
} | ||
|
||
return ( | ||
<div style={{ marginTop: '15px' }}> | ||
<div style={{ margin: '15px 0 20px 0' }}> | ||
<div className="sub-overskrift" style={{ backgroundColor: '#4B797A', color: '#fff' }}> | ||
<Icon fontSize={'1.5rem'} kind="tenor" /> | ||
<h3>Data fra Tenor</h3> | ||
</div> | ||
<h4 style={{ margin: '10px 0' }}>Enhetsregisteret og Foretaksregisteret</h4> | ||
<div className="person-visning_content"> | ||
<TitleValue title="Roller" value="Daglig leder" /> | ||
</div> | ||
<TjenestepensjonsavtaleVisning tpListe={tjenestepensjonavtaleListe} /> | ||
<BrregErFrVisning harDagligLederRolle={harDagligLederRolle} /> | ||
<SkattemeldingVisning skattemeldingListe={skattemeldingListe} /> | ||
<InntektVisning inntektListe={inntektListe} /> | ||
</div> | ||
) | ||
} |
35 changes: 35 additions & 0 deletions
35
...ontend/src/main/js/src/components/fagsystem/skatteetaten/visning/SkattemeldingVisning.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { TitleValue } from '@/components/ui/titleValue/TitleValue' | ||
import { codeToNorskLabel } from '@/utils/DataFormatter' | ||
import Panel from '@/components/ui/panel/Panel' | ||
import { DollyFieldArray } from '@/components/ui/form/fieldArray/DollyFieldArray' | ||
import React from 'react' | ||
|
||
export const Skattemelding = ({ skattemelding }: any) => { | ||
return ( | ||
<> | ||
<TitleValue title="Inntektsår" value={skattemelding.inntektsaar} /> | ||
<TitleValue | ||
title="Type skattemelding" | ||
value={codeToNorskLabel(skattemelding.skattemeldingstype)} | ||
/> | ||
</> | ||
) | ||
} | ||
|
||
export const SkattemeldingVisning = ({ skattemeldingListe }: any) => { | ||
if (!skattemeldingListe || skattemeldingListe.length < 1) { | ||
return null | ||
} | ||
|
||
return ( | ||
<Panel heading="Skattemelding"> | ||
<div className="person-visning_content"> | ||
<DollyFieldArray data={skattemeldingListe} nested> | ||
{(skattemelding: any) => { | ||
return <Skattemelding skattemelding={skattemelding} /> | ||
}} | ||
</DollyFieldArray> | ||
</div> | ||
</Panel> | ||
) | ||
} |
39 changes: 39 additions & 0 deletions
39
...c/main/js/src/components/fagsystem/skatteetaten/visning/TjenestepensjonsavtaleVisning.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import Panel from '@/components/ui/panel/Panel' | ||
import { DollyFieldArray } from '@/components/ui/form/fieldArray/DollyFieldArray' | ||
import { TitleValue } from '@/components/ui/titleValue/TitleValue' | ||
import React from 'react' | ||
|
||
export const Tjenestepensjonsavtale = ({ tjenestepensjonsavtale }: any) => { | ||
return ( | ||
<> | ||
<TitleValue title="Inntektsmottaker" value={tjenestepensjonsavtale?.inntektsmottaker} /> | ||
<TitleValue | ||
title="Pensjonsinnretning" | ||
value={tjenestepensjonsavtale?.pensjonsinnretningOrgnr} | ||
/> | ||
<TitleValue | ||
title="Opplysningspliktig" | ||
value={tjenestepensjonsavtale?.opplysningspliktigOrgnr} | ||
/> | ||
<TitleValue title="Periode" value={tjenestepensjonsavtale?.periode} /> | ||
</> | ||
) | ||
} | ||
|
||
export const TjenestepensjonsavtaleVisning = ({ tpListe }: any) => { | ||
if (!tpListe || tpListe.length < 1) { | ||
return null | ||
} | ||
|
||
return ( | ||
<Panel heading="Tjenestepensjonsavtale"> | ||
<div className="person-visning_content"> | ||
<DollyFieldArray data={tpListe} nested> | ||
{(tjenestepensjonsavtale: any) => { | ||
return <Tjenestepensjonsavtale tjenestepensjonsavtale={tjenestepensjonsavtale} /> | ||
}} | ||
</DollyFieldArray> | ||
</div> | ||
</Panel> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.