-
Notifications
You must be signed in to change notification settings - Fork 1
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 #1014 from navikt/ErrorSummaryStart
Error summary start
- Loading branch information
Showing
10 changed files
with
118 additions
and
38 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
37 changes: 37 additions & 0 deletions
37
apps/frontend/src/components/etterlevelse/Edit/SuksesskriterieErrorFields.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,37 @@ | ||
import { ErrorSummary } from '@navikt/ds-react' | ||
import { FormikErrors } from 'formik' | ||
import _ from 'lodash' | ||
import React from 'react' | ||
import { ISuksesskriterieBegrunnelse } from '../../../constants' | ||
|
||
interface IProps { | ||
errors: FormikErrors<ISuksesskriterieBegrunnelse>[] | ||
} | ||
|
||
export const SuksesskriterieErrorFields = (props: IProps) => { | ||
const { errors } = props | ||
|
||
return ( | ||
<> | ||
{errors.map((error, index) => { | ||
if (!_.isEmpty(error)) { | ||
return ( | ||
<React.Fragment key={'suksesskrietier_error_' + index}> | ||
{error.begrunnelse && ( | ||
<ErrorSummary.Item href={'#begrunnelse_' + index}> | ||
{error.begrunnelse} | ||
</ErrorSummary.Item> | ||
)} | ||
{error.suksesskriterieStatus && ( | ||
<ErrorSummary.Item href={'#suksesskriterieStatus_' + index}> | ||
{error.suksesskriterieStatus} | ||
</ErrorSummary.Item> | ||
)} | ||
</React.Fragment> | ||
) | ||
} | ||
})} | ||
</> | ||
) | ||
} | ||
export default SuksesskriterieErrorFields |
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