-
Notifications
You must be signed in to change notification settings - Fork 6
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 #1066 from navikt/tiltakshendelser-kolonner
Vis kolonner med info om tiltakshendelse
- Loading branch information
Showing
13 changed files
with
169 additions
and
22 deletions.
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
src/components/tabell/kolonner/tiltakshendelse-lenke-kolonne.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,42 @@ | ||
import {BrukerModell} from '../../../model-interfaces'; | ||
import {oppdaterBrukerIKontekstOgNavigerTilLenke} from '../../../utils/utils'; | ||
import {AksjonKnappMedPopoverFeilmelding} from '../../aksjon-knapp-med-popover-feilmelding/aksjon-knapp-med-popover-feilmelding'; | ||
import {getVeilarbpersonflateUrl} from '../../../utils/url-utils'; | ||
|
||
interface LenkeKolonneProps { | ||
bruker: BrukerModell; | ||
skalVises: boolean; | ||
enhetId: string; | ||
className?: string; | ||
} | ||
|
||
export const TiltakshendelseLenkeKolonne = ({bruker, skalVises, enhetId, className}: LenkeKolonneProps) => { | ||
if (!skalVises || !bruker.tiltakshendelse) { | ||
return null; | ||
} | ||
|
||
const tiltakshendelse = bruker.tiltakshendelse; | ||
|
||
const handterKlikk = () => | ||
oppdaterBrukerIKontekstOgNavigerTilLenke(bruker.fnr, getVeilarbpersonflateUrl(tiltakshendelse.lenke, enhetId)); | ||
|
||
const handterKlikkNyFane = () => | ||
oppdaterBrukerIKontekstOgNavigerTilLenke( | ||
bruker.fnr, | ||
getVeilarbpersonflateUrl(tiltakshendelse.lenke, enhetId), | ||
true | ||
); | ||
|
||
return ( | ||
<div className={className}> | ||
{tiltakshendelse && ( | ||
<AksjonKnappMedPopoverFeilmelding | ||
klikkAksjon={handterKlikk} | ||
ctrlklikkAksjon={handterKlikkNyFane} | ||
knappStil="juster-tekst-venstre" | ||
knappTekst={tiltakshendelse.tekst} | ||
/> | ||
)} | ||
</div> | ||
); | ||
}; |
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
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