Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove line about contacting us from error message #11000

Merged
merged 1 commit into from
Sep 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion frontend/language/src/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@
"general.disabled": "Disabled",
"general.edit": "Edit",
"general.enabled": "Enabled",
"general.error_message": "An error has occurred! If the problem persists, contact us on <a href=\"https://altinn.slack.com\">Slack</a>.",
"general.error_message": "An error has occurred!",
"general.error_message_with_colon": "Error message:",
"general.fetch_error_message": "Failed to load required data for this page. Please reload the page to try again",
"general.fetch_error_title": "An error occurred while loading",
Expand Down
2 changes: 1 addition & 1 deletion frontend/language/src/nb.json
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@
"general.disabled": "Deaktivert",
"general.edit": "Endre",
"general.enabled": "Aktivert",
"general.error_message": "Det har oppstått en feil! Om problemet vedvarer, ta kontakt med oss på <a href=\"https://altinn.slack.com\">Slack</a>.",
"general.error_message": "Det har oppstått en feil!",
"general.error_message_with_colon": "Feilmelding:",
"general.fetch_error_message": "Kunne ikke laste inn nødvendig data for denne siden. Last siden på nytt for å prøve igjen.",
"general.fetch_error_title": "En feil oppstod ved innlasting av",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ import React from 'react';
import { useErrorBoundary } from 'react-error-boundary';
import { useTranslation } from 'react-i18next';
import { _useIsProdHack } from 'app-shared/utils/_useIsProdHack';
import { Trans } from 'react-i18next';
import { Alert, Button, ErrorMessage, Link, Paragraph } from '@digdir/design-system-react';
import { Alert, Button, ErrorMessage, Paragraph } from '@digdir/design-system-react';
import { Center } from './Center';
import classes from './ErrorBoundaryFallback.module.css';

Expand All @@ -18,7 +17,7 @@ export const ErrorBoundaryFallback = ({ error }: ErrorBoundaryFallbackProps) =>
return (
<Center className={classes.container}>
<Alert severity='danger' className={classes.alert}>
<Paragraph><Trans i18nKey={'general.error_message'} components={{ a: <Link>Slack</Link> }}/></Paragraph>
<Paragraph>{t('general.error_message')}</Paragraph>
{!_useIsProdHack && <ErrorMessage>{error.message}</ErrorMessage>}
<Center>
<Button onClick={resetBoundary} size='small'>{t('general.try_again')}</Button>
Expand Down
10 changes: 2 additions & 8 deletions frontend/packages/shared/src/contexts/ServicesContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ import { ReactQueryDevtools } from '@tanstack/react-query-devtools';
import { ToastContainer, Slide, toast } from 'react-toastify';
import { ErrorBoundary } from 'react-error-boundary';
import { AxiosError } from 'axios';
import { Trans, useTranslation } from 'react-i18next';
import { Link } from '@digdir/design-system-react';
import { useTranslation } from 'react-i18next';
import { ErrorBoundaryFallback } from '../components/ErrorBoundaryFallback';

import 'react-toastify/dist/ReactToastify.css';
Expand Down Expand Up @@ -46,12 +45,7 @@ const handleError = (
return;

toast.error(
() => (
<Trans
i18nKey={'general.error_message'}
components={{ a: <Link inverted={true}>Slack</Link> }}
/>
),
() => t('general.error_message'),
{ toastId: 'default' }
);
};
Expand Down