diff --git a/scm-ui-components/packages/ui-components/src/ErrorNotification.js b/scm-ui-components/packages/ui-components/src/ErrorNotification.js index 64a31c8da4..747978297b 100644 --- a/scm-ui-components/packages/ui-components/src/ErrorNotification.js +++ b/scm-ui-components/packages/ui-components/src/ErrorNotification.js @@ -2,7 +2,7 @@ import React from "react"; import { translate } from "react-i18next"; import Notification from "./Notification"; -import {BackendError, UnauthorizedError} from "./errors"; +import { BackendError, UnauthorizedError } from "./errors"; type Props = { t: string => string, @@ -10,13 +10,15 @@ type Props = { }; class ErrorNotification extends React.Component { - renderMoreInformationLink(error: BackendError) { if (error.url) { // TODO i18n return (

- For more information, see {error.errorCode} + For more information, see{" "} + + {error.errorCode} +

); } @@ -37,7 +39,9 @@ class ErrorNotification extends React.Component { return (

{error.message}

-

Context:

+

+ Context: +

    {error.context.map((context, index) => { return ( @@ -47,24 +51,30 @@ class ErrorNotification extends React.Component { ); })}
- { this.renderMoreInformationLink(error) } + {this.renderMoreInformationLink(error)}
-
- ErrorCode: {error.errorCode} -
-
- TransactionId: {error.transactionId} -
+
ErrorCode: {error.errorCode}
+
TransactionId: {error.transactionId}
); - } + }; render() { const { t, error } = this.props; if (error) { if (error instanceof BackendError) { - return this.renderBackendError(error) + return this.renderBackendError(error); + } else if (error instanceof UnauthorizedError) { + return ( + + {t("error-notification.prefix")}:{" "} + {t("error-notification.timeout")}{" "} + + {t("error-notification.loginLink")} + + + ); } else { return (