diff --git a/scm-ui-components/packages/ui-components/src/ErrorNotification.js b/scm-ui-components/packages/ui-components/src/ErrorNotification.js index 5600d81799..8225c0914a 100644 --- a/scm-ui-components/packages/ui-components/src/ErrorNotification.js +++ b/scm-ui-components/packages/ui-components/src/ErrorNotification.js @@ -2,6 +2,7 @@ import React from "react"; import { translate } from "react-i18next"; import Notification from "./Notification"; +import { UNAUTHORIZED_ERROR } from "./apiclient"; type Props = { t: string => string, @@ -12,11 +13,19 @@ class ErrorNotification extends React.Component { render() { const { t, error } = this.props; if (error) { - return ( - - {t("error-notification.prefix")}: {error.message} - - ); + if (error == UNAUTHORIZED_ERROR) { + return ( + + {t("error-notification.prefix")}: {t("error-notification.timeout")} Login + + ); + } else { + return ( + + {t("error-notification.prefix")}: {error.message} + + ); + } } return null; } diff --git a/scm-ui/public/locales/en/commons.json b/scm-ui/public/locales/en/commons.json index 47a8735e5b..fe1062e789 100644 --- a/scm-ui/public/locales/en/commons.json +++ b/scm-ui/public/locales/en/commons.json @@ -20,7 +20,8 @@ } }, "error-notification": { - "prefix": "Error" + "prefix": "Error", + "timeout": "The session has expired. Please login again." }, "loading": { "alt": "Loading ..."