-
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 branch 'master' of https://github.com/navikt/testnorge into fea…
…ture/tilpasninger-paa-foedsel
- Loading branch information
Showing
59 changed files
with
8,716 additions
and
5,138 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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,8 @@ import { useKodeverk } from '@/utils/hooks/useKodeverk' | |
import { AdresseKodeverk } from '@/config/kodeverk' | ||
import { useFormContext } from 'react-hook-form' | ||
import { KrrValidation } from '@/components/fagsystem/krrstub/form/KrrValidation' | ||
import { useBoolean } from 'react-use' | ||
import StyledAlert from '@/components/ui/alert/StyledAlert' | ||
|
||
type Change = { | ||
value: boolean | ||
|
@@ -26,6 +28,7 @@ export const KrrstubForm = () => { | |
const { kodeverk: landkoder, loading } = useKodeverk(AdresseKodeverk.ArbeidOgInntektLand) | ||
const [land, setLand] = useState(formMethods.watch('krrstub.land')) | ||
const [mobilnummer, setMobilnummer] = useState(formMethods.watch('values.krrstub.mobil') || '') | ||
const [showInfoStripe, setShowInfoStripe] = useBoolean(false) | ||
const leverandoerer = SelectOptionsOppslag.hentKrrLeverandoerer() | ||
|
||
const mergedeLandkoder = landkoder?.map((landkode: Option) => { | ||
|
@@ -62,6 +65,16 @@ export const KrrstubForm = () => { | |
} | ||
formMethods.trigger('krrstub') | ||
} | ||
|
||
const handleReservertChange = (option: Option) => { | ||
setShowInfoStripe(option?.value === true) | ||
formMethods.setValue('krrstub.reservert', option?.value) | ||
if (option?.value === true && !formMethods.watch('krrstub.epost')) { | ||
formMethods.setValue('krrstub.epost', '[email protected]') | ||
} | ||
formMethods.trigger('krrstub') | ||
} | ||
|
||
return ( | ||
//@ts-ignore | ||
<Vis attributt={krrAttributt}> | ||
|
@@ -71,6 +84,12 @@ export const KrrstubForm = () => { | |
iconType="krr" | ||
startOpen={erForsteEllerTest(formMethods.getValues(), [krrAttributt])} | ||
> | ||
{showInfoStripe && ( | ||
<StyledAlert variant={'info'} size={'small'}> | ||
E-post blir automatisk lagt til dersom identen er reservert slik at den får digital | ||
kontaktinformasjon i KRR. | ||
</StyledAlert> | ||
)} | ||
<div className="flexbox--flex-wrap"> | ||
<DollySelect | ||
name="krrstub.registrert" | ||
|
@@ -85,6 +104,7 @@ export const KrrstubForm = () => { | |
<FormSelect | ||
name="krrstub.reservert" | ||
label="Reservert" | ||
onChange={handleReservertChange} | ||
options={Options('boolean')} | ||
/> | ||
<FormTextInput name="krrstub.epost" label="E-post" /> | ||
|
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
21 changes: 21 additions & 0 deletions
21
apps/dolly-frontend/src/main/js/src/components/ui/toast/InfoToast.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,21 @@ | ||
import { toast, ToastContainer } from 'react-toastify' | ||
import 'react-toastify/dist/ReactToastify.css' | ||
|
||
type Props = { | ||
infoTekst: string | ||
onClose: () => void | ||
} | ||
|
||
export const InfoToast = ({ infoTekst, onClose }: Props) => { | ||
toast.info(infoTekst, { | ||
position: 'bottom-right', | ||
toastId: 'info-toast', | ||
autoClose: 10000, | ||
closeOnClick: true, | ||
pauseOnHover: true, | ||
draggable: true, | ||
onClose: () => onClose(), | ||
}) | ||
|
||
return <ToastContainer theme={'light'} /> | ||
} |
8 changes: 0 additions & 8 deletions
8
apps/dolly-frontend/src/main/js/src/components/ui/toast/Toast.cy.tsx
This file was deleted.
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
2 changes: 1 addition & 1 deletion
2
apps/dolly-frontend/src/main/js/src/components/ui/toast/__tests__/Toast.test.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
Oops, something went wrong.