Skip to content

Commit

Permalink
Test error-modal #deploy-test-frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
betsytraran committed Dec 20, 2024
1 parent 9326f9b commit a6471b4
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,16 @@ export default () => {
message: 'Ukjent feil ved henting av organisasjoner for bankid bruker',
uuid: window.uuid,
})
if (errorModalIsOpen) {
return (
<ErrorModal closeErrorModal={closeErrorModal} errorModalIsOpen={errorModalIsOpen} />
)
} else {
logoutBruker(UNKNOWN_ERROR)
}
// return (
// <ErrorModal
// closeErrorModal={closeErrorModal}
// errorModalIsOpen={errorModalIsOpen}
// error={UNKNOWN_ERROR}
// />
// )
// else {
// logoutBruker(UNKNOWN_ERROR)
// }
}
setOrganisasjoner(response.data)
setModalHeight(310 + 55 * response.data.length)
Expand Down Expand Up @@ -115,6 +118,13 @@ export default () => {
<div className="bruker-modal" style={{ height: modalHeight + 'px', display: 'flexbox' }}>
<h1>Velkommen til Dolly</h1>
{loading && <Loading label="Loading" />}
{errorModalIsOpen && (
<ErrorModal
closeErrorModal={closeErrorModal}
errorModalIsOpen={errorModalIsOpen}
error={UNKNOWN_ERROR}
/>
)}
{!organisasjon && !loading && (
<OrganisasjonVelger orgdata={organisasjoner} onClick={selectOrganisasjon} />
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ import Icon from '@/components/ui/icon/Icon'
import NavButton from '@/components/ui/button/NavButton/NavButton'
import { DollyModal } from '@/components/ui/modal/DollyModal'
import React from 'react'
import logoutBruker from '@/components/utlogging/logoutBruker'

export const ErrorModal = ({ errorModalIsOpen, closeErrorModal }) => {
export const ErrorModal = ({ errorModalIsOpen, closeErrorModal, error }) => {
return (
<DollyModal isOpen={errorModalIsOpen} closeModal={closeErrorModal} width="40%" overflow="auto">
<div className="slettModal">
Expand All @@ -16,7 +17,13 @@ export const ErrorModal = ({ errorModalIsOpen, closeErrorModal }) => {
</h4>
</div>
<div className="slettModal-actions">
<NavButton onClick={() => closeErrorModal()} variant="primary">
<NavButton
onClick={() => {
closeErrorModal()
logoutBruker(error)
}}
variant="primary"
>
Tilbake
</NavButton>
</div>
Expand Down

0 comments on commit a6471b4

Please sign in to comment.