Skip to content

Commit

Permalink
* Nytt fullmakt grensesnitt - frontend
Browse files Browse the repository at this point in the history
#deploy-test-frontend
#deploy-proxy
  • Loading branch information
stigus committed Sep 17, 2024
1 parent 3044eb6 commit 284f061
Show file tree
Hide file tree
Showing 29 changed files with 658 additions and 761 deletions.
1 change: 1 addition & 0 deletions apps/dolly-frontend/config.idporten.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ spec:
- host: testnav-pensjon-testdata-facade-proxy.dev-fss-pub.nais.io
- host: testnav-sigrunstub-proxy.dev-fss-pub.nais.io
- host: testnav-krrstub-proxy.dev-fss-pub.nais.io
- host: testnav-fullmakt-proxy.dev-fss-pub.nais.io
- host: testnav-udistub-proxy.dev-fss-pub.nais.io
- host: testnav-inst-proxy.dev-fss-pub.nais.io
- host: testnav-aareg-proxy.dev-fss-pub.nais.io
Expand Down
1 change: 1 addition & 0 deletions apps/dolly-frontend/config.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ spec:
- host: testnav-pensjon-testdata-facade-proxy.dev-fss-pub.nais.io
- host: testnav-sigrunstub-proxy.dev-fss-pub.nais.io
- host: testnav-krrstub-proxy.dev-fss-pub.nais.io
- host: testnav-fullmakt-proxy.dev-fss-pub.nais.io
- host: testnav-udistub-proxy.dev-fss-pub.nais.io
- host: testnav-inst-proxy.dev-fss-pub.nais.io
- host: testnav-histark-proxy.dev-fss-pub.nais.io
Expand Down
1 change: 1 addition & 0 deletions apps/dolly-frontend/config.unstable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ spec:
- host: testnav-pensjon-testdata-facade-proxy.dev-fss-pub.nais.io
- host: testnav-sigrunstub-proxy.dev-fss-pub.nais.io
- host: testnav-krrstub-proxy.dev-fss-pub.nais.io
- host: testnav-fullmakt-proxy.dev-fss-pub.nais.io
- host: testnav-udistub-proxy.dev-fss-pub.nais.io
- host: testnav-inst-proxy.dev-fss-pub.nais.io
- host: testnav-aareg-proxy.dev-fss-pub.nais.io
Expand Down
1 change: 1 addition & 0 deletions apps/dolly-frontend/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ spec:
- host: testnav-pensjon-testdata-facade-proxy.dev-fss-pub.nais.io
- host: testnav-sigrunstub-proxy.dev-fss-pub.nais.io
- host: testnav-krrstub-proxy.dev-fss-pub.nais.io
- host: testnav-fullmakt-proxy.dev-fss-pub.nais.io
- host: testnav-udistub-proxy.dev-fss-pub.nais.io
- host: testnav-inst-proxy.dev-fss-pub.nais.io
- host: testnav-aareg-proxy.dev-fss-pub.nais.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ public RouteLocator customRouteLocator(RouteLocatorBuilder builder) {
.route(createRoute(consumers.getTestnavUdistubProxy(), "testnav-udistub-proxy"))
.route(createRoute(consumers.getTestnavArenaForvalterenProxy()))
.route(createRoute(consumers.getTestnavKrrstubProxy(), "testnav-krrstub-proxy"))
.route(createRoute(consumers.getTestnavFullmaktProxy(), "testnav-fullmakt-proxy"))
.route(createRoute(consumers.getTestnavMedlProxy(), "testnav-medl-proxy"))
.route(createRoute(consumers.getTestnavNorg2Proxy(), "testnav-norg2-proxy"))
.route(createRoute(consumers.getTestnavInstProxy(), "testnav-inst-proxy"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public class Consumers {
private ServerProperties testnavKodeverkService;
private ServerProperties testnavKontoregisterPersonProxy;
private ServerProperties testnavKrrstubProxy;
private ServerProperties testnavFullmaktProxy;
private ServerProperties testnavMedlProxy;
private ServerProperties testnavMiljoerService;
private ServerProperties testnavNorg2Proxy;
Expand Down
963 changes: 315 additions & 648 deletions apps/dolly-frontend/src/main/js/package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion apps/dolly-frontend/src/main/js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dolly",
"version": "3.0.29",
"version": "3.0.30",
"type": "module",
"description": "",
"main": "index.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { PensjonPanel } from '@/components/bestillingsveileder/stegVelger/steg/s
import { ArbeidsplassenPanel } from '@/components/bestillingsveileder/stegVelger/steg/steg1/paneler/Arbeidsplassen'
import { MedlPanel } from '@/components/bestillingsveileder/stegVelger/steg/steg1/paneler/Medl'
import { useFormContext } from 'react-hook-form'
import { FullmaktPanel } from '@/components/bestillingsveileder/stegVelger/steg/steg1/paneler/Fullmakt'

export const identFraTestnorge = (opts: any) => {
if (opts?.is?.importTestnorge) {
Expand All @@ -35,6 +36,7 @@ export const Steg1Person = ({ stateModifier }: any) => {

const checked = [
PersoninformasjonPanel,
FullmaktPanel,
AdressePanel,
FamilierelasjonPanel,
ArbeidInntektPanel,
Expand Down Expand Up @@ -65,6 +67,7 @@ export const Steg1Person = ({ stateModifier }: any) => {
return (
<AttributtVelger checked={checked}>
<PersoninformasjonPanel stateModifier={stateModifier} testnorgeIdent={testnorgeIdent} />
<FullmaktPanel stateModifier={stateModifier} testnorgeIdent={testnorgeIdent} />
<AdressePanel stateModifier={stateModifier} formValues={formValues} />
<FamilierelasjonPanel stateModifier={stateModifier} formValues={formValues} />
<IdentifikasjonPanel stateModifier={stateModifier} formValues={formValues} />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import Panel from '@/components/ui/panel/Panel'
import {
Attributt,
AttributtKategori,
} from '@/components/bestillingsveileder/stegVelger/steg/steg1/Attributt'
import { initialFullmakt } from '@/components/fagsystem/pdlf/form/initialValues'
import { harValgtAttributt } from '@/components/ui/form/formUtils'
import { adresseAttributter } from '@/components/fagsystem/pdlf/form/partials/adresser/Adresser'
import React, { useContext } from 'react'
import { BestillingsveilederContext } from '@/components/bestillingsveileder/BestillingsveilederContext'

export const FullmaktPanel = ({ stateModifier, formValues }: any) => {
const sm = stateModifier(FullmaktPanel.initialValues)
const opts = useContext(BestillingsveilederContext)
const gruppeId = opts?.gruppeId || opts?.gruppe?.id

const testNorgePerson = opts?.identMaster === 'PDL'
const ukjentGruppe = !gruppeId
const tekstUkjentGruppe = 'Funksjonen er deaktivert da personer for relasjon er ukjent'
const testNorgeFlere = testNorgePerson && opts?.antall > 1
const tekstFlerePersoner = 'Funksjonen er kun tilgjengelig per individ, ikke for gruppe'

return (
// @ts-ignore
<Panel
heading={FullmaktPanel.heading}
checkAttributeArray={sm.batchAdd}
uncheckAttributeArray={sm.batchRemove}
iconType="fullmakt"
startOpen={harValgtAttributt(formValues, adresseAttributter)}
>
<AttributtKategori title="Fullmakt" attr={sm.attrs}>
<Attributt
attr={sm.attrs.fullmakt}
disabled={ukjentGruppe || testNorgeFlere}
title={
(ukjentGruppe && tekstUkjentGruppe) || (testNorgeFlere && tekstFlerePersoner) || ''
}
/>
</AttributtKategori>
</Panel>
)
}

FullmaktPanel.heading = 'Fullmakt'

FullmaktPanel.initialValues = ({ set, opts, del, has }: any) => {
const { identtype, identMaster } = opts

const initialMaster = identMaster === 'PDL' || identtype === 'NPID' ? 'PDL' : 'FREG'
const initialValues = { ...initialFullmakt, master: initialMaster }

return {
fullmakt: {
label: 'Har fullmektig',
checked: has('fullmakt') || has('pdl.person.fullmakt'),
add: () => {
set('fullmakt', [initialValues])
},
remove: () => {
del('fullmakt')
},
},
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {
getInitialKjoenn,
getInitialNavn,
getInitialStatsborgerskap,
initialFullmakt,
initialSikkerhetstiltak,
initialTilrettelagtKommunikasjon,
initialVergemaal,
Expand Down Expand Up @@ -39,12 +38,8 @@ export const PersoninformasjonPanel = ({ stateModifier, testnorgeIdent }) => {
const opprettFraEksisterende = opts.is.opprettFraIdenter
const leggTil = opts.is.leggTil || opts.is.leggTilPaaGruppe

const testNorgePerson = opts?.identMaster === 'PDL'
const npidPerson = opts?.identtype === 'NPID'
const ukjentGruppe = !gruppeId
const tekstUkjentGruppe = 'Funksjonen er deaktivert da personer for relasjon er ukjent'
const testNorgeFlere = testNorgePerson && opts?.antall > 1
const tekstFlerePersoner = 'Funksjonen er kun tilgjengelig per individ, ikke for gruppe'
const leggTilPaaGruppe = !!opts?.leggTilPaaGruppe
const tekstLeggTilPaaGruppe =
'Støttes ikke for "legg til på alle" i grupper som inneholder personer fra Test-Norge'
Expand All @@ -58,7 +53,7 @@ export const PersoninformasjonPanel = ({ stateModifier, testnorgeIdent }) => {
(testnorgeIdent && (ukjentGruppe || opts?.antall > 1)) ||
(harTestnorgeIdenter && leggTilPaaGruppe)
) {
ignoreKeys.push('fullmakt', 'vergemaal', 'innvandretFraLand', 'utvandretTilLand')
ignoreKeys.push('vergemaal', 'innvandretFraLand', 'utvandretTilLand')
}
if (sm.attrs.utenlandskBankkonto.checked) {
ignoreKeys.push('norskBankkonto')
Expand Down Expand Up @@ -106,13 +101,6 @@ export const PersoninformasjonPanel = ({ stateModifier, testnorgeIdent }) => {
disabled={sm.attrs.norskBankkonto.checked}
/>
<Attributt attr={sm.attrs.telefonnummer} />
<Attributt
attr={sm.attrs.fullmakt}
disabled={ukjentGruppe || testNorgeFlere}
title={
(ukjentGruppe && tekstUkjentGruppe) || (testNorgeFlere && tekstFlerePersoner) || ''
}
/>
<Attributt attr={sm.attrs.sikkerhetstiltak} />
<Attributt attr={sm.attrs.tilrettelagtKommunikasjon} />
</AttributtKategori>
Expand Down Expand Up @@ -176,15 +164,6 @@ export const PersoninformasjonPanel = ({ stateModifier, testnorgeIdent }) => {
''
}
/>
<Attributt
attr={sm.attrs.fullmakt}
disabled={npidPerson || (harTestnorgeIdenter && leggTilPaaGruppe)}
title={
(npidPerson && 'Ikke tilgjengelig for personer med identtype NPID') ||
(harTestnorgeIdenter && leggTilPaaGruppe && tekstLeggTilPaaGruppe) ||
''
}
/>
<Attributt attr={sm.attrs.sikkerhetstiltak} />
<Attributt attr={sm.attrs.tilrettelagtKommunikasjon} />
</AttributtKategori>
Expand Down Expand Up @@ -236,7 +215,6 @@ PersoninformasjonPanel.initialValues = ({ set, opts, setMulti, del, has }) => {
tpsM: 'tpsMessaging.telefonnummer',
},
vergemaal: 'pdldata.person.vergemaal',
fullmakt: 'pdldata.person.fullmakt',
sikkerhetstiltak: 'pdldata.person.sikkerhetstiltak',
tilrettelagtKommunikasjon: 'pdldata.person.tilrettelagtKommunikasjon',
}
Expand Down Expand Up @@ -408,12 +386,6 @@ PersoninformasjonPanel.initialValues = ({ set, opts, setMulti, del, has }) => {
add: () => set(paths.vergemaal, [initialVergemaal]),
remove: () => del(paths.vergemaal),
},
fullmakt: {
label: 'Fullmakt',
checked: has(paths.fullmakt),
add: () => set(paths.fullmakt, [initialFullmakt]),
remove: () => del(paths.fullmakt),
},
sikkerhetstiltak: {
label: 'Sikkerhetstiltak',
checked: has(paths.sikkerhetstiltak),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { MiljoVelger } from '@/components/miljoVelger/MiljoVelger'
import { MalForm } from '@/components/bestillingsveileder/stegVelger/steg/steg3/MalForm'
import { VelgGruppe } from '@/components/bestillingsveileder/stegVelger/steg/steg3/VelgGruppe'
import { SkattekortForm } from '@/components/fagsystem/skattekort/form/Form'
import { FullmaktForm } from '@/components/fagsystem/fullmakt/form/FullmaktForm'

export const DollyValidation = Yup.object({
...PdlfForm.validation,
Expand All @@ -40,6 +41,7 @@ export const DollyValidation = Yup.object({
...ArenaForm.validation,
...UdistubForm.validation,
...SkjermingForm.validation,
...FullmaktForm.validation,
...DokarkivForm.validation,
...HistarkForm.validation,
...OrganisasjonForm.validation,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import { KrrstubForm } from '@/components/fagsystem/krrstub/form/KrrForm'
import { useFormContext } from 'react-hook-form'
import { SkattekortForm } from '@/components/fagsystem/skattekort/form/Form'
import { PensjonsavtaleForm } from '@/components/fagsystem/pensjonsavtale/form/Form'
import { FullmaktForm } from '@/components/fagsystem/fullmakt/form/FullmaktForm'

const gruppeNavn = (gruppe) => <span style={{ fontWeight: 'bold' }}>{gruppe.navn}</span>

Expand Down Expand Up @@ -65,6 +66,7 @@ export const Steg2 = () => {
return (
<div>
<PdlfForm />
<FullmaktForm />
<AaregForm />
<SigrunstubForm />
<SigrunstubPensjonsgivendeForm />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export const rootPaths = [
'pdldata.opprettNyPerson.foedtFoer',
'pdlforvalter',
'aareg',
'fullmakt',
'arbeidsplassenCV',
'skjerming',
'sigrunstub',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
export type FullmaktTypes = {
gyldigFraOgMed: string
gyldigTilOgMed?: string
fullmaktsgiver: string
omraade: Omraade[]
}

export type Omraade = {
tema: string
handling: string[]
}
Loading

0 comments on commit 284f061

Please sign in to comment.