-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(auth-admin): Show relevant error messages (#16180)
* show propper error messages * chore: nx format:write update dirty files * return error message and code, use code to translate error on client * chore: nx format:write update dirty files * Fix typos * Explicitly type FORM_ERRORS --------- Co-authored-by: andes-it <[email protected]> Co-authored-by: Sævar Már Atlason <[email protected]> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
- Loading branch information
1 parent
c590e28
commit efbef76
Showing
7 changed files
with
97 additions
and
18 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
14 changes: 14 additions & 0 deletions
14
libs/portals/admin/delegation-admin/src/constants/errors.ts
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,14 @@ | ||
import { MessageDescriptor } from 'react-intl' | ||
|
||
import { ErrorCodes } from '@island.is/shared/utils' | ||
|
||
import { m } from '../lib/messages' | ||
|
||
export const FORM_ERRORS: Record<ErrorCodes, MessageDescriptor> = { | ||
[ErrorCodes.ZENDESK_NATIONAL_IDS_MISMATCH]: m.nationalIdsMismatchError, | ||
[ErrorCodes.ZENDESK_CUSTOM_FIELDS_MISSING]: m.zendeskCustomFieldsMissingError, | ||
[ErrorCodes.ZENDESK_TAG_MISSING]: m.zendeskMissingTagError, | ||
[ErrorCodes.ZENDESK_STATUS]: m.zendeskCaseNotSolvedError, | ||
[ErrorCodes.INPUT_VALIDATION_SAME_NATIONAL_ID]: m.sameNationalIdError, | ||
[ErrorCodes.INPUT_VALIDATION_INVALID_PERSON]: m.validPersonError, | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export enum ErrorCodes { | ||
ZENDESK_NATIONAL_IDS_MISMATCH = 'ZENDESK_NATIONAL_IDS_MISMATCH', | ||
ZENDESK_CUSTOM_FIELDS_MISSING = 'ZENDESK_CUSTOM_FIELDS_MISSING', | ||
ZENDESK_TAG_MISSING = 'ZENDESK_TAG_MISSING', | ||
ZENDESK_STATUS = 'ZENDESK_STATUS', | ||
INPUT_VALIDATION_SAME_NATIONAL_ID = 'INPUT_VALIDATION_SAME_NATIONAL_ID', | ||
INPUT_VALIDATION_INVALID_PERSON = 'INPUT_VALIDATION_INVALID_PERSON', | ||
} |