-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lag saksvarsel og flytt kravgrunnlagvarsel til sak
- Loading branch information
1 parent
6285338
commit 3739b4c
Showing
20 changed files
with
574 additions
and
222 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
222 changes: 123 additions & 99 deletions
222
src/components/oppsummering/kravgrunnlag/OppsummeringAvKravgrunnlag.tsx
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
7 changes: 7 additions & 0 deletions
7
src/pages/saksbehandling/sakintro/saksvarsler/Saksvarsler.module.less
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,7 @@ | ||
@import '~/src/styles/variables.less'; | ||
|
||
.alert { | ||
> :last-child { | ||
max-width: 100%; | ||
} | ||
} |
72 changes: 72 additions & 0 deletions
72
src/pages/saksbehandling/sakintro/saksvarsler/Saksvarsler.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,72 @@ | ||
import { Alert, BodyShort } from '@navikt/ds-react'; | ||
import React from 'react'; | ||
|
||
import { Person } from '~src/types/Person'; | ||
import { Sak, SakvarselType } from '~src/types/Sak'; | ||
import { getSakvarsler, SakvarseltypeMedContext } from '~src/utils/SakUtils'; | ||
|
||
import FnrEndringsvarsel from './fnrEndringsvarsel/FnrEndringsvarsel'; | ||
import NyttKravgrunnlagsvarsel from './nyttKravgrunnlagsvarsel/NyttKravgrunnlagsvarsel'; | ||
import styles from './Saksvarsler.module.less'; | ||
|
||
const Saksvarsler = (props: { sak: Sak; søker: Person }) => { | ||
const varsler = getSakvarsler({ sak: props.sak, søker: props.søker }); | ||
|
||
if (varsler.length === 0) { | ||
return null; | ||
} | ||
|
||
return ( | ||
<Alert variant={'warning'} className={styles.alert}> | ||
<ul> | ||
{varsler.map((v, i) => ( | ||
<li key={i}>{saksvarseltypeToComponent({ sak: props.sak, søker: props.søker, varsel: v })}</li> | ||
))} | ||
</ul> | ||
</Alert> | ||
); | ||
}; | ||
|
||
const saksvarseltypeToComponent = (arg: { sak: Sak; søker: Person; varsel: SakvarseltypeMedContext }) => { | ||
switch (arg.varsel.type) { | ||
case SakvarselType.FNR_ENDRING: | ||
return <FnrEndringsvarsel sak={arg.sak} søker={arg.søker} />; | ||
case SakvarselType.NYTT_KRAVGRUNNLAG_MED_ÅPEN_TILBAKEKREVING: { | ||
if (!arg.varsel.context?.behandlingId) { | ||
return ( | ||
<BodyShort> | ||
Har identifisert et nytt kravgrunnlag på sak, men mangler behandlingscontext - Behov for å sende | ||
en melding til utviklerne fordi vi er så primitive | ||
</BodyShort> | ||
); | ||
} | ||
if (!arg.sak.uteståendeKravgrunnlag) { | ||
return ( | ||
<BodyShort> | ||
Har identifisert et nytt kravgrunnlag på sak, men mangler det utestående kravgrunnlaget på sak - | ||
Behov for å sende en melding til utviklerne fordi vi er så primitive | ||
</BodyShort> | ||
); | ||
} | ||
const behandling = arg.sak.tilbakekrevinger.find((t) => t.id === arg.varsel.context!.behandlingId); | ||
|
||
if (!behandling) { | ||
return ( | ||
<BodyShort> | ||
Har identifisert et nytt kravgrunnlag på sak, men fant ikke behandlingen på sak - Behov for å | ||
sende en melding til utviklerne fordi vi er så primitive | ||
</BodyShort> | ||
); | ||
} | ||
return ( | ||
<NyttKravgrunnlagsvarsel | ||
saksversjon={arg.sak.versjon} | ||
uteståendeKravgrunnlag={arg.sak.uteståendeKravgrunnlag} | ||
behandling={behandling} | ||
/> | ||
); | ||
} | ||
} | ||
}; | ||
|
||
export default Saksvarsler; |
24 changes: 24 additions & 0 deletions
24
...pages/saksbehandling/sakintro/saksvarsler/fnrEndringsvarsel/FnrEndringsvarsel.module.less
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,24 @@ | ||
@import '~/src/styles/variables.less'; | ||
|
||
.fnrEndringsModal { | ||
width: 500px; | ||
} | ||
|
||
.merInfoButton { | ||
padding: 0.2rem 0.5rem; | ||
} | ||
|
||
.modalFooter { | ||
display: flex; | ||
flex-direction: column; | ||
} | ||
|
||
.modalFooterButtonsContainer { | ||
display: flex; | ||
gap: @spacing; | ||
justify-content: flex-end; | ||
|
||
button { | ||
margin: 0 !important; | ||
} | ||
} |
Oops, something went wrong.